Passed
Branch master (ef3387)
by Anthony
09:36
created
libs/ckfinder/core/connector/php/php5/CommandHandler/Init.php 3 patches
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -32,116 +32,116 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_Init extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    private $command = "Init";
42
-
43
-    protected function mustCheckRequest()
44
-    {
45
-        return false;
46
-    }
47
-
48
-    /**
49
-     * Must add CurrentFolder node?
50
-     *
51
-     * @return boolean
52
-     * @access protected
53
-     */
54
-    protected function mustAddCurrentFolderNode()
55
-    {
56
-        return false;
57
-    }
58
-
59
-    /**
60
-     * handle request and build XML
61
-     * @access protected
62
-     *
63
-     */
64
-    protected function buildXml()
65
-    {
66
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67
-
68
-        // Create the "ConnectorInfo" node.
69
-        $_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
70
-        $this->_connectorNode->addChild($_oConnInfo);
71
-        $_oConnInfo->addAttribute("enabled", $_config->getIsEnabled() ? "true" : "false");
72
-
73
-        if (!$_config->getIsEnabled()) {
74
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75
-        }
76
-
77
-        $_ln = '' ;
78
-        $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
81
-
82
-        $_oConnInfo->addAttribute("s", $_ln);
83
-        $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
84
-        $_thumbnailsConfig = $_config->getThumbnailsConfig();
85
-        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
86
-        $_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87
-        if ($_thumbnailsEnabled) {
88
-            $_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
-            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
90
-        }
91
-        $_imagesConfig = $_config->getImagesConfig();
92
-        $_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
93
-        $_oConnInfo->addAttribute("imgHeight", $_imagesConfig->getMaxHeight());
94
-
95
-        // Create the "ResourceTypes" node.
96
-        $_oResourceTypes = new Ckfinder_Connector_Utils_XmlNode("ResourceTypes");
97
-        $this->_connectorNode->addChild($_oResourceTypes);
98
-        // Create the "PluginsInfo" node.
99
-        $_oPluginsInfo = new Ckfinder_Connector_Utils_XmlNode("PluginsInfo");
100
-        $this->_connectorNode->addChild($_oPluginsInfo);
101
-
102
-        // Load the resource types in an array.
103
-        $_aTypes = $_config->getDefaultResourceTypes();
104
-
105
-        if (!sizeof($_aTypes)) {
106
-            $_aTypes = $_config->getResourceTypeNames();
107
-        }
108
-
109
-        $_aTypesSize = sizeof($_aTypes);
110
-        if ($_aTypesSize) {
111
-            for ($i = 0; $i < $_aTypesSize; $i++)
112
-            {
113
-                $_resourceTypeName = $_aTypes[$i];
114
-
115
-                $_acl = $_config->getAccessControlConfig();
116
-                $_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117
-
118
-                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
119
-                    continue;
120
-                }
121
-
122
-                if (!isset($_GET['type']) || $_GET['type'] === $_resourceTypeName) {
123
-                    //print $_resourceTypeName;
124
-                    $_oTypeInfo = $_config->getResourceTypeConfig($_resourceTypeName);
125
-                    //print_r($_oTypeInfo);
126
-                    $_oResourceType[$i] = new Ckfinder_Connector_Utils_XmlNode("ResourceType");
127
-                    $_oResourceTypes->addChild($_oResourceType[$i]);
128
-
129
-                    $_oResourceType[$i]->addAttribute("name", $_resourceTypeName);
130
-                    $_oResourceType[$i]->addAttribute("url", $_oTypeInfo->getUrl());
131
-                    $_oResourceType[$i]->addAttribute("allowedExtensions", implode(",", $_oTypeInfo->getAllowedExtensions()));
132
-                    $_oResourceType[$i]->addAttribute("deniedExtensions", implode(",", $_oTypeInfo->getDeniedExtensions()));
133
-                    $_oResourceType[$i]->addAttribute("hash", substr(md5($_oTypeInfo->getDirectory()), 0, 16));
134
-                    $_oResourceType[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_oTypeInfo->getDirectory()) ? "true" : "false");
135
-                    $_oResourceType[$i]->addAttribute("acl", $_aclMask);
136
-                }
137
-            }
138
-        }
139
-
140
-        $config = $GLOBALS['config'];
141
-        if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
142
-            $_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143
-        }
144
-
145
-        CKFinder_Connector_Core_Hooks::run('InitCommand', array(&$this->_connectorNode));
146
-    }
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	private $command = "Init";
42
+
43
+	protected function mustCheckRequest()
44
+	{
45
+		return false;
46
+	}
47
+
48
+	/**
49
+	 * Must add CurrentFolder node?
50
+	 *
51
+	 * @return boolean
52
+	 * @access protected
53
+	 */
54
+	protected function mustAddCurrentFolderNode()
55
+	{
56
+		return false;
57
+	}
58
+
59
+	/**
60
+	 * handle request and build XML
61
+	 * @access protected
62
+	 *
63
+	 */
64
+	protected function buildXml()
65
+	{
66
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67
+
68
+		// Create the "ConnectorInfo" node.
69
+		$_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
70
+		$this->_connectorNode->addChild($_oConnInfo);
71
+		$_oConnInfo->addAttribute("enabled", $_config->getIsEnabled() ? "true" : "false");
72
+
73
+		if (!$_config->getIsEnabled()) {
74
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75
+		}
76
+
77
+		$_ln = '' ;
78
+		$_lc = $_config->getLicenseKey() . '                                  ' ;
79
+		if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
+		$_ln = $_config->getLicenseName() ;
81
+
82
+		$_oConnInfo->addAttribute("s", $_ln);
83
+		$_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
84
+		$_thumbnailsConfig = $_config->getThumbnailsConfig();
85
+		$_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
86
+		$_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87
+		if ($_thumbnailsEnabled) {
88
+			$_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
+			$_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
90
+		}
91
+		$_imagesConfig = $_config->getImagesConfig();
92
+		$_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
93
+		$_oConnInfo->addAttribute("imgHeight", $_imagesConfig->getMaxHeight());
94
+
95
+		// Create the "ResourceTypes" node.
96
+		$_oResourceTypes = new Ckfinder_Connector_Utils_XmlNode("ResourceTypes");
97
+		$this->_connectorNode->addChild($_oResourceTypes);
98
+		// Create the "PluginsInfo" node.
99
+		$_oPluginsInfo = new Ckfinder_Connector_Utils_XmlNode("PluginsInfo");
100
+		$this->_connectorNode->addChild($_oPluginsInfo);
101
+
102
+		// Load the resource types in an array.
103
+		$_aTypes = $_config->getDefaultResourceTypes();
104
+
105
+		if (!sizeof($_aTypes)) {
106
+			$_aTypes = $_config->getResourceTypeNames();
107
+		}
108
+
109
+		$_aTypesSize = sizeof($_aTypes);
110
+		if ($_aTypesSize) {
111
+			for ($i = 0; $i < $_aTypesSize; $i++)
112
+			{
113
+				$_resourceTypeName = $_aTypes[$i];
114
+
115
+				$_acl = $_config->getAccessControlConfig();
116
+				$_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117
+
118
+				if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
119
+					continue;
120
+				}
121
+
122
+				if (!isset($_GET['type']) || $_GET['type'] === $_resourceTypeName) {
123
+					//print $_resourceTypeName;
124
+					$_oTypeInfo = $_config->getResourceTypeConfig($_resourceTypeName);
125
+					//print_r($_oTypeInfo);
126
+					$_oResourceType[$i] = new Ckfinder_Connector_Utils_XmlNode("ResourceType");
127
+					$_oResourceTypes->addChild($_oResourceType[$i]);
128
+
129
+					$_oResourceType[$i]->addAttribute("name", $_resourceTypeName);
130
+					$_oResourceType[$i]->addAttribute("url", $_oTypeInfo->getUrl());
131
+					$_oResourceType[$i]->addAttribute("allowedExtensions", implode(",", $_oTypeInfo->getAllowedExtensions()));
132
+					$_oResourceType[$i]->addAttribute("deniedExtensions", implode(",", $_oTypeInfo->getDeniedExtensions()));
133
+					$_oResourceType[$i]->addAttribute("hash", substr(md5($_oTypeInfo->getDirectory()), 0, 16));
134
+					$_oResourceType[$i]->addAttribute("hasChildren", CKFinder_Connector_Utils_FileSystem::hasChildren($_oTypeInfo->getDirectory()) ? "true" : "false");
135
+					$_oResourceType[$i]->addAttribute("acl", $_aclMask);
136
+				}
137
+			}
138
+		}
139
+
140
+		$config = $GLOBALS['config'];
141
+		if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
142
+			$_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143
+		}
144
+
145
+		CKFinder_Connector_Core_Hooks::run('InitCommand', array(&$this->_connectorNode));
146
+	}
147 147
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include base XML command handler
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/XmlCommandHandlerBase.php";
25 25
 
26 26
 /**
27 27
  * Handle Init command
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function buildXml()
65 65
     {
66
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
66
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
67 67
 
68 68
         // Create the "ConnectorInfo" node.
69 69
         $_oConnInfo = new Ckfinder_Connector_Utils_XmlNode("ConnectorInfo");
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED);
75 75
         }
76 76
 
77
-        $_ln = '' ;
78
-        $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
77
+        $_ln = '';
78
+        $_lc = $_config->getLicenseKey().'                                  ';
79
+        if (1 == (strpos(CKFINDER_CHARS, $_lc[0]) % 5))
80
+        $_ln = $_config->getLicenseName();
81 81
 
82 82
         $_oConnInfo->addAttribute("s", $_ln);
83
-        $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
83
+        $_oConnInfo->addAttribute("c", trim($_lc[11].$_lc[0].$_lc [8].$_lc[12].$_lc[26].$_lc[2].$_lc[3].$_lc[25].$_lc[1]));
84 84
         $_thumbnailsConfig = $_config->getThumbnailsConfig();
85
-        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled() ;
85
+        $_thumbnailsEnabled = $_thumbnailsConfig->getIsEnabled();
86 86
         $_oConnInfo->addAttribute("thumbsEnabled", $_thumbnailsEnabled ? "true" : "false");
87 87
         if ($_thumbnailsEnabled) {
88 88
             $_oConnInfo->addAttribute("thumbsUrl", $_thumbnailsConfig->getUrl());
89
-            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false" );
89
+            $_oConnInfo->addAttribute("thumbsDirectAccess", $_thumbnailsConfig->getDirectAccess() ? "true" : "false");
90 90
         }
91 91
         $_imagesConfig = $_config->getImagesConfig();
92 92
         $_oConnInfo->addAttribute("imgWidth", $_imagesConfig->getMaxWidth());
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 $_acl = $_config->getAccessControlConfig();
116 116
                 $_aclMask = $_acl->getComputedMask($_resourceTypeName, "/");
117 117
 
118
-                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
118
+                if (($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) {
119 119
                     continue;
120 120
                 }
121 121
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         }
139 139
 
140 140
         $config = $GLOBALS['config'];
141
-        if (!empty($config['Plugins']) && is_array($config['Plugins']) ) {
141
+        if (!empty($config['Plugins']) && is_array($config['Plugins'])) {
142 142
             $_oConnInfo->addAttribute("plugins", implode(",", $config['Plugins']));
143 143
         }
144 144
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -76,8 +78,9 @@  discard block
 block discarded – undo
76 78
 
77 79
         $_ln = '' ;
78 80
         $_lc = $_config->getLicenseKey() . '                                  ' ;
79
-        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) )
80
-        $_ln = $_config->getLicenseName() ;
81
+        if ( 1 == ( strpos( CKFINDER_CHARS, $_lc[0] ) % 5 ) ) {
82
+                $_ln = $_config->getLicenseName() ;
83
+        }
81 84
 
82 85
         $_oConnInfo->addAttribute("s", $_ln);
83 86
         $_oConnInfo->addAttribute("c", trim( $_lc[11] . $_lc[0] . $_lc [8] . $_lc[12] . $_lc[26] . $_lc[2] . $_lc[3] . $_lc[25] . $_lc[1] ));
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/CommandHandler/DownloadFile.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -27,63 +27,63 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_CommandHandler_DownloadFile extends CKFinder_Connector_CommandHandler_CommandHandlerBase
29 29
 {
30
-    /**
31
-     * Command name
32
-     *
33
-     * @access private
34
-     * @var string
35
-     */
36
-    private $command = "DownloadFile";
30
+	/**
31
+	 * Command name
32
+	 *
33
+	 * @access private
34
+	 * @var string
35
+	 */
36
+	private $command = "DownloadFile";
37 37
 
