Skip to content

Commit f2f5f5f

Browse files
fixed sensio labs violations
1 parent df638f4 commit f2f5f5f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

lib/DocumentAuthentication/FrontControllerPlugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public function preDispatch(Zend_Controller_Request_Abstract $request)
2020
*/
2121
private function handleDocumentAuthentication($document)
2222
{
23-
2423
if (is_object($document)) {
2524

2625
if (!$document->getProperty(DocumentAuthentication_Plugin::DOC_PROPERTY_DOCUMENT_AUTHENTICATION_ENABLED)) {

lib/DocumentAuthentication/Plugin.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
class DocumentAuthentication_Plugin extends Pimcore_API_Plugin_Abstract implements Pimcore_API_Plugin_Interface {
3+
class DocumentAuthentication_Plugin
4+
extends Pimcore_API_Plugin_Abstract
5+
implements Pimcore_API_Plugin_Interface
6+
{
47

58
const DOC_PROPERTY_DOCUMENT_AUTHENTICATION_ENABLED
69
= 'documentAuthenticationEnabled';
@@ -76,8 +79,15 @@ public static function isInstalled()
7679
{
7780
$db = Pimcore_Resource_Mysql::getConnection();
7881

79-
$sql = "SELECT COUNT(id) as num FROM " . self::DB_TABLE_PRE_PROPERTIES . " WHERE name = ?";
80-
$isInstalled = ((int)$db->fetchOne($sql, array(self::DOC_PROPERTY_DOCUMENT_AUTHENTICATION_ENABLED)) > 0);
82+
$sql = "SELECT COUNT(id) as num FROM ? WHERE name = ?";
83+
$isInstalled = (
84+
(int)$db->fetchOne(
85+
$sql,
86+
array(
87+
self::DB_TABLE_PRE_PROPERTIES,
88+
self::DOC_PROPERTY_DOCUMENT_AUTHENTICATION_ENABLED
89+
)
90+
) > 0);
8191

8292
return $isInstalled;
8393
}

0 commit comments

Comments
 (0)