Completed
Push — master ( 46dc99...a217e2 )
by Michael
50:47 queued 35:27
created
htdocs/class/userutility.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
         $stop = '';
114 114
         // Invalid email address
115 115
         if (!$xoops->checkEmail($email)) {
116
-            $stop .= XoopsLocale::E_INVALID_EMAIL . '<br />';
116
+            $stop .= XoopsLocale::E_INVALID_EMAIL.'<br />';
117 117
         }
118 118
         if (strrpos($email, ' ') > 0) {
119
-            $stop .= XoopsLocale::E_EMAIL_SHOULD_NOT_CONTAIN_SPACES . '<br />';
119
+            $stop .= XoopsLocale::E_EMAIL_SHOULD_NOT_CONTAIN_SPACES.'<br />';
120 120
         }
121 121
         // Check forbidden email address if current operator is not an administrator
122 122
         if (!$xoops->userIsAdmin) {
123 123
             $bad_emails = $xoops->getConfig('bad_emails');
124 124
             if (!empty($bad_emails)) {
125 125
                 foreach ($bad_emails as $be) {
126
-                    if (!empty($be) && preg_match('/' . $be . '/i', $email)) {
127
-                        $stop .= XoopsLocale::E_INVALID_EMAIL . '<br />';
126
+                    if (!empty($be) && preg_match('/'.$be.'/i', $email)) {
127
+                        $stop .= XoopsLocale::E_INVALID_EMAIL.'<br />';
128 128
                         break;
129 129
                     }
130 130
                 }
@@ -133,23 +133,23 @@  discard block
 block discarded – undo
133 133
         // $uname = XoopsLocale::trim($uname);
134 134
         // no controls, puctuation, symbols, spaces or invisible separators
135 135
         if (!preg_match('/^[^\p{C}\p{P}\p{S}\p{Z}]+$/u', $uname)) {
136
-            $stop .= XoopsLocale::E_INVALID_USERNAME . '<br />';
136
+            $stop .= XoopsLocale::E_INVALID_USERNAME.'<br />';
137 137
         }
138 138
         // Check uname settings if current operator is not an administrator
139 139
         if (!$xoops->userIsAdmin) {
140 140
             $maxuname = $xoops->getConfig('maxuname');
141 141
             if (!empty($maxuname) && mb_strlen($uname) > $maxuname) {
142
-                $stop .= sprintf(XoopsLocale::EF_USERNAME_MUST_BE_LESS_THAN, $maxuname) . '<br />';
142
+                $stop .= sprintf(XoopsLocale::EF_USERNAME_MUST_BE_LESS_THAN, $maxuname).'<br />';
143 143
             }
144 144
             $minuname = $xoops->getConfig('minuname');
145 145
             if (!empty($minuname) && mb_strlen($uname) < $minuname) {
146
-                $stop .= sprintf(XoopsLocale::EF_USERNAME_MUST_BE_MORE_THAN, $minuname) . '<br />';
146
+                $stop .= sprintf(XoopsLocale::EF_USERNAME_MUST_BE_MORE_THAN, $minuname).'<br />';
147 147
             }
148 148
             $bad_unames = $xoops->getConfig('bad_unames');
149 149
             if (!empty($bad_unames)) {
150 150
                 foreach ($bad_unames as $bu) {
151
-                    if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) {
152
-                        $stop .= XoopsLocale::E_NAME_IS_RESERVED . '<br />';
151
+                    if (!empty($bu) && preg_match('/'.$bu.'/i', $uname)) {
152
+                        $stop .= XoopsLocale::E_NAME_IS_RESERVED.'<br />';
153 153
                         break;
154 154
                     }
155 155
                 }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         }
167 167
         $count = $user_handler->getCount($criteria);
168 168
         if ($count > 0) {
169
-            $stop .= XoopsLocale::E_USERNAME_TAKEN . '<br />';
169
+            $stop .= XoopsLocale::E_USERNAME_TAKEN.'<br />';
170 170
         }
171 171
 
172 172
         $criteria = new CriteriaCompo(new Criteria('email', $email));
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         }
176 176
         $count = $user_handler->getCount($criteria);
177 177
         if ($count > 0) {
178
-            $stop .= XoopsLocale::E_EMAIL_TAKEN . '<br />';
178
+            $stop .= XoopsLocale::E_EMAIL_TAKEN.'<br />';
179 179
         }
180 180
 
181 181
         // If password is not set, skip password validation
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
         }
185 185
 
186 186
         if (empty($pass) || empty($vpass)) {
187
-            $stop .= XoopsLocale::E_MUST_PROVIDE_PASSWORD . '<br />';
187
+            $stop .= XoopsLocale::E_MUST_PROVIDE_PASSWORD.'<br />';
188 188
         }
189 189
         if (isset($pass) && isset($vpass) && ($pass != $vpass)) {
190
-            $stop .= XoopsLocale::E_PASSWORDS_MUST_MATCH . '<br />';
190
+            $stop .= XoopsLocale::E_PASSWORDS_MUST_MATCH.'<br />';
191 191
         } else {
192 192
             $minpass = $xoops->getConfig('minpass');
193 193
             if (($pass != '') && (!empty($minpass)) && (mb_strlen($pass) < $minpass)) {
194
-                $stop .= sprintf(XoopsLocale::EF_PASSWORD_MUST_BE_GREATER_THAN, $minpass) . '<br />';
194
+                $stop .= sprintf(XoopsLocale::EF_PASSWORD_MUST_BE_GREATER_THAN, $minpass).'<br />';
195 195
             }
196 196
         }
197 197
         return $stop;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $users = array();
270 270
         if (count($userids) > 0) {
271 271
             $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
272
-            $criteria->add(new Criteria('uid', "('" . implode(',', array_unique($userids)) . "')", 'IN'));
272
+            $criteria->add(new Criteria('uid', "('".implode(',', array_unique($userids))."')", 'IN'));
273 273
 
274 274
             $user_handler = $xoops->getHandlerUser();
275 275
             if (!$rows = $user_handler->getAll($criteria, array('uid', 'uname', 'name'), false, true)) {
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
                     $users[$uid] = $myts->htmlSpecialChars($row['uname']);
283 283
                 }
284 284
                 if ($linked) {
285
-                    $users[$uid] = '<a href="' . \XoopsBaseConfig::get('url') . '/userinfo.php?uid='
286
-                        . $uid . '" title="' . $users[$uid] . '">' . $users[$uid] . '</a>';
285
+                    $users[$uid] = '<a href="'.\XoopsBaseConfig::get('url').'/userinfo.php?uid='
286
+                        . $uid.'" title="'.$users[$uid].'">'.$users[$uid].'</a>';
287 287
                 }
288 288
             }
289 289
         }
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
                     $username = $user->getVar('uname');
319 319
                 }