38
-    /**
39
-     * send response (file)
40
-     * @access public
41
-     *
42
-     */
43
-    public function sendResponse()
44
-    {
45
-        if (!function_exists('ob_list_handlers') || ob_list_handlers()) {
46
-            @ob_end_clean();
47
-        }
48
-        header("Content-Encoding: none");
38
+	/**
39
+	 * send response (file)
40
+	 * @access public
41
+	 *
42
+	 */
43
+	public function sendResponse()
44
+	{
45
+		if (!function_exists('ob_list_handlers') || ob_list_handlers()) {
46
+			@ob_end_clean();
47
+		}
48
+		header("Content-Encoding: none");
49 49
 
50
-        $this->checkConnector();
51
-        $this->checkRequest();
50
+		$this->checkConnector();
51
+		$this->checkRequest();
52 52
 
53
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
54
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
55
-        }
53
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
54
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
55
+		}
56 56
 
57
-        $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
58
-        $_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
57
+		$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
58
+		$_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
59 59
 
60
-        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
61
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
62
-        }
60
+		if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
61
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
62
+		}
63 63
 
64
-        if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
65
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
66
-        }
64
+		if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
65
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
66
+		}
67 67
 
68
-        $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
69
-        if ($_resourceTypeInfo->checkIsHiddenFile($fileName) || !file_exists($filePath) || !is_file($filePath)) {
70
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
71
-        }
68
+		$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
69
+		if ($_resourceTypeInfo->checkIsHiddenFile($fileName) || !file_exists($filePath) || !is_file($filePath)) {
70
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
71
+		}
72 72
 
73
-        $fileName = CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName);
73
+		$fileName = CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName);
74 74
 
75
-        header("Cache-Control: cache, must-revalidate");
76
-        header("Pragma: public");
77
-        header("Expires: 0");
78
-        if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79
-            header("Content-Type: text/plain; charset=utf-8");
80
-        }
81
-        else {
82
-            header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
-            header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84
-        }
85
-        header("Content-Length: " . filesize($filePath));
86
-        CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87
-        exit;
88
-    }
75
+		header("Cache-Control: cache, must-revalidate");
76
+		header("Pragma: public");
77
+		header("Expires: 0");
78
+		if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79
+			header("Content-Type: text/plain; charset=utf-8");
80
+		}
81
+		else {
82
+			header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
+			header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84
+		}
85
+		header("Content-Length: " . filesize($filePath));
86
+		CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87
+		exit;
88
+	}
89 89
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
             header("Content-Type: text/plain; charset=utf-8");
80 80
         }
81 81
         else {
82
-            header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83
-            header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
82
+            header("Content-type: application/octet-stream; name=\"".$fileName."\"");
83
+            header("Content-Disposition: attachment; filename=\"".str_replace("\"", "\\\"", $fileName)."\"");
84 84
         }
85
-        header("Content-Length: " . filesize($filePath));
85
+        header("Content-Length: ".filesize($filePath));
86 86
         CKFinder_Connector_Utils_FileSystem::readfileChunked($filePath);
87 87
         exit;
88 88
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -77,8 +79,7 @@  discard block
 block discarded – undo
77 79
         header("Expires: 0");
78 80
         if (!empty($_GET['format']) && $_GET['format'] == 'text') {
79 81
             header("Content-Type: text/plain; charset=utf-8");
80
-        }
81
-        else {
82
+        } else {
82 83
             header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
83 84
             header("Content-Disposition: attachment; filename=\"" . str_replace("\"", "\\\"", $fileName). "\"");
84 85
         }
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/CommandHandler/GetFiles.php 3 patches
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -32,98 +32,98 @@
 block discarded – undo
32 32
  */
33 33
 class CKFinder_Connector_CommandHandler_GetFiles extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
34 34
 {
35
-    /**
36
-     * Command name
37
-     *
38
-     * @access private
39
-     * @var string
40
-     */
41
-    private $command = "GetFiles";
35
+	/**
36
+	 * Command name
37
+	 *
38
+	 * @access private
39
+	 * @var string
40
+	 */
41
+	private $command = "GetFiles";
42 42
 
43
-    /**
44
-     * handle request and build XML
45
-     * @access protected
46
-     *
47
-     */
48
-    protected function buildXml()
49
-    {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
-        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
-        }
43
+	/**
44
+	 * handle request and build XML
45
+	 * @access protected
46
+	 *
47
+	 */
48
+	protected function buildXml()
49
+	{
50
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51
+		if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53
+		}
54 54
 
55
-        // Map the virtual path to the local server path.
56
-        $_sServerDir = $this->_currentFolder->getServerPath();
55
+		// Map the virtual path to the local server path.
56
+		$_sServerDir = $this->_currentFolder->getServerPath();
57 57
 
58
-        // Create the "Files" node.
59
-        $oFilesNode = new Ckfinder_Connector_Utils_XmlNode("Files");
60
-        $this->_connectorNode->addChild($oFilesNode);
58
+		// Create the "Files" node.
59
+		$oFilesNode = new Ckfinder_Connector_Utils_XmlNode("Files");
60
+		$this->_connectorNode->addChild($oFilesNode);
61 61
 
62
-        if (!is_dir($_sServerDir)) {
63
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
64
-        }
62
+		if (!is_dir($_sServerDir)) {
63
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND);
64
+		}
65 65
 
66
-        $files = array();
67
-        $thumbFiles = array();
66
+		$files = array();
67
+		$thumbFiles = array();
68 68
 
69
-        if ($dh = @opendir($_sServerDir)) {
70
-            while (($file = readdir($dh)) !== false) {
71
-                if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
72
-                    $files[] = $file;
73
-                }
74
-            }
75
-            closedir($dh);
76
-        } else {
77
-            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
78
-        }
69
+		if ($dh = @opendir($_sServerDir)) {
70
+			while (($file = readdir($dh)) !== false) {
71
+				if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
72
+					$files[] = $file;
73
+				}
74
+			}
75
+			closedir($dh);
76
+		} else {
77
+			$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
78
+		}
79 79
 
80
-        $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
80
+		$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
81 81
 
82
-        if (sizeof($files)>0) {
83
-            $_thumbnailsConfig = $_config->getThumbnailsConfig();
84
-            $_thumbServerPath = '';
85
-            $_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
86
-            if ($_thumbnailsConfig->getIsEnabled() && ($_thumbnailsConfig->getDirectAccess() || $_showThumbs)) {
87
-                $_thumbServerPath = $this->_currentFolder->getThumbsServerPath();
88
-            }
82
+		if (sizeof($files)>0) {
83
+			$_thumbnailsConfig = $_config->getThumbnailsConfig();
84
+			$_thumbServerPath = '';
85
+			$_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
86
+			if ($_thumbnailsConfig->getIsEnabled() && ($_thumbnailsConfig->getDirectAccess() || $_showThumbs)) {
87
+				$_thumbServerPath = $this->_currentFolder->getThumbsServerPath();
88
+			}
89 89
 
90
-            natcasesort($files);
91
-            $i=0;
92
-            foreach ($files as $file) {
93
-                $filemtime = @filemtime($_sServerDir . $file);
90
+			natcasesort($files);
91
+			$i=0;
92
+			foreach ($files as $file) {
93
+				$filemtime = @filemtime($_sServerDir . $file);
94 94
 
95
-                //otherwise file doesn't exist or we can't get it's filename properly
96
-                if ($filemtime !== false) {
97
-                    $filename = CKFinder_Connector_Utils_Misc::mbBasename($file);
98
-                    if (!$resourceTypeInfo->checkExtension($filename, false)) {
99
-                        continue;
100
-                    }
101
-                    if ($resourceTypeInfo->checkIsHiddenFile($filename)) {
102
-                        continue;
103
-                    }
104
-                    $oFileNode[$i] = new Ckfinder_Connector_Utils_XmlNode("File");
105
-                    $oFilesNode->addChild($oFileNode[$i]);
106
-                    $oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107
-                    $oFileNode[$i]->addAttribute("date", @date("YmdHi", $filemtime));
108
-                    if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
-                        if (file_exists($_thumbServerPath . $filename)) {
110
-                            $oFileNode[$i]->addAttribute("thumb", $filename);
111
-                        }
112
-                        elseif ($_showThumbs) {
113
-                            $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114
-                        }
115
-                    }
116
-                    $size = filesize($_sServerDir . $file);
117
-                    if ($size && $size<1024) {
118
-                        $size = 1;
119
-                    }
120
-                    else {
121
-                        $size = (int)round($size / 1024);
122
-                    }
123
-                    $oFileNode[$i]->addAttribute("size", $size);
124
-                    $i++;
125
-                }
126
-            }
127
-        }
128
-    }
95
+				//otherwise file doesn't exist or we can't get it's filename properly
96
+				if ($filemtime !== false) {
97
+					$filename = CKFinder_Connector_Utils_Misc::mbBasename($file);
98
+					if (!$resourceTypeInfo->checkExtension($filename, false)) {
99
+						continue;
100
+					}
101
+					if ($resourceTypeInfo->checkIsHiddenFile($filename)) {
102
+						continue;
103
+					}
104
+					$oFileNode[$i] = new Ckfinder_Connector_Utils_XmlNode("File");
105
+					$oFilesNode->addChild($oFileNode[$i]);
106
+					$oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107
+					$oFileNode[$i]->addAttribute("date", @date("YmdHi", $filemtime));
108
+					if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
+						if (file_exists($_thumbServerPath . $filename)) {
110
+							$oFileNode[$i]->addAttribute("thumb", $filename);
111
+						}
112
+						elseif ($_showThumbs) {
113
+							$oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114
+						}
115
+					}
116
+					$size = filesize($_sServerDir . $file);
117
+					if ($size && $size<1024) {
118
+						$size = 1;
119
+					}
120
+					else {
121
+						$size = (int)round($size / 1024);
122
+					}
123
+					$oFileNode[$i]->addAttribute("size", $size);
124
+					$i++;
125
+				}
126
+			}
127
+		}
128
+	}
129 129
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include base XML command handler
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/CommandHandler/XmlCommandHandlerBase.php";
25 25
 
