Completed
Push — master ( 46dc99...a217e2 )
by Michael
50:47 queued 35:27
created
htdocs/class/xoopseditor/textarea/editor_registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 return $config = array(
25 25
     "class"  => "FormTextArea",
26
-    "file"   => \XoopsBaseConfig::get('root-path') . "/class/xoopseditor/textarea/textarea.php",
26
+    "file"   => \XoopsBaseConfig::get('root-path')."/class/xoopseditor/textarea/textarea.php",
27 27
     "title"  => _XOOPS_EDITOR_TEXTAREA, // display to end user
28 28
     "order"  => 1, // 0 will disable the editor
29 29
     "nohtml" => 1 // For forms that have "dohtml" disabled
Please login to merge, or discard this patch.
htdocs/class/captcha/xoopscaptcha.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@
 block discarded – undo
73 73
     protected function __construct()
74 74
     {
75 75
         // Load static configurations
76
-		$xoops_root_path = \XoopsBaseConfig::get('root-path');
77
-		$xoops_var_path = \XoopsBaseConfig::get('var-path');
76
+        $xoops_root_path = \XoopsBaseConfig::get('root-path');
77
+        $xoops_var_path = \XoopsBaseConfig::get('var-path');
78 78
         $this->path_basic = $xoops_root_path . '/class/captcha';
79 79
         $this->path_plugin = $xoops_root_path . '/Frameworks/captcha';
80 80
         $this->configPath = $xoops_var_path . '/configs/';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         // Load static configurations
76 76
 		$xoops_root_path = \XoopsBaseConfig::get('root-path');
77 77
 		$xoops_var_path = \XoopsBaseConfig::get('var-path');
78
-        $this->path_basic = $xoops_root_path . '/class/captcha';
79
-        $this->path_plugin = $xoops_root_path . '/Frameworks/captcha';
80
-        $this->configPath = $xoops_var_path . '/configs/';
78
+        $this->path_basic = $xoops_root_path.'/class/captcha';
79
+        $this->path_plugin = $xoops_root_path.'/Frameworks/captcha';
80
+        $this->configPath = $xoops_var_path.'/configs/';
81 81
         $this->config = $this->loadConfig();
82 82
         $this->name = $this->config['name'];
83 83
     }
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
      *
105 105
      * @return array
106 106
      */
107
-    function loadConfig( $name = 'config') {
108
-        if ( $name === 'config' ) {
107
+    function loadConfig($name = 'config') {
108
+        if ($name === 'config') {
109 109
             $filename = 'captcha.config';
110 110
         } else {
111
-            $filename = 'captcha.config.' . $name;
111
+            $filename = 'captcha.config.'.$name;
112 112
         }
113
-        if ( !$config = $this->readConfig($filename) ) {
114
-            $config = $this->loadBasicConfig( $name );
115
-            $this->writeConfig($filename, $config );
113
+        if (!$config = $this->readConfig($filename)) {
114
+            $config = $this->loadBasicConfig($name);
115
+            $this->writeConfig($filename, $config);
116 116
         }
117 117
 
118 118
         return $config;
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $basic_config = array();
131 131
         $plugin_config = array();
132
-        $filename = ($filename === 'config') ? 'config.php' : 'config.' . $filename . '.php';
133
-        if (XoopsLoad::fileExists($file = $this->path_basic . '/' . $filename)) {
132
+        $filename = ($filename === 'config') ? 'config.php' : 'config.'.$filename.'.php';
133
+        if (XoopsLoad::fileExists($file = $this->path_basic.'/'.$filename)) {
134 134
             $basic_config = include $file;
135 135
         }
136
-        if (XoopsLoad::fileExists($file = $this->path_plugin . '/' . $filename)) {
136
+        if (XoopsLoad::fileExists($file = $this->path_plugin.'/'.$filename)) {
137 137
             $plugin_config = include $file;
138 138
         }
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     function readConfig($filename = 'config')
152 152
     {
153
-        $path_file = $this->configPath . $filename . '.php';
153
+        $path_file = $this->configPath.$filename.'.php';
154 154
         $file = XoopsFile::getHandler('file', $path_file);
155 155
         return eval(@$file->read());
156 156
     }
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
      */
166 166
     function writeConfig($filename = 'config', $config)
167 167
     {
168
-        $path_file = $this->configPath . $filename . '.php';
168
+        $path_file = $this->configPath.$filename.'.php';
169 169
         $file = XoopsFile::getHandler('file', $path_file);
170
-        return $file->write( 'return ' . var_export($config, true) . ';');
170
+        return $file->write('return '.var_export($config, true).';');
171 171
     }
172 172
 
173 173
     /**
@@ -207,22 +207,22 @@  discard block
 block discarded – undo
207 207
     public function loadHandler($name = null)
208 208
     {
209 209
         $name = !empty($name) ? $name : (empty($this->config['mode']) ? 'text' : $this->config['mode']);
210
-        $class = 'XoopsCaptcha' . ucfirst($name);
210
+        $class = 'XoopsCaptcha'.ucfirst($name);
211 211
         if (!empty($this->handler) && get_class($this->handler) == $class) {
212 212
             return $this->handler;
213 213
         }
214 214
         $this->handler = null;
215
-        if (XoopsLoad::fileExists($file = $this->path_basic . '/' . $name . '.php')) {
215
+        if (XoopsLoad::fileExists($file = $this->path_basic.'/'.$name.'.php')) {
216 216
             require_once $file;
217 217
         } else {
218
-            if (XoopsLoad::fileExists($file = $this->path_plugin . '/' . $name . '.php')) {
218
+            if (XoopsLoad::fileExists($file = $this->path_plugin.'/'.$name.'.php')) {
219 219
                 require_once $file;
220 220
             }
221 221
         }
222 222
 
223 223
         if (!class_exists($class)) {
224 224
             $class = 'XoopsCaptchaText';
225
-            require_once $this->path_basic . '/text.php';
225
+            require_once $this->path_basic.'/text.php';
226 226
         }
227 227
         /* @var $handler XoopsCaptchaMethod */
228 228
         $handler = new $class($this);
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
         $this->handler->destroyGarbage();
349 349
 
350 350
         if ($clearSession) {
351
-            foreach ($this->config as $k => $config ) {
352
-                $_SESSION[$this->name . '_' . $k] = null;
351
+            foreach ($this->config as $k => $config) {
352
+                $_SESSION[$this->name.'_'.$k] = null;
353 353
             }
354 354
         }
355 355
         return true;
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
     public function render()
364 364
     {
365 365
         $sessionName = $this->config['name'];
366
-        $_SESSION[$sessionName . '_name'] = $sessionName;
367
-        foreach ($this->config as $k => $config ) {
368
-            $_SESSION[$sessionName . '_' . $k] = $config;
366
+        $_SESSION[$sessionName.'_name'] = $sessionName;
367
+        foreach ($this->config as $k => $config) {
368
+            $_SESSION[$sessionName.'_'.$k] = $config;
369 369
         }
370 370
         $form = '';
371 371
         if (!$this->active || empty($this->config['name'])) {
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
         }
374 374
 
375 375
         $maxAttempts = $this->config['maxattempts'];
376
-        $attempt = isset($_SESSION[$sessionName . '_attempt']) ? $_SESSION[$sessionName . '_attempt'] : 0;
377
-        $_SESSION[$sessionName . '_attempt'] = $attempt;
376
+        $attempt = isset($_SESSION[$sessionName.'_attempt']) ? $_SESSION[$sessionName.'_attempt'] : 0;
377
+        $_SESSION[$sessionName.'_attempt'] = $attempt;
378 378
 
379 379
         // Failure on too many attempts
380 380
         if (!empty($maxAttempts) && $attempt > $maxAttempts) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     {
411 411
         $code = ($code === null) ? $this->handler->getCode() : $code;
412 412
         if (!empty($code)) {
413
-            $_SESSION[$this->name . '_code'] = $code;
413
+            $_SESSION[$this->name.'_code'] = $code;
414 414
             return true;
415 415
         }
416 416
         return false;
Please login to merge, or discard this patch.
htdocs/class/captcha/xoopscaptchamethod.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,12 +75,13 @@
 block discarded – undo
75 75
      */
76 76
     public function loadConfig($name = '')
77 77
     {
78
-        if (!is_object($this->handler))
79
-            $this->config = array();
80
-        else
81
-            $this->config = empty($name)
78
+        if (!is_object($this->handler)) {
79
+                    $this->config = array();
80
+        } else {
81
+                    $this->config = empty($name)
82 82
                 ? $this->handler->config
83 83
                 : array_merge($this->handler->config, $this->handler->loadConfig($name));
84
+        }
84 85
     }
85 86
 
86 87
     /**
Please login to merge, or discard this patch.
htdocs/class/captcha/recaptcha/recaptchalib.php 2 patches
Indentation   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -105,7 +105,6 @@  discard block
 block discarded – undo
105 105
  * @param string $pubkey A public key for reCAPTCHA
106 106
  * @param string $error The error given by reCAPTCHA (optional, default is null)
107 107
  * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
108
-
109 108
  * @return string - The HTML to be embedded in the user's form.
110 109
  */
111 110
 function recaptcha_get_html($pubkey, $error = null, $use_ssl = false)
@@ -172,13 +171,13 @@  discard block
 block discarded – undo
172 171
     }
173 172
 
174 173
     $response = _recaptcha_http_post(RECAPTCHA_VERIFY_SERVER,
175
-		"/recaptcha/api/verify",
176
-		array(
177
-			   'privatekey' => $privkey,
178
-			   'remoteip' => $remoteip,
179
-			   'challenge' => $challenge,
180
-			   'response' => $response
181
-		   ) + $extra_params);
174
+        "/recaptcha/api/verify",
175
+        array(
176
+                'privatekey' => $privkey,
177
+                'remoteip' => $remoteip,
178
+                'challenge' => $challenge,
179
+                'response' => $response
180
+            ) + $extra_params);
182 181
 
183 182
     $answers = explode("\n", $response [1]);
184 183
     $recaptcha_response = new ReCaptchaResponse();
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 {
51 51
     $req = "";
52 52
     foreach ($data as $key => $value) {
53
-        $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
53
+        $req .= $key.'='.urlencode(stripslashes($value)).'&';
54 54
     }
55 55
 
56 56
     // Cut the last '&'
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     $http_request = "POST $path HTTP/1.0\r\n";
77 77
     $http_request .= "Host: $host\r\n";
78 78
     $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
79
-    $http_request .= "Content-Length: " . strlen($req) . "\r\n";
79
+    $http_request .= "Content-Length: ".strlen($req)."\r\n";
80 80
     $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
81 81
     $http_request .= "\r\n";
82 82
     $http_request .= $req;
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
 
123 123
     $errorpart = "";
124 124
     if ($error) {
125
-        $errorpart = "&error=" . $error;
125
+        $errorpart = "&error=".$error;
126 126
     }
127
-    return '<script type="text/javascript" src="' . $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
127
+    return '<script type="text/javascript" src="'.$server.'/challenge?k='.$pubkey.$errorpart.'"></script>
128 128
 
129 129
     <noscript>
130
-        <iframe src="' . $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
130
+        <iframe src="' . $server.'/noscript?k='.$pubkey.$errorpart.'" height="300" width="500" frameborder="0"></iframe><br/>
131 131
         <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
132 132
         <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
133 133
     </noscript>';
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
  */
204 204
 function recaptcha_get_signup_url($domain = null, $appname = null)
205 205
 {
206
-    return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode(
206
+    return "https://www.google.com/recaptcha/admin/create?"._recaptcha_qsencode(
207 207
         array('domains' => $domain, 'app' => $appname));
208 208
 }
209 209
 
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 function recaptcha_mailhide_url($pubkey, $privkey, $email)
257 257
 {
258 258
     if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
259
-        die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
259
+        die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, "."you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
260 260
     }
261 261
 
262 262
     $ky = pack('H*', $privkey);
263 263
     $cryptmail = _recaptcha_aes_encrypt($email, $ky);
264 264
 
265
-    return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64($cryptmail);
265
+    return "http://www.google.com/recaptcha/mailhide/d?k=".$pubkey."&c="._recaptcha_mailhide_urlbase64($cryptmail);
266 266
 }
267 267
 
268 268
 /**
@@ -305,5 +305,5 @@  discard block
 block discarded – undo
305 305
     $emailparts = _recaptcha_mailhide_email_parts($email);
306 306
     $url = recaptcha_mailhide_url($pubkey, $privkey, $email);
307 307
 
308
-    return htmlentities($emailparts[0]) . "<a href='" . htmlentities($url) . "' onclick=\"window.open('" . htmlentities($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities($emailparts [1]);
308
+    return htmlentities($emailparts[0])."<a href='".htmlentities($url)."' onclick=\"window.open('".htmlentities($url)."', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@".htmlentities($emailparts [1]);
309 309
 }
Please login to merge, or discard this patch.
htdocs/class/captcha/image.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function render()
65 65
     {
66
-		$xoops_url = \XoopsBaseConfig::get('url');
66
+        $xoops_url = \XoopsBaseConfig::get('url');
67 67
         $js = "<script type='text/javascript'>
68 68
                 function xoops_captcha_refresh(imgId)
69 69
                 {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function loadImage()
90 90
     {
91
-		$xoops_url = \XoopsBaseConfig::get('url');
91
+        $xoops_url = \XoopsBaseConfig::get('url');
92 92
         return '<img id="' . ($this->config["name"]) . '" src="' . $xoops_url . '/class/captcha/image/scripts/image.php" onclick=\'this.src="' . $xoops_url . '/class/captcha/image/scripts/image.php?refresh="+Math.random()' . '\' style="cursor: pointer; vertical-align: middle;" alt="" />';
93 93
     }
94 94
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
             return false;
41 41
         } else {
42 42
             $required_functions = array(
43
-                'imagecreatetruecolor' ,
44
-                'imagecolorallocate' ,
45
-                'imagefilledrectangle' ,
46
-                'imagejpeg' ,
47
-                'imagedestroy' ,
43
+                'imagecreatetruecolor',
44
+                'imagecolorallocate',
45
+                'imagefilledrectangle',
46
+                'imagejpeg',
47
+                'imagedestroy',
48 48
                 'imageftbbox');
49 49
             foreach ($required_functions as $func) {
50 50
                 if (!function_exists($func)) {
51
-                    trigger_error('Function ' . $func . ' is not defined', E_USER_WARNING);
51
+                    trigger_error('Function '.$func.' is not defined', E_USER_WARNING);
52 52
                     return false;
53 53
                 }
54 54
             }
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
         $js = "<script type='text/javascript'>
68 68
                 function xoops_captcha_refresh(imgId)
69 69
                 {
70
-                    xoopsGetElementById(imgId).src = '" . $xoops_url . "/class/captcha/image/scripts/image.php?refresh='+Math.random();
70
+                    xoopsGetElementById(imgId).src = '" . $xoops_url."/class/captcha/image/scripts/image.php?refresh='+Math.random();
71 71
                 }
72 72
                 </script>";
73 73
         $image = $this->loadImage();
74
-        $image .= "<br /><a href=\"javascript: xoops_captcha_refresh('" . ($this->config['name']) . "')\">" . XoopsLocale::CLICK_TO_REFRESH_IMAGE_IF_NOT_CLEAR . "</a>";
75
-        $input = '<input type="text" name="' . $this->config['name'] . '" id="' . $this->config['name'] . '" size="' . $this->config['num_chars'] . '" maxlength="' . $this->config['num_chars'] . '" value="" required>';
74
+        $image .= "<br /><a href=\"javascript: xoops_captcha_refresh('".($this->config['name'])."')\">".XoopsLocale::CLICK_TO_REFRESH_IMAGE_IF_NOT_CLEAR."</a>";
75
+        $input = '<input type="text" name="'.$this->config['name'].'" id="'.$this->config['name'].'" size="'.$this->config['num_chars'].'" maxlength="'.$this->config['num_chars'].'" value="" required>';
76 76
         $rule = XoopsLocale::INPUT_LETTERS_IN_THE_IMAGE;
77
-        $rule .= '<br />' . (empty($this->config['casesensitive']) ? XoopsLocale::CODE_IS_CASE_INSENSITIVE : XoopsLocale::CODE_IS_CASE_SENSITIVE);
77
+        $rule .= '<br />'.(empty($this->config['casesensitive']) ? XoopsLocale::CODE_IS_CASE_INSENSITIVE : XoopsLocale::CODE_IS_CASE_SENSITIVE);
78 78
         if (!empty($this->config['maxattempts'])) {
79
-            $rule .= '<br />' . sprintf(XoopsLocale::F_MAXIMUM_ATTEMPTS, $this->config['maxattempts']);
79
+            $rule .= '<br />'.sprintf(XoopsLocale::F_MAXIMUM_ATTEMPTS, $this->config['maxattempts']);
80 80
         }
81
-        return $js . $image . '<br /><br />' . $input . '<br />' . $rule;
81
+        return $js.$image.'<br /><br />'.$input.'<br />'.$rule;
82 82
     }
83 83
 
84 84
     /**
@@ -89,6 +89,6 @@  discard block
 block discarded – undo
89 89
     public function loadImage()
90 90
     {
91 91
 		$xoops_url = \XoopsBaseConfig::get('url');
92
-        return '<img id="' . ($this->config["name"]) . '" src="' . $xoops_url . '/class/captcha/image/scripts/image.php" onclick=\'this.src="' . $xoops_url . '/class/captcha/image/scripts/image.php?refresh="+Math.random()' . '\' style="cursor: pointer; vertical-align: middle;" alt="" />';
92
+        return '<img id="'.($this->config["name"]).'" src="'.$xoops_url.'/class/captcha/image/scripts/image.php" onclick=\'this.src="'.$xoops_url.'/class/captcha/image/scripts/image.php?refresh="+Math.random()'.'\' style="cursor: pointer; vertical-align: middle;" alt="" />';
93 93
     }
94 94
 }
Please login to merge, or discard this patch.
htdocs/class/captcha/recaptcha.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         include_once __DIR__ . '/recaptcha/recaptchalib.php';
67 67
         if (!empty($_POST['recaptcha_response_field'])) {
68 68
             $resp = recaptcha_check_answer($this->config['private_key'], $_SERVER['REMOTE_ADDR'],
69
-				$_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
69
+                $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
70 70
             if (!$resp->is_valid) {
71 71
                 $this->handler->message[] = $resp->error;
72 72
             } else {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function render()
44 44
     {
45
-        include_once __DIR__ . '/recaptcha/recaptchalib.php';
45
+        include_once __DIR__.'/recaptcha/recaptchalib.php';
46 46
         $form = "<script type=\"text/javascript\">
47 47
             var RecaptchaOptions = {
48
-            theme : '" . (empty($this->config['theme']) ? '' : $this->config['theme']) . "',
49
-            lang : '" . (empty($this->config['lang']) ? '' : $this->config['lang']) . "'
48
+            theme : '" . (empty($this->config['theme']) ? '' : $this->config['theme'])."',
49
+            lang : '" . (empty($this->config['lang']) ? '' : $this->config['lang'])."'
50 50
             };
51 51
             </script>";
52 52
         $public_key = empty($this->config['public_key']) ? '' : $this->config['public_key'];
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function verify($sessionName = null)
64 64
     {
65 65
         $is_valid = false;
66
-        include_once __DIR__ . '/recaptcha/recaptchalib.php';
66
+        include_once __DIR__.'/recaptcha/recaptchalib.php';
67 67
         if (!empty($_POST['recaptcha_response_field'])) {
68 68
             $resp = recaptcha_check_answer($this->config['private_key'], $_SERVER['REMOTE_ADDR'],
69 69
 				$_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
Please login to merge, or discard this patch.
htdocs/class/captcha/text.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
     public function render()
34 34
     {
35 35
         $form = $this->loadText() . '&nbsp;&nbsp; <input type="text" name="' . $this->config['name']
36
-			. '" id="' . $this->config['name'] . '" size="' . $this->config['num_chars']
37
-			. '" maxlength="' . $this->config['num_chars'] . '" value="" />';
36
+            . '" id="' . $this->config['name'] . '" size="' . $this->config['num_chars']
37
+            . '" maxlength="' . $this->config['num_chars'] . '" value="" />';
38 38
         $form .= '<br />' . XoopsLocale::INPUT_RESULT_FROM_EXPRESSION;
39 39
         if (!empty($this->config['maxattempts'])) {
40 40
             $form .= '<br />' . sprintf(XoopsLocale::F_MAXIMUM_ATTEMPTS, $this->config['maxattempts']);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function render()
34 34
     {
35
-        $form = $this->loadText() . '&nbsp;&nbsp; <input type="text" name="' . $this->config['name']
36
-			. '" id="' . $this->config['name'] . '" size="' . $this->config['num_chars']
37
-			. '" maxlength="' . $this->config['num_chars'] . '" value="" />';
38
-        $form .= '<br />' . XoopsLocale::INPUT_RESULT_FROM_EXPRESSION;
35
+        $form = $this->loadText().'&nbsp;&nbsp; <input type="text" name="'.$this->config['name']
36
+			. '" id="'.$this->config['name'].'" size="'.$this->config['num_chars']
37
+			. '" maxlength="'.$this->config['num_chars'].'" value="" />';
38
+        $form .= '<br />'.XoopsLocale::INPUT_RESULT_FROM_EXPRESSION;
39 39
         if (!empty($this->config['maxattempts'])) {
40
-            $form .= '<br />' . sprintf(XoopsLocale::F_MAXIMUM_ATTEMPTS, $this->config['maxattempts']);
40
+            $form .= '<br />'.sprintf(XoopsLocale::F_MAXIMUM_ATTEMPTS, $this->config['maxattempts']);
41 41
         }
42 42
         return $form;
43 43
     }
@@ -58,6 +58,6 @@  discard block
 block discarded – undo
58 58
             $expression = "{$val_a} + {$val_b} = ?";
59 59
             $this->code = $val_a + $val_b;
60 60
         }
61
-        return '<span style="font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;">' . $expression . '</span>';
61
+        return '<span style="font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;">'.$expression.'</span>';
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
htdocs/class/captcha/image/scripts/imageclass.php 2 patches
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -297,15 +297,15 @@
 block discarded – undo
297 297
         if ($RandImage = $this->loadBackground()) {
298 298
             $ImageType = @getimagesize($RandImage);
299 299
             switch (@$ImageType[2]) {
300
-            case 1:
301
-                $BackgroundImage = imagecreatefromgif($RandImage);
302
-                break;
303
-            case 2:
304
-                $BackgroundImage = imagecreatefromjpeg($RandImage);
305
-                break;
306
-            case 3:
307
-                $BackgroundImage = imagecreatefrompng($RandImage);
308
-                break;
300
+                case 1:
301
+                    $BackgroundImage = imagecreatefromgif($RandImage);
302
+                    break;
303
+                case 2:
304
+                    $BackgroundImage = imagecreatefromjpeg($RandImage);
305
+                    break;
306
+                case 3:
307
+                    $BackgroundImage = imagecreatefrompng($RandImage);
308
+                    break;
309 309
             }
310 310
         }
311 311
         if (isset($BackgroundImage) && !empty($BackgroundImage)) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         if ($this->invalid) {
142 142
             header("Content-type: image/gif");
143
-            readfile($this->xoops_root_path . "/images/subject/icon2.gif");
143
+            readfile($this->xoops_root_path."/images/subject/icon2.gif");
144 144
             return false;
145 145
         }
146 146
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             return $items;
166 166
         }
167 167
         ;
168
-        $file_path = $this->xoops_root_path . "/class/captcha/image/{$name}";
168
+        $file_path = $this->xoops_root_path."/class/captcha/image/{$name}";
169 169
         $files = \Xoops\Core\Lists\File::getList($file_path);
170 170
         foreach ($files as $item) {
171 171
             if (empty($extension) || preg_match("/(\.{$extension})$/i", $item)) {
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     public function loadFont()
237 237
     {
238 238
         $fonts = $this->getList("fonts", "ttf");
239
-        $this->font = $this->xoops_root_path . "/class/captcha/image/fonts/" . $fonts[array_rand($fonts)];
239
+        $this->font = $this->xoops_root_path."/class/captcha/image/fonts/".$fonts[array_rand($fonts)];
240 240
     }
241 241
 
242 242
     /**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     {
283 283
         $RandBackground = null;
284 284
         if ($backgrounds = $this->getList("backgrounds", "(gif|jpg|png)")) {
285
-            $RandBackground = $this->xoops_root_path . "/class/captcha/image/backgrounds/" . $backgrounds[array_rand($backgrounds)];
285
+            $RandBackground = $this->xoops_root_path."/class/captcha/image/backgrounds/".$backgrounds[array_rand($backgrounds)];
286 286
         }
287 287
         return $RandBackground;
288 288
     }
Please login to merge, or discard this patch.
htdocs/class/captcha/image/scripts/image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
  * @since     2.6.0
25 25
  */
26 26
 
27
-require dirname(dirname(dirname(dirname(__DIR__)))) . '/mainfile.php';
27
+require dirname(dirname(dirname(dirname(__DIR__)))).'/mainfile.php';
28 28
 
29 29
 require_once 'imageclass.php';
30 30
 
Please login to merge, or discard this patch.