320 320
                 if (!empty($linked)) {
321
-                    $username = '<a href="' . \XoopsBaseConfig::get('url') . '/userinfo.php?uid='
322
-                        . $userid . '" title="' . $username . '">' . $username . '</a>';
321
+                    $username = '<a href="'.\XoopsBaseConfig::get('url').'/userinfo.php?uid='
322
+                        . $userid.'" title="'.$username.'">'.$username.'</a>';
323 323
                 }
324 324
             }
325 325
         }
Please login to merge, or discard this patch.
htdocs/class/tardownloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function addFileData(&$data, $filename, $time = 0)
98 98
     {
99
-        $dummyfile = \XoopsBaseConfig::get('caches-path') . '/dummy_' . time() . '.html';
99
+        $dummyfile = \XoopsBaseConfig::get('caches-path').'/dummy_'.time().'.html';
100 100
         $fp = @fopen($dummyfile, 'w');
101 101
         if ($fp === false) {
102 102
             return false;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function addBinaryFileData(&$data, $filename, $time = 0)
133 133
     {
134
-        $dummyfile = \XoopsBaseConfig::get('caches-path') . '/dummy_' . time() . '.html';
134
+        $dummyfile = \XoopsBaseConfig::get('caches-path').'/dummy_'.time().'.html';
135 135
         $fp = @fopen($dummyfile, 'wb');
136 136
         if ($fp === false) {
137 137
             return false;
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function download($name, $gzip = true)
167 167
     {
168
-        $this->_header($name . $this->ext);
169
-        $str = $this->archiver->toTarOutput($name . $this->ext, $gzip);
168
+        $this->_header($name.$this->ext);
169
+        $str = $this->archiver->toTarOutput($name.$this->ext, $gzip);
170 170
         if ($str !== false) {
171 171
             echo $str;
172 172
         }
Please login to merge, or discard this patch.
htdocs/class/class.zipfile.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -158,9 +158,9 @@
 block discarded – undo
158 158
         $ctrldir = implode('', $this->ctrl_dir);
159 159
 
160 160
         return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', count($this->ctrl_dir)) . // total # of entries "on this disk"
161
-               pack('v', count($this->ctrl_dir)) . // total # of entries overall
162
-               pack('V', strlen($ctrldir)) . // size of central dir
163
-               pack('V', strlen($data)) . // offset to start of central dir
164
-               "\x00\x00"; // .zip file comment length
161
+                pack('v', count($this->ctrl_dir)) . // total # of entries overall
162
+                pack('V', strlen($ctrldir)) . // size of central dir
163
+                pack('V', strlen($data)) . // offset to start of central dir
164
+                "\x00\x00"; // .zip file comment length
165 165
     } // end of the 'file()' method
166 166
 } // end of the 'zipfile' class
167 167
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
         $name = str_replace('\\', '/', $name);
93 93
 
94 94
         $dtime = dechex($this->unix2DosTime($time));
95
-        $hexdtime = '\x' . $dtime[6] . $dtime[7] . '\x' . $dtime[4] . $dtime[5] . '\x' . $dtime[2] . $dtime[3] . '\x' . $dtime[0] . $dtime[1];
96
-        eval('$hexdtime = "' . $hexdtime . '";');
95
+        $hexdtime = '\x'.$dtime[6].$dtime[7].'\x'.$dtime[4].$dtime[5].'\x'.$dtime[2].$dtime[3].'\x'.$dtime[0].$dtime[1];
96
+        eval('$hexdtime = "'.$hexdtime.'";');
97 97
 
98 98
         $fr = "\x50\x4b\x03\x04";
99 99
         $fr .= "\x14\x00"; // ver needed to extract
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
         $data = implode('', $this->datasec);
158 158
         $ctrldir = implode('', $this->ctrl_dir);
159 159
 
160
-        return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', count($this->ctrl_dir)) . // total # of entries "on this disk"
161
-               pack('v', count($this->ctrl_dir)) . // total # of entries overall
162
-               pack('V', strlen($ctrldir)) . // size of central dir
163
-               pack('V', strlen($data)) . // offset to start of central dir
160
+        return $data.$ctrldir.$this->eof_ctrl_dir.pack('v', count($this->ctrl_dir)).// total # of entries "on this disk"
161
+               pack('v', count($this->ctrl_dir)).// total # of entries overall
162
+               pack('V', strlen($ctrldir)).// size of central dir
163
+               pack('V', strlen($data)).// offset to start of central dir
164 164
                "\x00\x00"; // .zip file comment length
165 165
     } // end of the 'file()' method
166 166
 } // end of the 'zipfile' class
167 167
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/file/xoopsfile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@
 block discarded – undo
41 41
     {
42 42
         $handler = null;
43 43
         $name = strtolower(trim($name));
44
-        $class = 'Xoops' . ucfirst($name) . 'Handler';
44
+        $class = 'Xoops'.ucfirst($name).'Handler';
45 45
         if (in_array($name, array('file', 'folder'))) {
46 46
             $handler = new $class($path, $create, $mode);
47 47
         } else {
48 48
             trigger_error(
49
-                'Class ' . $class . ' not exist in File ' . __FILE__ . ' at Line ' . __LINE__,
49
+                'Class '.$class.' not exist in File '.__FILE__.' at Line '.__LINE__,
50 50
                 E_USER_WARNING
51 51
             );
52 52
             return false;
Please login to merge, or discard this patch.
htdocs/class/file/file.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             $this->info();
341 341
         }
342 342
         if (isset($this->info['extension'])) {
343
-            return basename($this->name, '.' . $this->info['extension']);
343
+            return basename($this->name, '.'.$this->info['extension']);
344 344
         } elseif ($this->name) {
345 345
             return $this->name;
346 346
         }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
      */
394 394
     public function pwd()
395 395
     {
396
-        return $this->folder->slashTerm($this->folder->pwd()) . $this->name;
396
+        return $this->folder->slashTerm($this->folder->pwd()).$this->name;
397 397
     }
398 398
 
399 399
     /**
Please login to merge, or discard this patch.
htdocs/class/file/folder.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
     public function __construct($path = '', $create = true, $mode = false)
103 103
     {
104 104
         if (empty($path)) {
105
-            $path = \XoopsBaseConfig::get('var-path') . '/caches/xoops_cache';
105
+            $path = \XoopsBaseConfig::get('var-path').'/caches/xoops_cache';
106 106
         }
107 107
         if ($mode) {
108 108
             $this->mode = intval($mode, 8);
109 109
         }
110
-        if (! XoopsLoad::fileExists($path) && $create == true) {
110
+        if (!XoopsLoad::fileExists($path) && $create == true) {
111 111
             $this->create($path, $this->mode);
112 112
         }
113
-        if (! $this->isAbsolute($path)) {
113
+        if (!$this->isAbsolute($path)) {
114 114
             $path1 = $this->realpath($path);
115
-            if (false===$path1)
116
-                throw new InvalidArgumentException($path . ' not found');
115
+            if (false === $path1)
116
+                throw new InvalidArgumentException($path.' not found');
117 117
             $path = $path1;
118 118
         }
119 119
         $this->cd($path);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public static function isWindowsPath($path)
277 277
     {
278
-        if (preg_match('/^[A-Z]:/i', $path) || false !== strpos($path,'\\')) {
278
+        if (preg_match('/^[A-Z]:/i', $path) || false !== strpos($path, '\\')) {
279 279
             return true;
280 280
         }
281 281
         return false;
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
      */
293 293
     public static function isAbsolute($path)
294 294
     {
295
-        $path = str_replace('\\','/',$path);
295
+        $path = str_replace('\\', '/', $path);
296 296
         $match = preg_match('/^(\/|[A-Z]:\/|\/\/)/', $path);
297 297
         return ($match == 1);
298 298
     }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         if (self::isSlashTerm($path)) {
346 346
             return $path;
347 347
         }
348
-        return $path . self::correctSlashFor($path);
348
+        return $path.self::correctSlashFor($path);
349 349
     }
350 350
 
351 351
     /**
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
      */
361 361
     public static function addPathElement($path, $element)
362 362
     {
363
-        return self::slashTerm($path) . $element;
363
+        return self::slashTerm($path).$element;
364 364
     }
365 365
 
366 366
     /**
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     {
376 376
         $xoops_root_path = \XoopsBaseConfig::get('root-path');
377 377
         $dir = substr($this->slashTerm($xoops_root_path), 0, -1);
378
-        $newdir = $dir . ($path{0}==='/'?'':'/') . $path;
378
+        $newdir = $dir.($path{0} === '/' ? '' : '/').$path;
379 379
         return $this->inPath($newdir);
380 380
     }
381 381
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 }
504 504
                 $found = false;
505 505
                 if (($hidden === true) || ($hidden === false && $item{0} !== '.')) {
506
-                    $found = $path . '/' . $item;
506
+                    $found = $path.'/'.$item;
507 507
                 }
508 508
                 if ($found !== false) {
509 509
                     if (is_dir($found)) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,8 +112,9 @@
 block discarded – undo
112 112
         }
113 113
         if (! $this->isAbsolute($path)) {
114 114
             $path1 = $this->realpath($path);
115
-            if (false===$path1)
116
-                throw new InvalidArgumentException($path . ' not found');
115
+            if (false===$path1) {
116
+                            throw new InvalidArgumentException($path . ' not found');
117
+            }
117 118
             $path = $path1;
118 119
         }
119 120
         $this->cd($path);
Please login to merge, or discard this patch.
htdocs/class/zipdownloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
      */
131 131
     public function download($name, $gzip = true)
132 132
     {
133
-        $this->_header($name . $this->ext);
133
+        $this->_header($name.$this->ext);
134 134
         $result = $this->archiver->file();
135 135
         if ($result !== false) {
136 136
             echo $result;
Please login to merge, or discard this patch.
htdocs/class/downloader.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
      * @param boolean|string $newfilename
75 75
      * @return void
76 76
      */
77
-     abstract function addFile($filepath, $newfilename = null);
77
+        abstract function addFile($filepath, $newfilename = null);
78 78
 
79 79
     /**
80 80
      * @abstract
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,14 +55,14 @@
 block discarded – undo
55 55
         if (function_exists('mb_http_output')) {
56 56
             mb_http_output('pass');
57 57
         }
58
-        header('Content-Type: ' . $this->mimetype);
58
+        header('Content-Type: '.$this->mimetype);
59 59
         if (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/", $_SERVER['HTTP_USER_AGENT'])) {
60
-            header('Content-Disposition: attachment; filename="' . $filename . '"');
60
+            header('Content-Disposition: attachment; filename="'.$filename.'"');
61 61
             header('Expires: 0');
62 62
             header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
63 63
             header('Pragma: public');
64 64
         } else {
65
-            header('Content-Disposition: attachment; filename="' . $filename . '"');
65
+            header('Content-Disposition: attachment; filename="'.$filename.'"');
66 66
             header('Expires: 0');
67 67
             header('Pragma: no-cache');
68 68
         }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/xoopseditor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         // TODO: switch to property_exists() as of PHP 5.1.0
85 85
         $vars = get_class_vars(__CLASS__);
86 86
         foreach ($configs as $key => $val) {
87
-            $method = "set" . ucfirst($key);
87
+            $method = "set".ucfirst($key);
88 88
             if (method_exists($this, $method)) {
89 89
                 $this->$method($val);
90 90
             } else {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     private function __construct()
156 156
     {
157
-        $this->root_path = \XoopsBaseConfig::get('root-path') . '/class/xoopseditor';
157
+        $this->root_path = \XoopsBaseConfig::get('root-path').'/class/xoopseditor';
158 158
     }
159 159
 
160 160
     /**
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
     {
206 206
         $list = array();
207 207
         $order = array();
208
-        $fileList = XoopsLists::getDirListAsArray($this->root_path . '/');
208
+        $fileList = XoopsLists::getDirListAsArray($this->root_path.'/');
209 209
 
210 210
         foreach ($fileList as $item) {
211
-            if (XoopsLoad::fileExists($file = $this->root_path . '/' . $item . '/language/' . XoopsLocale::getLegacyLanguage() . '.php')) {
211
+            if (XoopsLoad::fileExists($file = $this->root_path.'/'.$item.'/language/'.XoopsLocale::getLegacyLanguage().'.php')) {
212 212
                 include_once $file;
213 213
             } else {
214
-                if (XoopsLoad::fileExists($file = $this->root_path . '/' . $item . '/language/english.php')) {
214
+                if (XoopsLoad::fileExists($file = $this->root_path.'/'.$item.'/language/english.php')) {
215 215
                     include_once $file;
216 216
                 }
217 217
             }
218
-            if (XoopsLoad::fileExists($file = $this->root_path . '/' . $item . '/editor_registry.php')) {
218
+            if (XoopsLoad::fileExists($file = $this->root_path.'/'.$item.'/editor_registry.php')) {
219 219
                 include $file;
220 220
                 if (empty($config['order'])) {
221 221
                     continue;
@@ -277,15 +277,15 @@  discard block
 block discarded – undo
277 277
         if (empty($name) || !array_key_exists($name, $this->getList())) {
278 278
             return $editor;
279 279
         }
280
-        $editor_path = $this->root_path . '/' . $name;
281
-        if (XoopsLoad::fileExists($file = $editor_path . '/language/' . XoopsLocale::getLegacyLanguage() . '.php')) {
280
+        $editor_path = $this->root_path.'/'.$name;
281
+        if (XoopsLoad::fileExists($file = $editor_path.'/language/'.XoopsLocale::getLegacyLanguage().'.php')) {
282 282
             include_once $file;
283 283
         } else {
284
-            if (XoopsLoad::fileExists($file = $editor_path . '/language/english.php')) {
284
+            if (XoopsLoad::fileExists($file = $editor_path.'/language/english.php')) {
285 285
                 include_once $file;
286 286
             }
287 287
         }
288
-        if (XoopsLoad::fileExists($file = $editor_path . '/editor_registry.php')) {
288
+        if (XoopsLoad::fileExists($file = $editor_path.'/editor_registry.php')) {
289 289
             include $file;
290 290
         } else {
291 291
             return $editor;
Please login to merge, or discard this patch.