26 26
 /**
27 27
  * Handle GetFiles command
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     protected function buildXml()
49 49
     {
50
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
50
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
51 51
         if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
52 52
             $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
53 53
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         if ($dh = @opendir($_sServerDir)) {
70 70
             while (($file = readdir($dh)) !== false) {
71
-                if ($file != "." && $file != ".." && !is_dir($_sServerDir . $file)) {
71
+                if ($file != "." && $file != ".." && !is_dir($_sServerDir.$file)) {
72 72
                     $files[] = $file;
73 73
                 }
74 74
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
81 81
 
82
-        if (sizeof($files)>0) {
82
+        if (sizeof($files) > 0) {
83 83
             $_thumbnailsConfig = $_config->getThumbnailsConfig();
84 84
             $_thumbServerPath = '';
85 85
             $_showThumbs = (!empty($_GET['showThumbs']) && $_GET['showThumbs'] == 1);
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
             }
89 89
 
90 90
             natcasesort($files);
91
-            $i=0;
91
+            $i = 0;
92 92
             foreach ($files as $file) {
93
-                $filemtime = @filemtime($_sServerDir . $file);
93
+                $filemtime = @filemtime($_sServerDir.$file);
94 94
 
95 95
                 //otherwise file doesn't exist or we can't get it's filename properly
96 96
                 if ($filemtime !== false) {
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
                     $oFileNode[$i]->addAttribute("name", CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding(CKFinder_Connector_Utils_Misc::mbBasename($file)));
107 107
                     $oFileNode[$i]->addAttribute("date", @date("YmdHi", $filemtime));
108 108
                     if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109
-                        if (file_exists($_thumbServerPath . $filename)) {
109
+                        if (file_exists($_thumbServerPath.$filename)) {
110 110
                             $oFileNode[$i]->addAttribute("thumb", $filename);
111 111
                         }
112 112
                         elseif ($_showThumbs) {
113
-                            $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
113
+                            $oFileNode[$i]->addAttribute("thumb", "?".$filename);
114 114
                         }
115 115
                     }
116
-                    $size = filesize($_sServerDir . $file);
117
-                    if ($size && $size<1024) {
116
+                    $size = filesize($_sServerDir.$file);
117
+                    if ($size && $size < 1024) {
118 118
                         $size = 1;
119 119
                     }
120 120
                     else {
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -108,16 +110,14 @@  discard block
 block discarded – undo
108 110
                     if (!empty($_thumbServerPath) && preg_match(CKFINDER_REGEX_IMAGES_EXT, $filename)) {
109 111
                         if (file_exists($_thumbServerPath . $filename)) {
110 112
                             $oFileNode[$i]->addAttribute("thumb", $filename);
111
-                        }
112
-                        elseif ($_showThumbs) {
113
+                        } elseif ($_showThumbs) {
113 114
                             $oFileNode[$i]->addAttribute("thumb", "?" . $filename);
114 115
                         }
115 116
                     }
116 117
                     $size = filesize($_sServerDir . $file);
117 118
                     if ($size && $size<1024) {
118 119
                         $size = 1;
119
-                    }
120
-                    else {
120
+                    } else {
121 121
                         $size = (int)round($size / 1024);
122 122
                     }
123 123
                     $oFileNode[$i]->addAttribute("size", $size);
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php5/Utils/Security.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -26,50 +26,50 @@
 block discarded – undo
26 26
 class CKFinder_Connector_Utils_Security
27 27
 {
28 28
 
29
-    /**
30
-     * Strip quotes from global arrays
31
-     * @access public
32
-     */
33
-    public function getRidOfMagicQuotes()
34
-    {
35
-        if (CKFINDER_CONNECTOR_PHP_MODE<6 && get_magic_quotes_gpc()) {
36
-            if (!empty($_GET)) {
37
-                $this->stripQuotes($_GET);
38
-            }
39
-            if (!empty($_POST)) {
40
-                $this->stripQuotes($_POST);
41
-            }
42
-            if (!empty($_COOKIE)) {
43
-                $this->stripQuotes($_COOKIE);
44
-            }
45
-            if (!empty($_FILES)) {
46
-                while (list($k,$v) = each($_FILES)) {
47
-                    if (isset($_FILES[$k]['name'])) {
48
-                        $this->stripQuotes($_FILES[$k]['name']);
49
-                    }
50
-                }
51
-            }
52
-        }
53
-    }
29
+	/**
30
+	 * Strip quotes from global arrays
31
+	 * @access public
32
+	 */
33
+	public function getRidOfMagicQuotes()
34
+	{
35
+		if (CKFINDER_CONNECTOR_PHP_MODE<6 && get_magic_quotes_gpc()) {
36
+			if (!empty($_GET)) {
37
+				$this->stripQuotes($_GET);
38
+			}
39
+			if (!empty($_POST)) {
40
+				$this->stripQuotes($_POST);
41
+			}
42
+			if (!empty($_COOKIE)) {
43
+				$this->stripQuotes($_COOKIE);
44
+			}
45
+			if (!empty($_FILES)) {
46
+				while (list($k,$v) = each($_FILES)) {
47
+					if (isset($_FILES[$k]['name'])) {
48
+						$this->stripQuotes($_FILES[$k]['name']);
49
+					}
50
+				}
51
+			}
52
+		}
53
+	}
54 54
 
