Completed
Pull Request — master (#588)
by
unknown
14:32
created
xoops_lib/Xoops/Core/Lists/Editor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
      */
33 33
     public static function getList()
34 34
     {
35
-        return Directory::getList(\XoopsBaseConfig::get('root-path') . '/class/xoopseditor/');
35
+        return Directory::getList(\XoopsBaseConfig::get('root-path').'/class/xoopseditor/');
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/Time.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
         $timeList = array();
38 38
         $tz = new \DateTimeZone('UTC');
39 39
 
40
-        $start = (int) $start;
41
-        $end = (int) $end;
42
-        if (abs($end-$start) > 86400) {
40
+        $start = (int)$start;
41
+        $end = (int)$end;
42
+        if (abs($end - $start) > 86400) {
43 43
             $start = 0;
44 44
             $end = 86400;
45 45
         }
46
-        $end = ($end <= 86400 && $end > 0) ?  $end : 86400;
46
+        $end = ($end <= 86400 && $end > 0) ? $end : 86400;
47 47
 
48
-        $interval = ((int) $interval !== 0) ? 60 * $interval : 60*15;
48
+        $interval = ((int)$interval !== 0) ? 60 * $interval : 60 * 15;
49 49
 
50 50
         for ($t = $start; $t < $end; $t += $interval) {
51 51
             //$formatted = Calendar::formatTimeEx($t, 'short', $tz);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/HtmlFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
37 37
         if (is_dir($path) && $handle = opendir($path)) {
38 38
             while (false !== ($file = readdir($handle))) {
39 39
                 if ((preg_match('/\.(htm|html|xhtml)$/i', $file) && !is_dir($file))) {
40
-                    $file = $prefix . $file;
41
-                    $fileList[$file] = $prefix . $file;
40
+                    $file = $prefix.$file;
41
+                    $fileList[$file] = $prefix.$file;
42 42
                 }
43 43
             }
44 44
             closedir($handle);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/Directory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@
 block discarded – undo
34 34
      */
35 35
     public static function getList($path = '', $ignored = [])
36 36
     {
37
-        $ignored = (array) $ignored;
37
+        $ignored = (array)$ignored;
38 38
         $list = array();
39
-        $path = rtrim($path, '/') . '/';
39
+        $path = rtrim($path, '/').'/';
40 40
         if (is_dir($path) && $handle = opendir($path)) {
41 41
             while ($file = readdir($handle)) {
42 42
                 if (substr($file, 0, 1) === '.' || in_array(strtolower($file), $ignored)) {
43 43
                     continue;
44 44
                 }
45
-                if (is_dir($path . $file)) {
45
+                if (is_dir($path.$file)) {
46 46
                     $list[$file] = $file;
47 47
                 }
48 48
             }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/ImageFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         if (is_dir($path) && $handle = opendir($path)) {
38 38
             while (false !== ($file = readdir($handle))) {
39 39
                 if (preg_match('/\.(gif|jpg|jpeg|png|swf)$/i', $file)) {
40
-                    $file = $prefix . $file;
40
+                    $file = $prefix.$file;
41 41
                     $fileList[$file] = $file;
42 42
                 }
43 43
             }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/Theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public static function getList()
32 32
     {
33
-        $fileList = Directory::getList(\XoopsBaseConfig::get('themes-path') . '/');
33
+        $fileList = Directory::getList(\XoopsBaseConfig::get('themes-path').'/');
34 34
 
35 35
         return $fileList;
36 36
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/SubjectIcon.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $xoops = \Xoops::getInstance();
38 38
         $subDirectory = trim($subDirectory, '/');
39
-        $path = 'images/subject/' . $subDirectory;
40
-        $subjects = ImageFile::getList($xoops->path($path), $subDirectory . '/');
39
+        $path = 'images/subject/'.$subDirectory;
40
+        $subjects = ImageFile::getList($xoops->path($path), $subDirectory.'/');
41 41
 
42 42
         return $subjects;
43 43
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         foreach (array_keys($subjects) as $name) {
58 58
             $element->addOption(
59 59
                 $name,
60
-                '<img src="' . $xoops->url('images/subject/') . $name . '" alt="' . $name . '" />'
60
+                '<img src="'.$xoops->url('images/subject/').$name.'" alt="'.$name.'" />'
61 61
             );
62 62
         }
63 63
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Lists/TimeZone.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         //$xoops->cache()->delete($key);
40 40
         $timeZones = $xoops->cache()->cacheRead(
41 41
             $key,
42
-            function () {
42
+            function() {
43 43
                 $timeZones = array();
44 44
                 $territories = Territory::getContinentsAndCountries();
45 45
                 $maxLen = 0;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                             $maxLen = max(strlen($zone), $maxLen);
53 53
                             $name = Calendar::getTimezoneExemplarCity($zone);
54 54
                             if (!isset($timeZones[$zone]) && !empty($name)) {
55
-                                $timeZones[$zone] = $cName['name'] . '/' . $name;
55
+                                $timeZones[$zone] = $cName['name'].'/'.$name;
56 56
                             }
57 57
                         }
58 58
                     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Security.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
         $timeout = ($timeout <= 0) ? 300 : $timeout;
61 61
         $token_id = Random::generateOneTimeToken();
62 62
         // save token data on the server
63
-        if (!isset($_SESSION[$name . '_SESSION'])) {
64
-            $_SESSION[$name . '_SESSION'] = array();
63
+        if (!isset($_SESSION[$name.'_SESSION'])) {
64
+            $_SESSION[$name.'_SESSION'] = array();
65 65
         }
66 66
         $token_data = array(
67 67
             'id' => $token_id, 'expire' => time() + (int)($timeout)
68 68
         );
69
-        array_push($_SESSION[$name . '_SESSION'], $token_data);
69
+        array_push($_SESSION[$name.'_SESSION'], $token_data);
70 70
         return $token_id;
71 71
     }
72 72
 
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
         $log = array();
86 86
         $token = ($token !== false)
87 87
             ? $token
88
-            : (isset($_REQUEST[$name . '_REQUEST']) ? $_REQUEST[$name . '_REQUEST'] : '');
89
-        if (empty($token) || empty($_SESSION[$name . '_SESSION'])) {
88
+            : (isset($_REQUEST[$name.'_REQUEST']) ? $_REQUEST[$name.'_REQUEST'] : '');
89
+        if (empty($token) || empty($_SESSION[$name.'_SESSION'])) {
90 90
             $str = 'No valid token found in request/session';
91 91
             $this->setErrors($str);
92 92
             $log[] = array('Token Validation', $str);
93 93
         } else {
94
-            $token_data =& $_SESSION[$name . '_SESSION'];
94
+            $token_data = & $_SESSION[$name.'_SESSION'];
95 95
             if (is_array($token_data)) {
96 96
                 foreach (array_keys($token_data) as $i) {
97 97
                     if ($token === $token_data[$i]['id']) {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function clearTokens($name = 'XOOPS_TOKEN')
130 130
     {
131
-        $_SESSION[$name . '_SESSION'] = array();
131
+        $_SESSION[$name.'_SESSION'] = array();
132 132
     }
133 133
 
134 134
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function garbageCollection($name = 'XOOPS_TOKEN')
154 154
     {
155
-        $sessionName = $name . '_SESSION';
155
+        $sessionName = $name.'_SESSION';
156 156
         if (!empty($_SESSION[$sessionName]) && is_array($_SESSION[$sessionName])) {
157 157
             $_SESSION[$sessionName] = array_filter($_SESSION[$sessionName], array($this, 'filterToken'));
158 158
         }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             && $_SERVER['REMOTE_ADDR'] != ''
195 195
         ) {
196 196
             foreach ($xoops->getConfig('bad_ips') as $bi) {
197
-                if (!empty($bi) && preg_match('/' . $bi . '/', $_SERVER['REMOTE_ADDR'])) {
197
+                if (!empty($bi) && preg_match('/'.$bi.'/', $_SERVER['REMOTE_ADDR'])) {
198 198
                     exit();
199 199
                 }
200 200
             }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         } else {
242 242
             $ret = '';
243 243
             if (is_array($this->errors)) {
244
-                $ret = implode('<br />', $this->errors) . '<br />';
244
+                $ret = implode('<br />', $this->errors).'<br />';
245 245
             }
246 246
             return $ret;
247 247
         }
Please login to merge, or discard this patch.