Completed
Push — master ( 3189d6...01b1a5 )
by Michael
03:18
created
sendlink.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 echo '</head><body>';
22 22
 
23 23
 $smartobjectLinkHandler = xoops_getModuleHandler('link', 'smartobject');
24
-$linkObj                  = $smartobjectLinkHandler->create();
24
+$linkObj = $smartobjectLinkHandler->create();
25 25
 
26 26
 $op = isset($_POST['op']) ? $_POST['op'] : '';
27 27
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
              */
39 39
         }
40 40
 
41
-        $xoopsMailer =& getMailer();
41
+        $xoopsMailer = & getMailer();
42 42
         $xoopsMailer->useMail();
43 43
         $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template');
44 44
 
Please login to merge, or discard this patch.
include/adsense.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,4 +26,4 @@
 block discarded – undo
26 26
 include_once(SMARTOBJECT_ROOT_PATH . 'class/adsense.php');
27 27
 
28 28
 $smartobjectAdsenseHandler = xoops_getModuleHandler('adsense', 'smartobject');
29
-$smartobjectAdsensesObj     = $smartobjectAdsenseHandler->getAdsensesByTag();
29
+$smartobjectAdsensesObj = $smartobjectAdsenseHandler->getAdsensesByTag();
Please login to merge, or discard this patch.
include/rating.rate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 // Retreive the SmartObject Rating plugin for the current module if it exists
22 22
 $smartobjectRatingHandler = xoops_getModuleHandler('rating', 'smartobject');
23 23
 $smartobjectPluginHandler = new SmartPluginHandler();