55
-    /**
56
-     * Strip quotes from variable
57
-     *
58
-     * @access public
59
-     * @param mixed $var
60
-     * @param int $depth current depth
61
-     * @param int $howDeep maximum depth
62
-     */
63
-    public function stripQuotes(&$var, $depth=0, $howDeep=5)
64
-    {
65
-        if (is_array($var)) {
66
-            if ($depth++<$howDeep) {
67
-                while (list($k,$v) = each($var)) {
68
-                    $this->stripQuotes($var[$k], $depth, $howDeep);
69
-                }
70
-            }
71
-        } else {
72
-            $var = stripslashes($var);
73
-        }
74
-    }
55
+	/**
56
+	 * Strip quotes from variable
57
+	 *
58
+	 * @access public
59
+	 * @param mixed $var
60
+	 * @param int $depth current depth
61
+	 * @param int $howDeep maximum depth
62
+	 */
63
+	public function stripQuotes(&$var, $depth=0, $howDeep=5)
64
+	{
65
+		if (is_array($var)) {
66
+			if ($depth++<$howDeep) {
67
+				while (list($k,$v) = each($var)) {
68
+					$this->stripQuotes($var[$k], $depth, $howDeep);
69
+				}
70
+			}
71
+		} else {
72
+			$var = stripslashes($var);
73
+		}
74
+	}
75 75
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function getRidOfMagicQuotes()
34 34
     {
35
-        if (CKFINDER_CONNECTOR_PHP_MODE<6 && get_magic_quotes_gpc()) {
35
+        if (CKFINDER_CONNECTOR_PHP_MODE < 6 && get_magic_quotes_gpc()) {
36 36
             if (!empty($_GET)) {
37 37
                 $this->stripQuotes($_GET);
38 38
             }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 $this->stripQuotes($_COOKIE);
44 44
             }
45 45
             if (!empty($_FILES)) {
46
-                while (list($k,$v) = each($_FILES)) {
46
+                while (list($k, $v) = each($_FILES)) {
47 47
                     if (isset($_FILES[$k]['name'])) {
48 48
                         $this->stripQuotes($_FILES[$k]['name']);
49 49
                     }
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
      * @param int $depth current depth
61 61
      * @param int $howDeep maximum depth
62 62
      */
63
-    public function stripQuotes(&$var, $depth=0, $howDeep=5)
63
+    public function stripQuotes(&$var, $depth = 0, $howDeep = 5)
64 64
     {
65 65
         if (is_array($var)) {
66
-            if ($depth++<$howDeep) {
67
-                while (list($k,$v) = each($var)) {
66
+            if ($depth++ < $howDeep) {
67
+                while (list($k, $v) = each($var)) {
68 68
                     $this->stripQuotes($var[$k], $depth, $howDeep);
69 69
                 }
70 70
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/constants.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,19 +55,19 @@
 block discarded – undo
55 55
 define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH',"./../../../config.php");
56 56
 
57 57
 if (version_compare(phpversion(), '6', '>=')) {
58
-    define('CKFINDER_CONNECTOR_PHP_MODE', 6);
58
+	define('CKFINDER_CONNECTOR_PHP_MODE', 6);
59 59
 }
60 60
 else if (version_compare(phpversion(), '5', '>=')) {
61
-    define('CKFINDER_CONNECTOR_PHP_MODE', 5);
61
+	define('CKFINDER_CONNECTOR_PHP_MODE', 5);
62 62
 }
63 63
 else {
64
-    define('CKFINDER_CONNECTOR_PHP_MODE', 4);
64
+	define('CKFINDER_CONNECTOR_PHP_MODE', 4);
65 65
 }
66 66
 
67 67
 if (CKFINDER_CONNECTOR_PHP_MODE == 4) {
68
-    define('CKFINDER_CONNECTOR_LIB_DIR', "./php4");
68
+	define('CKFINDER_CONNECTOR_LIB_DIR', "./php4");
69 69
 } else {
70
-    define('CKFINDER_CONNECTOR_LIB_DIR', "./php5");
70
+	define('CKFINDER_CONNECTOR_LIB_DIR', "./php5");
71 71
 }
72 72
 
73 73
 define('CKFINDER_CHARS', '123456789ABCDEFGHJKLMNPQRSTUVWXYZ');
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,36 +23,36 @@
 block discarded – undo
23 23
  * No errors
24 24
  */
25 25
 define('IN_CKFINDER', true);
26
-define('CKFINDER_CONNECTOR_ERROR_NONE',0);
27
-define('CKFINDER_CONNECTOR_ERROR_CUSTOM_ERROR',1);
28
-define('CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND',10);
29
-define('CKFINDER_CONNECTOR_ERROR_TYPE_NOT_SPECIFIED',11);
30
-define('CKFINDER_CONNECTOR_ERROR_INVALID_TYPE',12);
31
-define('CKFINDER_CONNECTOR_ERROR_INVALID_NAME',102);
32
-define('CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED',103);
33
-define('CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED',104);
34
-define('CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION',105);
35
-define('CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST',109);
36
-define('CKFINDER_CONNECTOR_ERROR_UNKNOWN',110);
37
-define('CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST',115);
38
-define('CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND',116);
39
-define('CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND',117);
40
-define('CKFINDER_CONNECTOR_ERROR_SOURCE_AND_TARGET_PATH_EQUAL',118);
41
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_FILE_RENAMED',201);
42
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID',202);
43
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_TOO_BIG',203);
44
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_CORRUPT',204);
45
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_NO_TMP_DIR',205);
46
-define('CKFINDER_CONNECTOR_ERROR_UPLOADED_WRONG_HTML_FILE',206);
47
-define('CKFINDER_CONNECTOR_ERROR_MOVE_FAILED',300);
48
-define('CKFINDER_CONNECTOR_ERROR_COPY_FAILED',301);
26
+define('CKFINDER_CONNECTOR_ERROR_NONE', 0);
27
+define('CKFINDER_CONNECTOR_ERROR_CUSTOM_ERROR', 1);
28
+define('CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND', 10);
29
+define('CKFINDER_CONNECTOR_ERROR_TYPE_NOT_SPECIFIED', 11);
30
+define('CKFINDER_CONNECTOR_ERROR_INVALID_TYPE', 12);
31
+define('CKFINDER_CONNECTOR_ERROR_INVALID_NAME', 102);
32
+define('CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED', 103);
33
+define('CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED', 104);
34
+define('CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION', 105);
35
+define('CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST', 109);
36
+define('CKFINDER_CONNECTOR_ERROR_UNKNOWN', 110);
37
+define('CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST', 115);
38
+define('CKFINDER_CONNECTOR_ERROR_FOLDER_NOT_FOUND', 116);
39
+define('CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND', 117);
40
+define('CKFINDER_CONNECTOR_ERROR_SOURCE_AND_TARGET_PATH_EQUAL', 118);
41
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_FILE_RENAMED', 201);
42
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID', 202);
43
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_TOO_BIG', 203);
44
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_CORRUPT', 204);
45
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_NO_TMP_DIR', 205);
46
+define('CKFINDER_CONNECTOR_ERROR_UPLOADED_WRONG_HTML_FILE', 206);
47
+define('CKFINDER_CONNECTOR_ERROR_MOVE_FAILED', 300);
48
+define('CKFINDER_CONNECTOR_ERROR_COPY_FAILED', 301);
49 49
 define('CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID_NAME_RENAMED', 207);
50
-define('CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED',500);
51
-define('CKFINDER_CONNECTOR_ERROR_THUMBNAILS_DISABLED',501);
50
+define('CKFINDER_CONNECTOR_ERROR_CONNECTOR_DISABLED', 500);
51
+define('CKFINDER_CONNECTOR_ERROR_THUMBNAILS_DISABLED', 501);
52 52
 
53
-define('CKFINDER_CONNECTOR_DEFAULT_USER_FILES_PATH',"/userfiles/");
54
-define('CKFINDER_CONNECTOR_LANG_PATH',"./lang");
55
-define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH',"./../../../config.php");
53
+define('CKFINDER_CONNECTOR_DEFAULT_USER_FILES_PATH', "/userfiles/");
54
+define('CKFINDER_CONNECTOR_LANG_PATH', "./lang");
55
+define('CKFINDER_CONNECTOR_CONFIG_FILE_PATH', "./../../../config.php");
56 56
 
57 57
 if (version_compare(phpversion(), '6', '>=')) {
58 58
     define('CKFINDER_CONNECTOR_PHP_MODE', 6);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,11 +56,9 @@
 block discarded – undo
56 56
 
57 57
 if (version_compare(phpversion(), '6', '>=')) {
58 58
     define('CKFINDER_CONNECTOR_PHP_MODE', 6);
59
-}
60
-else if (version_compare(phpversion(), '5', '>=')) {
59
+} else if (version_compare(phpversion(), '5', '>=')) {
61 60
     define('CKFINDER_CONNECTOR_PHP_MODE', 5);
62
-}
63
-else {
61
+} else {
64 62
     define('CKFINDER_CONNECTOR_PHP_MODE', 4);
65 63
 }
66 64
 
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/Core/ImagesConfig.php 3 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -27,80 +27,80 @@
 block discarded – undo
27 27
  */
28 28
 class CKFinder_Connector_Core_ImagesConfig
29 29
 {
30
-    /**
31
-     * Max width for images, 0 to disable resizing
32
-     *
33
-     * @var int
34
-     * @access private
35
-     */
36
-    var $_maxWidth = 0;
37
-    /**
38
-     * Max height for images, 0 to disable resizing
39
-     *
40
-     * @var int
41
-     * @access private
42
-     */
43
-    var $_maxHeight = 0;
44
-    /**
45
-     * Quality of thumbnails
46
-     *
47
-     * @var int
48
-     * @access private
49
-     */
50
-    var $_quality = 80;
30
+	/**
31
+	 * Max width for images, 0 to disable resizing
32
+	 *
33
+	 * @var int
34
+	 * @access private
35
+	 */
36
+	var $_maxWidth = 0;
37
+	/**
38
+	 * Max height for images, 0 to disable resizing
39
+	 *
40
+	 * @var int
41
+	 * @access private
42
+	 */
43
+	var $_maxHeight = 0;
44
+	/**
45
+	 * Quality of thumbnails
46
+	 *
47
+	 * @var int
48
+	 * @access private
49
+	 */
50
+	var $_quality = 80;
51 51
 
52
-    function CKFinder_Connector_Core_ImagesConfig($imagesNode)
53
-    {
54
-        if(isset($imagesNode['maxWidth'])) {
55
-            $_maxWidth = intval($imagesNode['maxWidth']);
56
-            if($_maxWidth>=0) {
57
-                $this->_maxWidth = $_maxWidth;
58
-            }
59
-        }
60
-        if(isset($imagesNode['maxHeight'])) {
61
-            $_maxHeight = intval($imagesNode['maxHeight']);
62
-            if($_maxHeight>=0) {
63
-                $this->_maxHeight = $_maxHeight;
64
-            }
65
-        }
66
-        if(isset($imagesNode['quality'])) {
67
-            $_quality = intval($imagesNode['quality']);
68
-            if($_quality>0 && $_quality<=100) {
69
-                $this->_quality = $_quality;
70
-            }
71
-        }
72
-    }
52
+	function CKFinder_Connector_Core_ImagesConfig($imagesNode)
53
+	{
54
+		if(isset($imagesNode['maxWidth'])) {
55
+			$_maxWidth = intval($imagesNode['maxWidth']);
56
+			if($_maxWidth>=0) {
57
+				$this->_maxWidth = $_maxWidth;
58
+			}
59
+		}
60
+		if(isset($imagesNode['maxHeight'])) {
61
+			$_maxHeight = intval($imagesNode['maxHeight']);
62
+			if($_maxHeight>=0) {
63
+				$this->_maxHeight = $_maxHeight;
64
+			}
65
+		}
66
+		if(isset($imagesNode['quality'])) {
67
+			$_quality = intval($imagesNode['quality']);
68
+			if($_quality>0 && $_quality<=100) {
69
+				$this->_quality = $_quality;
70
+			}
71
+		}
72
+	}
73 73
 
74
-    /**
75
-     * Get maximum width of a thumbnail
76
-     *
77
-     * @access public
78
-     * @return int
79
-     */
80
-    function getMaxWidth()
81
-    {
82
-    	return $this->_maxWidth;
83
-    }
74
+	/**
75
+	 * Get maximum width of a thumbnail
76
+	 *
77
+	 * @access public
78
+	 * @return int
79
+	 */
80
+	function getMaxWidth()
81
+	{
82
+		return $this->_maxWidth;
83
+	}
84 84
 
85
-    /**
86
-     * Get maximum height of a thumbnail
87
-     *
88
-     * @access public
89
-     * @return int
90
-     */
91
-    function getMaxHeight()
92
-    {
93
-    	return $this->_maxHeight;
94
-    }
85
+	/**
86
+	 * Get maximum height of a thumbnail
87
+	 *
88
+	 * @access public
89
+	 * @return int
90
+	 */
91
+	function getMaxHeight()
92
+	{
93
+		return $this->_maxHeight;
94
+	}
95 95
 
96
-    /**
97
-     * Get quality of a thumbnail (1-100)
98
-     *
99
-     * @access public
100
-     * @return int
101
-     */
102
-    function getQuality()
103
-    {
104
-    	return $this->_quality;
105
-    }
96
+	/**
97
+	 * Get quality of a thumbnail (1-100)
98
+	 *
99
+	 * @access public
100
+	 * @return int
101
+	 */
102
+	function getQuality()
103
+	{
104
+		return $this->_quality;
105
+	}
106 106
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,21 +51,21 @@
 block discarded – undo
51 51
 
52 52
     function CKFinder_Connector_Core_ImagesConfig($imagesNode)
53 53
     {
54
-        if(isset($imagesNode['maxWidth'])) {
54
+        if (isset($imagesNode['maxWidth'])) {
55 55
             $_maxWidth = intval($imagesNode['maxWidth']);
56
-            if($_maxWidth>=0) {
56
+            if ($_maxWidth >= 0) {
57 57
                 $this->_maxWidth = $_maxWidth;
58 58
             }
59 59
         }
60
-        if(isset($imagesNode['maxHeight'])) {
60
+        if (isset($imagesNode['maxHeight'])) {
61 61
             $_maxHeight = intval($imagesNode['maxHeight']);
62
-            if($_maxHeight>=0) {
62
+            if ($_maxHeight >= 0) {
63 63
                 $this->_maxHeight = $_maxHeight;
64 64
             }
65 65
         }
66
-        if(isset($imagesNode['quality'])) {
66
+        if (isset($imagesNode['quality'])) {
67 67
             $_quality = intval($imagesNode['quality']);
68
-            if($_quality>0 && $_quality<=100) {
68
+            if ($_quality > 0 && $_quality <= 100) {
69 69
                 $this->_quality = $_quality;
70 70
             }
71 71
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/Core/FolderHandler.php 3 patches
Indentation   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -30,239 +30,239 @@
 block discarded – undo
30 30
  */
31 31
 class CKFinder_Connector_Core_FolderHandler
32 32
 {
33
-    /**
34
-     * CKFinder_Connector_Core_ResourceTypeConfig object
35
-     *
36
-     * @var CKFinder_Connector_Core_ResourceTypeConfig
37
-     * @access private
38
-     */
39
-    var $_resourceTypeConfig;
40
-    /**
41
-     * ResourceType name
42
-     *
43
-     * @var string
44
-     * @access private
45
-     */
46
-    var $_resourceTypeName = "";
47
-    /**
48
-     * Client path
49
-     *
50
-     * @var string
51
-     * @access private
52
-     */
53
-    var $_clientPath = "/";
54
-    /**
55
-     * Url
56
-     *
57
-     * @var string
58
-     * @access private
59
-     */
60
-    var $_url;
61
-    /**
62
-     * Server path
63
-     *
64
-     * @var string
65
-     * @access private
66
-     */
67
-    var $_serverPath;
68
-    /**
69
-     * Thumbnails server path
70
-     *
71
-     * @var string
72
-     * @access private
73
-     */
74
-    var $_thumbsServerPath;
75
-    /**
76
-     * ACL mask
77
-     *
78
-     * @var int
79
-     * @access private
80
-     */
81
-    var $_aclMask;
82
-    /**
83
-     * Folder info
84
-     *
85
-     * @var mixed
86
-     * @access private
87
-     */
88
-    var $_folderInfo;
89
-    /**
90
-     * Thumbnails folder info
91
-     *
92
-     * @var mized
93
-     * @access private
94
-     */
95
-    var $_thumbsFolderInfo;
33
+	/**
34
+	 * CKFinder_Connector_Core_ResourceTypeConfig object
35
+	 *
36
+	 * @var CKFinder_Connector_Core_ResourceTypeConfig
37
+	 * @access private
38
+	 */
39
+	var $_resourceTypeConfig;
40
+	/**
41
+	 * ResourceType name
42
+	 *
43
+	 * @var string
44
+	 * @access private
45
+	 */
46
+	var $_resourceTypeName = "";
47
+	/**
48
+	 * Client path
49
+	 *
50
+	 * @var string
51
+	 * @access private
52
+	 */
53
+	var $_clientPath = "/";
54
+	/**
55
+	 * Url
56
+	 *
57
+	 * @var string
58
+	 * @access private
59
+	 */
60
+	var $_url;
61
+	/**
62
+	 * Server path
63
+	 *
64
+	 * @var string
65
+	 * @access private
66
+	 */
67
+	var $_serverPath;
68
+	/**
69
+	 * Thumbnails server path
70
+	 *
71
+	 * @var string
72
+	 * @access private
73
+	 */
74
+	var $_thumbsServerPath;
75
+	/**
76
+	 * ACL mask
77
+	 *
78
+	 * @var int
79
+	 * @access private
80
+	 */
81
+	var $_aclMask;
82
+	/**
83
+	 * Folder info
84
+	 *
85
+	 * @var mixed
86
+	 * @access private
87
+	 */
88
+	var $_folderInfo;
89
+	/**
90
+	 * Thumbnails folder info
91
+	 *
92
+	 * @var mized
93
+	 * @access private
94
+	 */
95
+	var $_thumbsFolderInfo;
96 96
 
97
-    function CKFinder_Connector_Core_FolderHandler()
98
-    {
99
-        if (isset($_GET["type"])) {
100
-            $this->_resourceTypeName = (string)$_GET["type"];
101
-        }
97
+	function CKFinder_Connector_Core_FolderHandler()
98
+	{
99
+		if (isset($_GET["type"])) {
100
+			$this->_resourceTypeName = (string)$_GET["type"];
101
+		}
102 102
 
103
-        if (isset($_GET["currentFolder"])) {
104
-            $this->_clientPath = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding((string)$_GET["currentFolder"]);
105
-        }
103
+		if (isset($_GET["currentFolder"])) {
104
+			$this->_clientPath = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding((string)$_GET["currentFolder"]);
105
+		}
106 106
 
107
-        if (!strlen($this->_clientPath)) {
108
-            $this->_clientPath = "/";
109
-        }
110
-        else {
111
-            if (substr($this->_clientPath, -1, 1) != "/") {
112
-                $this->_clientPath .= "/";
113
-            }
114
-            if (substr($this->_clientPath, 0, 1) != "/") {
115
-                $this->_clientPath = "/" . $this->_clientPath;
116
-            }
117
-        }
107
+		if (!strlen($this->_clientPath)) {
108
+			$this->_clientPath = "/";
109
+		}
110
+		else {
111
+			if (substr($this->_clientPath, -1, 1) != "/") {
112
+				$this->_clientPath .= "/";
113
+			}
114
+			if (substr($this->_clientPath, 0, 1) != "/") {
115
+				$this->_clientPath = "/" . $this->_clientPath;
116
+			}
117
+		}
118 118
 
119
-        $this->_aclMask = -1;
120
-    }
119
+		$this->_aclMask = -1;
120
+	}
121 121
 
122
-    /**
123
-     * Get resource type config
124
-     *
125
-     * @return CKFinder_Connector_Core_ResourceTypeConfig
126
-     * @access public
127
-     */
128
-    function &getResourceTypeConfig()
129
-    {
130
-        if (!isset($this->_resourceTypeConfig)) {
131
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132
-            $this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133
-        }
122
+	/**
123
+	 * Get resource type config
124
+	 *
125
+	 * @return CKFinder_Connector_Core_ResourceTypeConfig
126
+	 * @access public
127
+	 */
128
+	function &getResourceTypeConfig()
129
+	{
130
+		if (!isset($this->_resourceTypeConfig)) {
131
+			$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132
+			$this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133
+		}
134 134
 
135
-        if (is_null($this->_resourceTypeConfig)) {
136
-            $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
-            $oErrorHandler =& $connector->getErrorHandler();
138
-            $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139
-        }
135
+		if (is_null($this->_resourceTypeConfig)) {
136
+			$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
+			$oErrorHandler =& $connector->getErrorHandler();
138
+			$oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139
+		}
140 140
 
141
-        return $this->_resourceTypeConfig;
142
-    }
141
+		return $this->_resourceTypeConfig;
142
+	}
143 143
 
144
-    /**
145
-     * Get resource type name
146
-     *
147
-     * @return string
148
-     * @access public
149
-     */
150
-    function getResourceTypeName()
151
-    {
152
-        return $this->_resourceTypeName;
153
-    }
144
+	/**
145
+	 * Get resource type name
146
+	 *
147
+	 * @return string
148
+	 * @access public
149
+	 */
150
+	function getResourceTypeName()
151
+	{
152
+		return $this->_resourceTypeName;
153
+	}
154 154
 
155
-    /**
156
-     * Get Client path
157
-     *
158
-     * @return string
159
-     * @access public
160
-     */
161
-    function getClientPath()
162
-    {
163
-        return $this->_clientPath;
164
-    }
155
+	/**
156
+	 * Get Client path
157
+	 *
158
+	 * @return string
159
+	 * @access public
160
+	 */
161
+	function getClientPath()
162
+	{
163
+		return $this->_clientPath;
164
+	}
165 165
 
166
-    /**
167
-     * Get Url
168
-     *
169
-     * @return string
170
-     * @access public
171
-     */
172
-    function getUrl()
173
-    {
174
-        if (is_null($this->_url)) {
175
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
176
-            if (is_null($this->_resourceTypeConfig)) {
177
-                $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
-                $oErrorHandler =& $connector->getErrorHandler();
179
-                $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180
-                $this->_url = "";
181
-            }
182
-            else {
183
-                $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184
-            }
185
-        }
166
+	/**
167
+	 * Get Url
168
+	 *
169
+	 * @return string
170
+	 * @access public
171
+	 */
172
+	function getUrl()
173
+	{
174
+		if (is_null($this->_url)) {
175
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
176
+			if (is_null($this->_resourceTypeConfig)) {
177
+				$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
+				$oErrorHandler =& $connector->getErrorHandler();
179
+				$oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180
+				$this->_url = "";
181
+			}
182
+			else {
183
+				$this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184
+			}
185
+		}
186 186
 
187
-        return $this->_url;
188
-    }
187
+		return $this->_url;
188
+	}
189 189
 
190
-    /**
191
-     * Get server path
192
-     *
193
-     * @return string
194
-     * @access public
195
-     */
196
-    function getServerPath()
197
-    {
198
-        if (is_null($this->_serverPath)) {
199
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
200
-            $this->_serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_resourceTypeConfig->getDirectory(), ltrim($this->_clientPath, "/"));
201
-        }
190
+	/**
191
+	 * Get server path
192
+	 *
193
+	 * @return string
194
+	 * @access public
195
+	 */
196
+	function getServerPath()
197
+	{
198
+		if (is_null($this->_serverPath)) {
199
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
200
+			$this->_serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_resourceTypeConfig->getDirectory(), ltrim($this->_clientPath, "/"));
201
+		}
202 202
 
203
-        return $this->_serverPath;
204
-    }
203
+		return $this->_serverPath;
204
+	}
205 205
 
206
-    /**
207
-     * Get server path to thumbnails directory
208
-     *
209
-     * @access public
210
-     * @return string
211
-     */
212
-    function getThumbsServerPath()
213
-    {
214
-        if (is_null($this->_thumbsServerPath)) {
215
-            $this->_resourceTypeConfig = $this->getResourceTypeConfig();
206
+	/**
207
+	 * Get server path to thumbnails directory
208
+	 *
209
+	 * @access public
210
+	 * @return string
211
+	 */
212
+	function getThumbsServerPath()
213
+	{
214
+		if (is_null($this->_thumbsServerPath)) {
215
+			$this->_resourceTypeConfig = $this->getResourceTypeConfig();
216 216
 
217
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218
-            $_thumbnailsConfig = $_config->getThumbnailsConfig();
217
+			$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218
+			$_thumbnailsConfig = $_config->getThumbnailsConfig();
219 219
 
220
-            // Get the resource type directory.
221
-            $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_thumbnailsConfig->getDirectory(), $this->_resourceTypeConfig->getName());
220
+			// Get the resource type directory.
221
+			$this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_thumbnailsConfig->getDirectory(), $this->_resourceTypeConfig->getName());
222 222
 
223
-            // Return the resource type directory combined with the required path.
224
-            $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
223
+			// Return the resource type directory combined with the required path.
224
+			$this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
225 225
 
226
-            if (!is_dir($this->_thumbsServerPath)) {
227
-                if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
226
+			if (!is_dir($this->_thumbsServerPath)) {
227
+				if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
228 228
 
229
-                }
230
-            }
231
-        }
229
+				}
230
+			}
231
+		}
232 232
 
233
-        return $this->_thumbsServerPath;
234
-    }
233
+		return $this->_thumbsServerPath;
234
+	}
235 235
 
236
-    /**
237
-     * Get ACL Mask
238
-     *
239
-     * @return int
240
-     * @access public
241
-     */
242
-    function getAclMask()
243
-    {
244
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245
-        $_aclConfig = $_config->getAccessControlConfig();
236
+	/**
237
+	 * Get ACL Mask
238
+	 *
239
+	 * @return int
240
+	 * @access public
241
+	 */
242
+	function getAclMask()
243
+	{
244
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245
+		$_aclConfig = $_config->getAccessControlConfig();
246 246
 
247
-        if ($this->_aclMask == -1) {
248
-            $this->_aclMask = $_aclConfig->getComputedMask($this->_resourceTypeName, $this->_clientPath);
249
-        }
247
+		if ($this->_aclMask == -1) {
248
+			$this->_aclMask = $_aclConfig->getComputedMask($this->_resourceTypeName, $this->_clientPath);
249
+		}
250 250
 
251
-        return $this->_aclMask;
252
-    }
251
+		return $this->_aclMask;
252
+	}
253 253
 
254
-    /**
255
-     * Check ACL
256
-     *
257
-     * @access public
258
-     * @param int $aclToCkeck
259
-     * @return boolean
260
-     */
261
-    function checkAcl($aclToCkeck)
262
-    {
263
-        $aclToCkeck = intval($aclToCkeck);
254
+	/**
255
+	 * Check ACL
256
+	 *
257
+	 * @access public
258
+	 * @param int $aclToCkeck
259
+	 * @return boolean
260
+	 */
261
+	function checkAcl($aclToCkeck)
262
+	{
263
+		$aclToCkeck = intval($aclToCkeck);
264 264
 
265
-        $maska = $this->getAclMask();
266
-        return (($maska & $aclToCkeck) == $aclToCkeck);
267
-    }
265
+		$maska = $this->getAclMask();
266
+		return (($maska & $aclToCkeck) == $aclToCkeck);
267
+	}
268 268
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Include file system utils class
23 23
  */
24
-require_once CKFINDER_CONNECTOR_LIB_DIR . "/Utils/FileSystem.php";
24
+require_once CKFINDER_CONNECTOR_LIB_DIR."/Utils/FileSystem.php";
25 25
 
26 26
 /**
27 27
  * @package CKFinder
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 $this->_clientPath .= "/";
113 113
             }
114 114
             if (substr($this->_clientPath, 0, 1) != "/") {
115
-                $this->_clientPath = "/" . $this->_clientPath;
115
+                $this->_clientPath = "/".$this->_clientPath;
116 116
             }
117 117
         }
118 118
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
     function &getResourceTypeConfig()
129 129
     {
130 130
         if (!isset($this->_resourceTypeConfig)) {
131
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
131
+            $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
132 132
             $this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
133 133
         }
134 134
 
135 135
         if (is_null($this->_resourceTypeConfig)) {
136
-            $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
-            $oErrorHandler =& $connector->getErrorHandler();
136
+            $connector = & CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
137
+            $oErrorHandler = & $connector->getErrorHandler();
138 138
             $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
139 139
         }
140 140
 
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
         if (is_null($this->_url)) {
175 175
             $this->_resourceTypeConfig = $this->getResourceTypeConfig();
176 176
             if (is_null($this->_resourceTypeConfig)) {
177
-                $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
-                $oErrorHandler =& $connector->getErrorHandler();
177
+                $connector = & CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
178
+                $oErrorHandler = & $connector->getErrorHandler();
179 179
                 $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180 180
                 $this->_url = "";
181 181
             }
182 182
             else {
183
-                $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
183
+                $this->_url = $this->_resourceTypeConfig->getUrl().ltrim($this->getClientPath(), "/");
184 184
             }
185 185
         }
186 186
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         if (is_null($this->_thumbsServerPath)) {
215 215
             $this->_resourceTypeConfig = $this->getResourceTypeConfig();
216 216
 
217
-            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
217
+            $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
218 218
             $_thumbnailsConfig = $_config->getThumbnailsConfig();
219 219
 
220 220
             // Get the resource type directory.
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $this->_thumbsServerPath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_thumbsServerPath, ltrim($this->_clientPath, '/'));
225 225
 
226 226
             if (!is_dir($this->_thumbsServerPath)) {
227
-                if(!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
227
+                if (!CKFinder_Connector_Utils_FileSystem::createDirectoryRecursively($this->_thumbsServerPath)) {
228 228
 
229 229
                 }
230 230
             }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     function getAclMask()
243 243
     {
244
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
244
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
245 245
         $_aclConfig = $_config->getAccessControlConfig();
246 246
 
247 247
         if ($this->_aclMask == -1) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -106,8 +108,7 @@  discard block
 block discarded – undo
106 108
 
107 109
         if (!strlen($this->_clientPath)) {
108 110
             $this->_clientPath = "/";
109
-        }
110
-        else {
111
+        } else {
111 112
             if (substr($this->_clientPath, -1, 1) != "/") {
112 113
                 $this->_clientPath .= "/";
113 114
             }
@@ -178,8 +179,7 @@  discard block
 block discarded – undo
178 179
                 $oErrorHandler =& $connector->getErrorHandler();
179 180
                 $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
180 181
                 $this->_url = "";
181
-            }
182
-            else {
182
+            } else {
183 183
                 $this->_url = $this->_resourceTypeConfig->getUrl() . ltrim($this->getClientPath(), "/");
184 184
             }
185 185
         }
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/Core/ThumbnailsConfig.php 3 patches
Indentation   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -28,193 +28,193 @@
 block discarded – undo
28 28
 class CKFinder_Connector_Core_ThumbnailsConfig
29 29
 {
30 30
 
31
-    /**
32
-     * Url to thumbnails directory
33
-     *
34
-     * @var string
35
-     * @access private
36
-     */
37
-    var  $_url = "";
38
-    /**
31
+	/**
32
+	 * Url to thumbnails directory
33
+	 *
34
+	 * @var string
35
+	 * @access private
36
+	 */
37
+	var  $_url = "";
38
+	/**
39 39
 	 * Directory where thumbnails are stored
40 40
 	 *
41 41
 	 * @var string
42 42
 	 * @access private
43 43
 	 */
44
-    var $_directory = "";
45
-    /**
44
+	var $_directory = "";
45
+	/**
46 46
 	 * Are thumbnails enabled
47 47
 	 *
48 48
 	 * @var boolean
49 49
 	 * @access private
50 50
 	 */
51
-    var $_isEnabled = false;
52
-    /**
51
+	var $_isEnabled = false;
52
+	/**
53 53
 	 * Direct access to thumbnails?
54 54
 	 *
55 55
 	 * @var boolean
56 56
 	 * @access private
57 57
 	 */
58
-    var $_directAccess = false;
59
-    /**
60
-     * Max width for thumbnails
61
-     *
62
-     * @var int
63
-     * @access private
64
-     */
65
-    var $_maxWidth = 100;
66
-    /**
67
-     * Max height for thumbnails
68
-     *
69
-     * @var int
70
-     * @access private
71
-     */
72
-    var $_maxHeight = 100;
73
-    /**
74
-     * Quality of thumbnails
75
-     *
76
-     * @var int
77
-     * @access private
78
-     */
79
-    var $_quality = 100;
80
-    /**
81
-     * Are thumbnails of bitmap files enabled?
82
-     *
83
-     * @var boolean
84
-     * @access private
85
-     */
86
-    var $_bmpSupported = false;
58
+	var $_directAccess = false;
59
+	/**
60
+	 * Max width for thumbnails
61
+	 *
62
+	 * @var int
63
+	 * @access private
64
+	 */
65
+	var $_maxWidth = 100;
66
+	/**
67
+	 * Max height for thumbnails
68
+	 *
69
+	 * @var int
70
+	 * @access private
71
+	 */
72
+	var $_maxHeight = 100;
73
+	/**
74
+	 * Quality of thumbnails
75
+	 *
76
+	 * @var int
77
+	 * @access private
78
+	 */
79
+	var $_quality = 100;
80
+	/**
81
+	 * Are thumbnails of bitmap files enabled?
82
+	 *
83
+	 * @var boolean
84
+	 * @access private
85
+	 */
86
+	var $_bmpSupported = false;
87 87
 
88
-    function CKFinder_Connector_Core_ThumbnailsConfig($thumbnailsNode)
89
-    {
90
-        if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91
-            $this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92
-        }
93
-        if( isset($thumbnailsNode['directAccess'])) {
94
-            $this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95
-        }
96
-        if( isset($thumbnailsNode['bmpSupported'])) {
97
-            $this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98
-        }
99
-        if(isset($thumbnailsNode['maxWidth'])) {
100
-            $_maxWidth = intval($thumbnailsNode['maxWidth']);
101
-            if($_maxWidth>=0) {
102
-                $this->_maxWidth = $_maxWidth;
103
-            }
104
-        }
105
-        if(isset($thumbnailsNode['maxHeight'])) {
106
-            $_maxHeight = intval($thumbnailsNode['maxHeight']);
107
-            if($_maxHeight>=0) {
108
-                $this->_maxHeight = $_maxHeight;
109
-            }
110
-        }
111
-        if(isset($thumbnailsNode['quality'])) {
112
-            $_quality = intval($thumbnailsNode['quality']);
113
-            if($_quality>0 && $_quality<=100) {
114
-                $this->_quality = $_quality;
115
-            }
116
-        }
88
+	function CKFinder_Connector_Core_ThumbnailsConfig($thumbnailsNode)
89
+	{
90
+		if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91
+			$this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92
+		}
93
+		if( isset($thumbnailsNode['directAccess'])) {
94
+			$this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95
+		}
96
+		if( isset($thumbnailsNode['bmpSupported'])) {
97
+			$this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98
+		}
99
+		if(isset($thumbnailsNode['maxWidth'])) {
100
+			$_maxWidth = intval($thumbnailsNode['maxWidth']);
101
+			if($_maxWidth>=0) {
102
+				$this->_maxWidth = $_maxWidth;
103
+			}
104
+		}
105
+		if(isset($thumbnailsNode['maxHeight'])) {
106
+			$_maxHeight = intval($thumbnailsNode['maxHeight']);
107
+			if($_maxHeight>=0) {
108
+				$this->_maxHeight = $_maxHeight;
109
+			}
110
+		}
111
+		if(isset($thumbnailsNode['quality'])) {
112
+			$_quality = intval($thumbnailsNode['quality']);
113
+			if($_quality>0 && $_quality<=100) {
114
+				$this->_quality = $_quality;
115
+			}
116
+		}
117 117
 
118
-        if(isset($thumbnailsNode['url'])) {
119
-            $this->_url = $thumbnailsNode['url'];
120
-        }
121
-        if (!strlen($this->_url)) {
122
-            $this->_url = "/";
123
-        }
124
-        else if(substr($this->_url,-1,1) != "/") {
125
-            $this->_url .= "/";
126
-        }
118
+		if(isset($thumbnailsNode['url'])) {
119
+			$this->_url = $thumbnailsNode['url'];
120
+		}
121
+		if (!strlen($this->_url)) {
122
+			$this->_url = "/";
123
+		}
124
+		else if(substr($this->_url,-1,1) != "/") {
125
+			$this->_url .= "/";
126
+		}
127 127
 
128
-        if(isset($thumbnailsNode['directory'])) {
129
-            $this->_directory = $thumbnailsNode['directory'];
130
-        }
131
-    }
128
+		if(isset($thumbnailsNode['directory'])) {
129
+			$this->_directory = $thumbnailsNode['directory'];
130
+		}
131
+	}
132 132
 
133
-    /**
134
-     * Get URL
135
-     *
136
-     * @access public
137
-     * @return string
138
-     */
139
-    function getUrl()
140
-    {
141
-        return $this->_url;
142
-    }
133
+	/**
134
+	 * Get URL
135
+	 *
136
+	 * @access public
137
+	 * @return string
138
+	 */
139
+	function getUrl()
140
+	{
141
+		return $this->_url;
142
+	}
143 143
 
144
-    /**
145
-     * Get directory
146
-     *
147
-     * @access public
148
-     * @return string
149
-     */
150
-    function getDirectory()
151
-    {
152
-        return $this->_directory;
153
-    }
144
+	/**
145
+	 * Get directory
146
+	 *
147
+	 * @access public
148
+	 * @return string
149
+	 */
150
+	function getDirectory()
151
+	{
152
+		return $this->_directory;
153
+	}
154 154
 
155
-    /**
156
-     * Get is enabled setting
157
-     *
158
-     * @access public
159
-     * @return boolean
160
-     */
161
-    function getIsEnabled()
162
-    {
163
-        return $this->_isEnabled;
164
-    }
155
+	/**
156
+	 * Get is enabled setting
157
+	 *
158
+	 * @access public
159
+	 * @return boolean
160
+	 */
161
+	function getIsEnabled()
162
+	{
163
+		return $this->_isEnabled;
164
+	}
165 165
 
166
-    /**
167
-     * Get is enabled setting
168
-     *
169
-     * @access public
170
-     * @return boolean
171
-     */
172
-    function getBmpSupported()
173
-    {
174
-        return $this->_bmpSupported;
175
-    }
166
+	/**
167
+	 * Get is enabled setting
168
+	 *
169
+	 * @access public
170
+	 * @return boolean
171
+	 */
172
+	function getBmpSupported()
173
+	{
174
+		return $this->_bmpSupported;
175
+	}
176 176
 
177
-    /**
178
-     * Is direct access to thumbnails allowed?
179
-     *
180
-     * @access public
181
-     * @return boolean
182
-     */
183
-    function getDirectAccess()
184
-    {
185
-        return $this->_directAccess;
186
-    }
177
+	/**
178
+	 * Is direct access to thumbnails allowed?
179
+	 *
180
+	 * @access public
181
+	 * @return boolean
182
+	 */
183
+	function getDirectAccess()
184
+	{
185
+		return $this->_directAccess;
186
+	}
187 187
 
188
-    /**
189
-     * Get maximum width of a thumbnail
190
-     *
191
-     * @access public
192
-     * @return int
193
-     */
194
-    function getMaxWidth()
195
-    {
196
-        return $this->_maxWidth;
197
-    }
188
+	/**
189
+	 * Get maximum width of a thumbnail
190
+	 *
191
+	 * @access public
192
+	 * @return int
193
+	 */
194
+	function getMaxWidth()
195
+	{
196
+		return $this->_maxWidth;
197
+	}
198 198
 
199
-    /**
200
-     * Get maximum height of a thumbnail
201
-     *
202
-     * @access public
203
-     * @return int
204
-     */
205
-    function getMaxHeight()
206
-    {
207
-        return $this->_maxHeight;
208
-    }
199
+	/**
200
+	 * Get maximum height of a thumbnail
201
+	 *
202
+	 * @access public
203
+	 * @return int
204
+	 */
205
+	function getMaxHeight()
206
+	{
207
+		return $this->_maxHeight;
208
+	}
209 209
 
210
-    /**
211
-     * Get quality of a thumbnail (1-100)
212
-     *
213
-     * @access public
214
-     * @return int
215
-     */
216
-    function getQuality()
217
-    {
218
-        return $this->_quality;
219
-    }
210
+	/**
211
+	 * Get quality of a thumbnail (1-100)
212
+	 *
213
+	 * @access public
214
+	 * @return int
215
+	 */
216
+	function getQuality()
217
+	{
218
+		return $this->_quality;
219
+	}
220 220
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -87,45 +87,45 @@
 block discarded – undo
87 87
 
88 88
     function CKFinder_Connector_Core_ThumbnailsConfig($thumbnailsNode)
89 89
     {
90
-        if(extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
90
+        if (extension_loaded('gd') && isset($thumbnailsNode['enabled'])) {
91 91
             $this->_isEnabled = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['enabled']);
92 92
         }
93
-        if( isset($thumbnailsNode['directAccess'])) {
93
+        if (isset($thumbnailsNode['directAccess'])) {
94 94
             $this->_directAccess = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['directAccess']);
95 95
         }
96
-        if( isset($thumbnailsNode['bmpSupported'])) {
96
+        if (isset($thumbnailsNode['bmpSupported'])) {
97 97
             $this->_bmpSupported = CKFinder_Connector_Utils_Misc::booleanValue($thumbnailsNode['bmpSupported']);
98 98
         }
99
-        if(isset($thumbnailsNode['maxWidth'])) {
99
+        if (isset($thumbnailsNode['maxWidth'])) {
100 100
             $_maxWidth = intval($thumbnailsNode['maxWidth']);
101
-            if($_maxWidth>=0) {
101
+            if ($_maxWidth >= 0) {
102 102
                 $this->_maxWidth = $_maxWidth;
103 103
             }
104 104
         }
105
-        if(isset($thumbnailsNode['maxHeight'])) {
105
+        if (isset($thumbnailsNode['maxHeight'])) {
106 106
             $_maxHeight = intval($thumbnailsNode['maxHeight']);
107
-            if($_maxHeight>=0) {
107
+            if ($_maxHeight >= 0) {
108 108
                 $this->_maxHeight = $_maxHeight;
109 109
             }
110 110
         }
111
-        if(isset($thumbnailsNode['quality'])) {
111
+        if (isset($thumbnailsNode['quality'])) {
112 112
             $_quality = intval($thumbnailsNode['quality']);
113
-            if($_quality>0 && $_quality<=100) {
113
+            if ($_quality > 0 && $_quality <= 100) {
114 114
                 $this->_quality = $_quality;
115 115
             }
116 116
         }
117 117
 
118
-        if(isset($thumbnailsNode['url'])) {
118
+        if (isset($thumbnailsNode['url'])) {
119 119
             $this->_url = $thumbnailsNode['url'];
120 120
         }
121 121
         if (!strlen($this->_url)) {
122 122
             $this->_url = "/";
123 123
         }
124
-        else if(substr($this->_url,-1,1) != "/") {
124
+        else if (substr($this->_url, -1, 1) != "/") {
125 125
             $this->_url .= "/";
126 126
         }
127 127
 
128
-        if(isset($thumbnailsNode['directory'])) {
128
+        if (isset($thumbnailsNode['directory'])) {
129 129
             $this->_directory = $thumbnailsNode['directory'];
130 130
         }
131 131
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
 * modifying or distribute this file or part of its contents. The contents of
11 11
 * this file is part of the Source Code of CKFinder.
12 12
 */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -120,8 +122,7 @@  discard block
 block discarded – undo
120 122
         }
121 123
         if (!strlen($this->_url)) {
122 124
             $this->_url = "/";
123
-        }
124
-        else if(substr($this->_url,-1,1) != "/") {
125
+        } else if(substr($this->_url,-1,1) != "/") {
125 126
             $this->_url .= "/";
126 127
         }
127 128
 
Please login to merge, or discard this patch.
libs/ckfinder/core/connector/php/php4/Core/AccessControlConfig.php 3 patches
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -40,186 +40,186 @@
 block discarded – undo
40 40
 class CKFinder_Connector_Core_AccessControlConfig
41 41
 {
42 42
 
43
-    /**
44
-     * array with ACL entries
45
-     *
46
-     * @var array[string]string
47
-     * @access private
48
-     */
49
-    var $_aclEntries = array();
50
-
51
-    function CKFinder_Connector_Core_AccessControlConfig($accessControlNodes)
52
-    {
53
-        foreach ($accessControlNodes as $node) {
54
-            $_folderView = isset($node['folderView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderView']) : false;
55
-            $_folderCreate = isset($node['folderCreate']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderCreate']) : false;
56
-            $_folderRename = isset($node['folderRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderRename']) : false;
57
-            $_folderDelete = isset($node['folderDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderDelete']) : false;
58
-            $_fileView = isset($node['fileView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileView']) : false;
59
-            $_fileUpload = isset($node['fileUpload']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileUpload']) : false;
60
-            $_fileRename = isset($node['fileRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileRename']) : false;
61
-            $_fileDelete = isset($node['fileDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileDelete']) : false;
62
-
63
-            $_role = isset($node['role']) ? $node['role'] : "*";
64
-            $_resourceType = isset($node['resourceType']) ? $node['resourceType'] : "*";
65
-            $_folder = isset($node['folder']) ? $node['folder'] : "/";
66
-
67
-            $this->addACLEntry($_role, $_resourceType, $_folder,
68
-            array(
69
-            $_folderView ? CKFINDER_CONNECTOR_ACL_FOLDER_VIEW : 0,
70
-            $_folderCreate ? CKFINDER_CONNECTOR_ACL_FOLDER_CREATE : 0,
71
-            $_folderRename ? CKFINDER_CONNECTOR_ACL_FOLDER_RENAME : 0,
72
-            $_folderDelete ? CKFINDER_CONNECTOR_ACL_FOLDER_DELETE : 0,
73
-            $_fileView ? CKFINDER_CONNECTOR_ACL_FILE_VIEW : 0,
74
-            $_fileUpload ? CKFINDER_CONNECTOR_ACL_FILE_UPLOAD : 0,
75
-            $_fileRename ? CKFINDER_CONNECTOR_ACL_FILE_RENAME : 0,
76
-            $_fileDelete ? CKFINDER_CONNECTOR_ACL_FILE_DELETE : 0,
77
-            ),
78
-            array(
79
-            $_folderView ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_VIEW,
80
-            $_folderCreate ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_CREATE,
81
-            $_folderRename ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_RENAME,
82
-            $_folderDelete ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_DELETE,
83
-            $_fileView ? 0 : CKFINDER_CONNECTOR_ACL_FILE_VIEW,
84
-            $_fileUpload ? 0 : CKFINDER_CONNECTOR_ACL_FILE_UPLOAD,
85
-            $_fileRename ? 0 : CKFINDER_CONNECTOR_ACL_FILE_RENAME,
86
-            $_fileDelete ? 0 : CKFINDER_CONNECTOR_ACL_FILE_DELETE,
87
-            )
88
-            );
89
-        }
90
-    }
91
-
92
-    /**
93
-     * Add ACL entry
94
-     *
95
-     * @param string $role role
96
-     * @param string $resourceType resource type
97
-     * @param string $folderPath folder path
98
-     * @param int $allowRulesMask allow rules mask
99
-     * @param int $denyRulesMask deny rules mask
100
-     * @access private
101
-     */
102
-    function addACLEntry($role, $resourceType, $folderPath, $allowRulesMask, $denyRulesMask)
103
-    {
104
-
105
-        if (!strlen($folderPath)) {
106
-            $folderPath = '/';
107
-        }
108
-        else {
109
-            if (substr($folderPath,0,1) != '/') {
110
-                $folderPath = '/' . $folderPath;
111
-            }
112
-
113
-            if (substr($folderPath,-1,1) != '/') {
114
-                $folderPath .= '/';
115
-            }
116
-        }
117
-
118
-        $_entryKey = $role . "#@#" . $resourceType;
119
-
120
-        if (array_key_exists($folderPath,$this->_aclEntries)) {
121
-            if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122
-                $_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123
-                foreach ($_rulesMasks[0] as $key => $value) {
124
-                    $allowRulesMask[$key] |= $value;
125
-                }
126
-                foreach ($_rulesMasks[1] as $key => $value) {
127
-                    $denyRulesMask[$key] |= $value;
128
-                }
129
-            }
130
-        }
131
-        else {
132
-            $this->_aclEntries[$folderPath] = array();
133
-        }
134
-
135
-        $this->_aclEntries[$folderPath][$_entryKey] = array($allowRulesMask, $denyRulesMask);
136
-    }
137
-
138
-
139
-    /**
140
-     * Get computed mask
141
-     *
142
-     * @param string $resourceType
143
-     * @param string $folderPath
144
-     * @return int
145
-     */
146
-    function getComputedMask($resourceType, $folderPath)
147
-    {
148
-        $_computedMask = 0;
149
-
150
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151
-        $_roleSessionVar = $_config->getRoleSessionVar();
152
-
153
-        $_userRole = null;
154
-        if (strlen($_roleSessionVar) && isset($_SESSION[$_roleSessionVar])) {
155
-            $_userRole = (string)$_SESSION[$_roleSessionVar];
156
-        }
157
-        if (!is_null($_userRole) && !strlen($_userRole)) {
158
-            $_userRole = null;
159
-        }
160
-
161
-        $folderPath = trim($folderPath, "/");
162
-        $_pathParts = explode("/", $folderPath);
163
-
164
-        $_currentPath = "/";
165
-
166
-        for($i = -1; $i < sizeof($_pathParts); $i++) {
167
-            if ($i >= 0) {
168
-                if (!strlen($_pathParts[$i])) {
169
-                    continue;
170
-                }
171
-
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
-
175
-                $_currentPath .= $_pathParts[$i] . '/';
176
-            }
177
-
178
-            if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
180
-            }
181
-        }
182
-
183
-        return $_computedMask;
184
-    }
185
-
186
-    /**
187
-     * merge current mask with folder entries
188
-     *
189
-     * @access private
190
-     * @param int $currentMask
191
-     * @param string $resourceType
192
-     * @param string $userRole
193
-     * @param string $path
194
-     * @return int
195
-     */
196
-    function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
197
-    {
198
-        $_folderEntries = $this->_aclEntries[$path];
199
-
200
-        $_possibleEntries = array();
201
-
202
-        $_possibleEntries[0] = "*#@#*";
203
-        $_possibleEntries[1] = "*#@#" . $resourceType;
204
-
205
-        if (!is_null($userRole))
206
-        {
207
-            $_possibleEntries[2] = $userRole . "#@#*";
208
-            $_possibleEntries[3] = $userRole . "#@#" . $resourceType;
209
-        }
210
-
211
-        for ($r = 0; $r < sizeof($_possibleEntries); $r++)
212
-        {
213
-            $_possibleKey = $_possibleEntries[$r];
214
-            if (array_key_exists($_possibleKey, $_folderEntries))
215
-            {
216
-                $_rulesMasks = $_folderEntries[$_possibleKey];
217
-
218
-                $currentMask |= array_sum($_rulesMasks[0]);
219
-                $currentMask ^= ($currentMask & array_sum($_rulesMasks[1]));
220
-            }
221
-        }
222
-
223
-        return $currentMask;
224
-    }
43
+	/**
44
+	 * array with ACL entries
45
+	 *
46
+	 * @var array[string]string
47
+	 * @access private
48
+	 */
49
+	var $_aclEntries = array();
50
+
51
+	function CKFinder_Connector_Core_AccessControlConfig($accessControlNodes)
52
+	{
53
+		foreach ($accessControlNodes as $node) {
54
+			$_folderView = isset($node['folderView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderView']) : false;
55
+			$_folderCreate = isset($node['folderCreate']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderCreate']) : false;
56
+			$_folderRename = isset($node['folderRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderRename']) : false;
57
+			$_folderDelete = isset($node['folderDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['folderDelete']) : false;
58
+			$_fileView = isset($node['fileView']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileView']) : false;
59
+			$_fileUpload = isset($node['fileUpload']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileUpload']) : false;
60
+			$_fileRename = isset($node['fileRename']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileRename']) : false;
61
+			$_fileDelete = isset($node['fileDelete']) ? CKFinder_Connector_Utils_Misc::booleanValue($node['fileDelete']) : false;
62
+
63
+			$_role = isset($node['role']) ? $node['role'] : "*";
64
+			$_resourceType = isset($node['resourceType']) ? $node['resourceType'] : "*";
65
+			$_folder = isset($node['folder']) ? $node['folder'] : "/";
66
+
67
+			$this->addACLEntry($_role, $_resourceType, $_folder,
68
+			array(
69
+			$_folderView ? CKFINDER_CONNECTOR_ACL_FOLDER_VIEW : 0,
70
+			$_folderCreate ? CKFINDER_CONNECTOR_ACL_FOLDER_CREATE : 0,
71
+			$_folderRename ? CKFINDER_CONNECTOR_ACL_FOLDER_RENAME : 0,
72
+			$_folderDelete ? CKFINDER_CONNECTOR_ACL_FOLDER_DELETE : 0,
73
+			$_fileView ? CKFINDER_CONNECTOR_ACL_FILE_VIEW : 0,
74
+			$_fileUpload ? CKFINDER_CONNECTOR_ACL_FILE_UPLOAD : 0,
75
+			$_fileRename ? CKFINDER_CONNECTOR_ACL_FILE_RENAME : 0,
76
+			$_fileDelete ? CKFINDER_CONNECTOR_ACL_FILE_DELETE : 0,
77
+			),
78
+			array(
79
+			$_folderView ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_VIEW,
80
+			$_folderCreate ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_CREATE,
81
+			$_folderRename ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_RENAME,
82
+			$_folderDelete ? 0 : CKFINDER_CONNECTOR_ACL_FOLDER_DELETE,
83
+			$_fileView ? 0 : CKFINDER_CONNECTOR_ACL_FILE_VIEW,
84
+			$_fileUpload ? 0 : CKFINDER_CONNECTOR_ACL_FILE_UPLOAD,
85
+			$_fileRename ? 0 : CKFINDER_CONNECTOR_ACL_FILE_RENAME,
86
+			$_fileDelete ? 0 : CKFINDER_CONNECTOR_ACL_FILE_DELETE,
87
+			)
88
+			);
89
+		}
90
+	}
91
+
92
+	/**
93
+	 * Add ACL entry
94
+	 *
95
+	 * @param string $role role
96
+	 * @param string $resourceType resource type
97
+	 * @param string $folderPath folder path
98
+	 * @param int $allowRulesMask allow rules mask
99
+	 * @param int $denyRulesMask deny rules mask
100
+	 * @access private
101
+	 */
102
+	function addACLEntry($role, $resourceType, $folderPath, $allowRulesMask, $denyRulesMask)
103
+	{
104
+
105
+		if (!strlen($folderPath)) {
106
+			$folderPath = '/';
107
+		}
108
+		else {
109
+			if (substr($folderPath,0,1) != '/') {
110
+				$folderPath = '/' . $folderPath;
111
+			}
112
+
113
+			if (substr($folderPath,-1,1) != '/') {
114
+				$folderPath .= '/';
115
+			}
116
+		}
117
+
118
+		$_entryKey = $role . "#@#" . $resourceType;
119
+
120
+		if (array_key_exists($folderPath,$this->_aclEntries)) {
121
+			if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122
+				$_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123
+				foreach ($_rulesMasks[0] as $key => $value) {
124
+					$allowRulesMask[$key] |= $value;
125
+				}
126
+				foreach ($_rulesMasks[1] as $key => $value) {
127
+					$denyRulesMask[$key] |= $value;
128
+				}
129
+			}
130
+		}
131
+		else {
132
+			$this->_aclEntries[$folderPath] = array();
133
+		}
134
+
135
+		$this->_aclEntries[$folderPath][$_entryKey] = array($allowRulesMask, $denyRulesMask);
136
+	}
137
+
138
+
139
+	/**
140
+	 * Get computed mask
141
+	 *
142
+	 * @param string $resourceType
143
+	 * @param string $folderPath
144
+	 * @return int
145
+	 */
146
+	function getComputedMask($resourceType, $folderPath)
147
+	{
148
+		$_computedMask = 0;
149
+
150
+		$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151
+		$_roleSessionVar = $_config->getRoleSessionVar();
152
+
153
+		$_userRole = null;
154
+		if (strlen($_roleSessionVar) && isset($_SESSION[$_roleSessionVar])) {
155
+			$_userRole = (string)$_SESSION[$_roleSessionVar];
156
+		}
157
+		if (!is_null($_userRole) && !strlen($_userRole)) {
158
+			$_userRole = null;
159
+		}
160
+
161
+		$folderPath = trim($folderPath, "/");
162
+		$_pathParts = explode("/", $folderPath);
163
+
164
+		$_currentPath = "/";
165
+
166
+		for($i = -1; $i < sizeof($_pathParts); $i++) {
167
+			if ($i >= 0) {
168
+				if (!strlen($_pathParts[$i])) {
169
+					continue;
170
+				}
171
+
172
+				if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
+				$_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
+
175
+				$_currentPath .= $_pathParts[$i] . '/';
176
+			}
177
+
178
+			if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
+				$_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
180
+			}
181
+		}
182
+
183
+		return $_computedMask;
184
+	}
185
+
186
+	/**
187
+	 * merge current mask with folder entries
188
+	 *
189
+	 * @access private
190
+	 * @param int $currentMask
191
+	 * @param string $resourceType
192
+	 * @param string $userRole
193
+	 * @param string $path
194
+	 * @return int
195
+	 */
196
+	function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
197
+	{
198
+		$_folderEntries = $this->_aclEntries[$path];
199
+
200
+		$_possibleEntries = array();
201
+
202
+		$_possibleEntries[0] = "*#@#*";
203
+		$_possibleEntries[1] = "*#@#" . $resourceType;
204
+
205
+		if (!is_null($userRole))
206
+		{
207
+			$_possibleEntries[2] = $userRole . "#@#*";
208
+			$_possibleEntries[3] = $userRole . "#@#" . $resourceType;
209
+		}
210
+
211
+		for ($r = 0; $r < sizeof($_possibleEntries); $r++)
212
+		{
213
+			$_possibleKey = $_possibleEntries[$r];
214
+			if (array_key_exists($_possibleKey, $_folderEntries))
215
+			{
216
+				$_rulesMasks = $_folderEntries[$_possibleKey];
217
+
218
+				$currentMask |= array_sum($_rulesMasks[0]);
219
+				$currentMask ^= ($currentMask & array_sum($_rulesMasks[1]));
220
+			}
221
+		}
222
+
223
+		return $currentMask;
224
+	}
225 225
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Folder view mask
23 23
  */
24
-define('CKFINDER_CONNECTOR_ACL_FOLDER_VIEW',1);
25
-define('CKFINDER_CONNECTOR_ACL_FOLDER_CREATE',2);
26
-define('CKFINDER_CONNECTOR_ACL_FOLDER_RENAME',4);
27
-define('CKFINDER_CONNECTOR_ACL_FOLDER_DELETE',8);
28
-define('CKFINDER_CONNECTOR_ACL_FILE_VIEW',16);
29
-define('CKFINDER_CONNECTOR_ACL_FILE_UPLOAD',32);
30
-define('CKFINDER_CONNECTOR_ACL_FILE_RENAME',64);
31
-define('CKFINDER_CONNECTOR_ACL_FILE_DELETE',128);
24
+define('CKFINDER_CONNECTOR_ACL_FOLDER_VIEW', 1);
25
+define('CKFINDER_CONNECTOR_ACL_FOLDER_CREATE', 2);
26
+define('CKFINDER_CONNECTOR_ACL_FOLDER_RENAME', 4);
27
+define('CKFINDER_CONNECTOR_ACL_FOLDER_DELETE', 8);
28
+define('CKFINDER_CONNECTOR_ACL_FILE_VIEW', 16);
29
+define('CKFINDER_CONNECTOR_ACL_FILE_UPLOAD', 32);
30
+define('CKFINDER_CONNECTOR_ACL_FILE_RENAME', 64);
31
+define('CKFINDER_CONNECTOR_ACL_FILE_DELETE', 128);
32 32
 
33 33
 /**
34 34
  * This class keeps ACL configuration
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
             $folderPath = '/';
107 107
         }
108 108
         else {
109
-            if (substr($folderPath,0,1) != '/') {
110
-                $folderPath = '/' . $folderPath;
109
+            if (substr($folderPath, 0, 1) != '/') {
110
+                $folderPath = '/'.$folderPath;
111 111
             }
112 112
 
113
-            if (substr($folderPath,-1,1) != '/') {
113
+            if (substr($folderPath, -1, 1) != '/') {
114 114
                 $folderPath .= '/';
115 115
             }
116 116
         }
117 117
 
118
-        $_entryKey = $role . "#@#" . $resourceType;
118
+        $_entryKey = $role."#@#".$resourceType;
119 119
 
120
-        if (array_key_exists($folderPath,$this->_aclEntries)) {
120
+        if (array_key_exists($folderPath, $this->_aclEntries)) {
121 121
             if (array_key_exists($_entryKey, $this->_aclEntries[$folderPath])) {
122 122
                 $_rulesMasks = $this->_aclEntries[$folderPath][$_entryKey];
123 123
                 foreach ($_rulesMasks[0] as $key => $value) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $_computedMask = 0;
149 149
 
150
-        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
150
+        $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config");
151 151
         $_roleSessionVar = $_config->getRoleSessionVar();
152 152
 
153 153
         $_userRole = null;
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
 
164 164
         $_currentPath = "/";
165 165
 
166
-        for($i = -1; $i < sizeof($_pathParts); $i++) {
166
+        for ($i = -1; $i < sizeof($_pathParts); $i++) {
167 167
             if ($i >= 0) {
168 168
                 if (!strlen($_pathParts[$i])) {
169 169
                     continue;
170 170
                 }
171 171
 
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
172
+                if (array_key_exists($_currentPath.'*/', $this->_aclEntries))
173
+                $_computedMask = $this->mergePathComputedMask($_computedMask, $resourceType, $_userRole, $_currentPath.'*/');
174 174
 
175
-                $_currentPath .= $_pathParts[$i] . '/';
175
+                $_currentPath .= $_pathParts[$i].'/';
176 176
             }
177 177
 
178 178
             if (array_key_exists($_currentPath, $this->_aclEntries)) {
179
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath );
179
+                $_computedMask = $this->mergePathComputedMask($_computedMask, $resourceType, $_userRole, $_currentPath);
180 180
             }
181 181
         }
182 182
 
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
      * @param string $path
194 194
      * @return int
195 195
      */
196
-    function mergePathComputedMask( $currentMask, $resourceType, $userRole, $path )
196
+    function mergePathComputedMask($currentMask, $resourceType, $userRole, $path)
197 197
     {
198 198
         $_folderEntries = $this->_aclEntries[$path];
199 199
 
200 200
         $_possibleEntries = array();
201 201
 
202 202
         $_possibleEntries[0] = "*#@#*";
203
-        $_possibleEntries[1] = "*#@#" . $resourceType;
203
+        $_possibleEntries[1] = "*#@#".$resourceType;
204 204
 
205 205
         if (!is_null($userRole))
206 206
         {
207
-            $_possibleEntries[2] = $userRole . "#@#*";
208
-            $_possibleEntries[3] = $userRole . "#@#" . $resourceType;
207
+            $_possibleEntries[2] = $userRole."#@#*";
208
+            $_possibleEntries[3] = $userRole."#@#".$resourceType;
209 209
         }
210 210
 
211 211
         for ($r = 0; $r < sizeof($_possibleEntries); $r++)
Please login to merge, or discard this patch.
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
  * modifying or distribute this file or part of its contents. The contents of
11 11
  * this file is part of the Source Code of CKFinder.
12 12
  */
13
-if (!defined('IN_CKFINDER')) exit;
13
+if (!defined('IN_CKFINDER')) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * @package CKFinder
@@ -104,8 +106,7 @@  discard block
 block discarded – undo
104 106
 
105 107
         if (!strlen($folderPath)) {
106 108
             $folderPath = '/';
107
-        }
108
-        else {
109
+        } else {
109 110
             if (substr($folderPath,0,1) != '/') {
110 111
                 $folderPath = '/' . $folderPath;
111 112
             }
@@ -127,8 +128,7 @@  discard block
 block discarded – undo
127 128
                     $denyRulesMask[$key] |= $value;
128 129
                 }
129 130
             }
130
-        }
131
-        else {
131
+        } else {
132 132
             $this->_aclEntries[$folderPath] = array();
133 133
         }
134 134
 
@@ -169,8 +169,9 @@  discard block
 block discarded – undo
169 169
                     continue;
170 170
                 }
171 171
 
172
-                if (array_key_exists($_currentPath . '*/', $this->_aclEntries))
173
-                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
172
+                if (array_key_exists($_currentPath . '*/', $this->_aclEntries)) {
173
+                                $_computedMask = $this->mergePathComputedMask( $_computedMask, $resourceType, $_userRole, $_currentPath . '*/' );
174
+                }
174 175
 
175 176
                 $_currentPath .= $_pathParts[$i] . '/';
176 177
             }
Please login to merge, or discard this patch.