24
-$pluginObj                  = $smartobjectPluginHandler->getPlugin($module_dirname);
24
+$pluginObj = $smartobjectPluginHandler->getPlugin($module_dirname);
25 25
 if ($pluginObj) {
26 26
     $rating_item = $pluginObj->getItem();
27 27
     if ($rating_item) {
Please login to merge, or discard this patch.
include/customtag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,4 +28,4 @@
 block discarded – undo
28 28
 include_once(SMARTOBJECT_ROOT_PATH . 'class/customtag.php');
29 29
 
30 30
 $smartobjectCustomtagHandler = xoops_getModuleHandler('customtag', 'smartobject');
31
-$smartobjectCustomTagsObj     = $smartobjectCustomtagHandler->getCustomtagsByName();
31
+$smartobjectCustomTagsObj = $smartobjectCustomtagHandler->getCustomtagsByName();
Please login to merge, or discard this patch.
include/captcha/scripts/img.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         if ($this->mode === 'bmp') {
80 80
             $this->config['num_chars'] = 4;
81
-            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int)str_pad('9', $this->config['num_chars'], '9'));
81
+            $this->code                = mt_rand(pow(10, $this->config['num_chars'] - 1), (int) str_pad('9', $this->config['num_chars'], '9'));
82 82
         } else {
83 83
             $this->code = substr(md5(uniqid(mt_rand(), 1)), 0, $this->config['num_chars']);
84 84
             if (!$this->config['casesensitive']) {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
             return;
94 94
         }
95 95
 
96
-        $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code;
97
-        $maxAttempts                          = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
96
+        $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code;
97
+        $maxAttempts                          = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
98 98
 
99 99
         // Increase the attempt records on refresh
100 100
         if (!empty($maxAttempts)) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         imagedestroy($oImage);
249 249
 
250 250
         $this->height  = $MaxCharHeight + 2;
251
-        $this->spacing = (int)(($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
251
+        $this->spacing = (int) (($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']);
252 252
         $this->width   = ($this->config['num_chars'] * $MaxCharWidth) + ($this->spacing / 2);
253 253
     }
254 254
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     }
432 432
 }
433 433
 
434
-$config        = @include '../config.php';
434
+$config = @include '../config.php';
435 435
 $imageHandler = new XoopsCaptchaImageHandler();
436 436
 $imageHandler->setConfig($config);
437 437
 $imageHandler->loadImage();
Please login to merge, or discard this patch.
include/captcha/text.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     public function setCode()
44 44
     {
45
-        $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code;
45
+        $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code;
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
include/captcha/config.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,20 +14,20 @@
 block discarded – undo
14 14
 $config = array(
15 15
     'mode'       => 'image',
16 16
     'name'       => 'xoopscaptcha',
17
-    'skipmember' => true,                    // Skip CAPTCHA check for members
18
-    'maxattempt' => 100,                    // Maximum attempts for each session
17
+    'skipmember' => true, // Skip CAPTCHA check for members
18
+    'maxattempt' => 100, // Maximum attempts for each session
19 19
 
20
-    'num_chars'       => 4,                        // Maximum characters
20
+    'num_chars'       => 4, // Maximum characters
21 21
 
22 22
     // For image mode, based on DuGris' SecurityImage
23
-    'rootpath'        => __DIR__,        // __Absolute__ Path to the root of fonts and backgrounds
24
-    'imagepath'       => 'uploads/captcha',        // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH
25
-    'imageurl'        => 'modules/smartobject/include/captcha/scripts/img.php',        // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH
26
-    'casesensitive'   => false,                    // Characters in image mode is case-sensitive
27
-    'fontsize_min'    => 12,                    // Minimum font-size
28
-    'fontsize_max'    => 12,                    // Maximum font-size
29
-    'background_type' => 0,                        // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files
30
-    'background_num'  => 50,                        // Number of background images to generate
23
+    'rootpath'        => __DIR__, // __Absolute__ Path to the root of fonts and backgrounds
24
+    'imagepath'       => 'uploads/captcha', // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH
25
+    'imageurl'        => 'modules/smartobject/include/captcha/scripts/img.php', // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH
26
+    'casesensitive'   => false, // Characters in image mode is case-sensitive
27
+    'fontsize_min'    => 12, // Minimum font-size
28
+    'fontsize_max'    => 12, // Maximum font-size
29
+    'background_type' => 0, // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files
30
+    'background_num'  => 50, // Number of background images to generate
31 31
     'polygon_point'   => 3
32 32
 );
33 33
 
Please login to merge, or discard this patch.
include/captcha/captcha.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 class XoopsCaptcha
15 15
 {
16 16
     public $active = true;
17
-    public $mode   = 'text';    // potential values: image, text
17
+    public $mode   = 'text'; // potential values: image, text
18 18
     public $config = array();
19 19
 
20 20
     public $message = array(); // Logging error messages
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $sessionName = @$_SESSION['XoopsCaptcha_name'];
129 129
         $skipMember  = ($skipMember === null) ? @$_SESSION['XoopsCaptcha_skipmember'] : $skipMember;
130
-        $maxAttempts = (int)(@$_SESSION['XoopsCaptcha_maxattempts']);
130
+        $maxAttempts = (int) (@$_SESSION['XoopsCaptcha_maxattempts']);
131 131
 
132 132
         $is_valid = false;
133 133
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     public function destroyGarbage($clearSession = false)
186 186
     {
187 187
         require_once __DIR__ . '/' . $this->mode . '.php';
188
-        $class           = 'XoopsCaptcha' . ucfirst($this->mode);
188
+        $class = 'XoopsCaptcha' . ucfirst($this->mode);
189 189
         $captchaHandler = new $class();
190 190
         if (method_exists($captchaHandler, 'destroyGarbage')) {
191 191
             $captchaHandler->loadConfig($this->config);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     public function loadForm()
241 241
     {
242 242
         require_once __DIR__ . '/' . $this->mode . '.php';
243
-        $class           = 'XoopsCaptcha' . ucfirst($this->mode);
243
+        $class = 'XoopsCaptcha' . ucfirst($this->mode);
244 244
         $captchaHandler = new $class();
245 245
         $captchaHandler->loadConfig($this->config);
246 246
 
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 {
469 469
     static $smartModules;
470 470
     if (isset($smartModules[$moduleName])) {
471
-        $ret =& $smartModules[$moduleName];
471
+        $ret = & $smartModules[$moduleName];
472 472
 
473 473
         return $ret;
474 474
     }
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 {
505 505
     static $smartConfigs;
506 506
     if (isset($smartConfigs[$moduleName])) {
507
-        $ret =& $smartConfigs[$moduleName];
507
+        $ret = & $smartConfigs[$moduleName];
508 508
 
509 509
         return $ret;
510 510
     }
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             return $ret;
533 533
         }
534 534
         $hModConfig                = xoops_getHandler('config');
535
-        $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
535
+        $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid'));
536 536
     }
537 537
 
538 538
     return $smartConfigs[$moduleName];
@@ -578,17 +578,17 @@  discard block
 block discarded – undo
578 578
     if (!is_numeric($userid)) {
579 579
         return $userid;
580 580
     }
581
-    $userid = (int)$userid;
581
+    $userid = (int) $userid;
582 582
     if ($userid > 0) {
583 583
         if ($users == array()) {
584 584
             //fetching users
585 585
             $memberHandler = xoops_getHandler('member');
586
-            $user           =& $memberHandler->getUser($userid);
586
+            $user = & $memberHandler->getUser($userid);
587 587
         } else {
588 588
             if (!isset($users[$userid])) {
589 589
                 return $GLOBALS['xoopsConfig']['anonymous'];
590 590
             }
591
-            $user =& $users[$userid];
591
+            $user = & $users[$userid];
592 592
         }
593 593
         if (is_object($user)) {
594 594
             $ts        = MyTextSanitizer:: getInstance();
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
     $tpl = new XoopsTpl();
862 862
 
863 863
     $hModule      = xoops_getHandler('module');
864
-    $versioninfo  =& $hModule->get($xoopsModule->getVar('mid'));
864
+    $versioninfo  = & $hModule->get($xoopsModule->getVar('mid'));
865 865
     $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . '';
866 866
     $modfooter    = "<a href='" . $versioninfo->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/cssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'/></a>";
867 867
     $tpl->assign('modfooter', $modfooter);
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 function smart_htmlnumericentities($str)
977 977
 {
978 978
     //    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
979
-    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) { return '&#' . ord($m[0]) . chr(59); }, $str);
979
+    return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) { return '&#' . ord($m[0]) . chr(59); }, $str);
980 980
 }
981 981
 
982 982
 /**
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
         }
995 995
         $class = 'Xoops' . ucfirst($name) . 'Handler';
996 996
         if (class_exists($class)) {
997
-            $handlers[$name] = new $class ($GLOBALS['xoopsDB'], 'xoops');
997
+            $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops');
998 998
         }
999 999
     }
1000 1000
     if (!isset($handlers[$name]) && !$optional) {
@@ -1143,11 +1143,11 @@  discard block
 block discarded – undo
1143 1143
     // common HTML entities to their text equivalent.
1144 1144
     // Credits: newbb2
1145 1145
     $search = array(
1146
-        "'<script[^>]*?>.*?</script>'si",  // Strip out javascript
1147
-        "'<img.*?/>'si",       // Strip out img tags
1148
-        "'<[\/\!]*?[^<>]*?>'si",          // Strip out HTML tags
1149
-        "'([\r\n])[\s]+'",                // Strip out white space
1150
-        "'&(quot|#34);'i",                // Replace HTML entities
1146
+        "'<script[^>]*?>.*?</script>'si", // Strip out javascript
1147
+        "'<img.*?/>'si", // Strip out img tags
1148
+        "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
1149
+        "'([\r\n])[\s]+'", // Strip out white space
1150
+        "'&(quot|#34);'i", // Replace HTML entities
1151 1151
         "'&(amp|#38);'i",
1152 1152
         "'&(lt|#60);'i",
1153 1153
         "'&(gt|#62);'i",
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
         "'&(pound|#163);'i",
1158 1158
         "'&(copy|#169);'i",
1159 1159
         "'&#(\d+);'e"
1160
-    );                    // evaluate as php
1160
+    ); // evaluate as php
1161 1161
 
1162 1162
     $replace = array(
1163 1163
         '',
@@ -1197,21 +1197,21 @@  discard block
 block discarded – undo
1197 1197
         $str = $match[0];
1198 1198
         if (false !== strpos($str, ',')) {
1199 1199
             // A comma exists, that makes it easy, cos we assume it separates the decimal part.
1200
-            $str = str_replace('.', '', $str);    // Erase thousand seps
1201
-            $str = str_replace(',', '.', $str);    // Convert , to . for floatval command
1200
+            $str = str_replace('.', '', $str); // Erase thousand seps
1201
+            $str = str_replace(',', '.', $str); // Convert , to . for floatval command
1202 1202
 
1203
-            return (float)$str;
1203
+            return (float) $str;
1204 1204
         } else {
1205 1205
             // No comma exists, so we have to decide, how a single dot shall be treated
1206 1206
             if (preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) == true && $set['single_dot_as_decimal'] == true) {
1207 1207
                 // Treat single dot as decimal separator
1208
-                return (float)$str;
1208
+                return (float) $str;
1209 1209
             } else {
1210 1210
                 //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br/><br/> ";
1211 1211
                 // Else, treat all dots as thousand seps
1212
-                $str = str_replace('.', '', $str);    // Erase thousand seps
1212
+                $str = str_replace('.', '', $str); // Erase thousand seps
1213 1213
 
1214
-                return (float)$str;
1214
+                return (float) $str;
1215 1215
             }
1216 1216
         }
1217 1217
     } else {
Please login to merge, or discard this patch.