@@ -52,7 +52,7 @@ |
||
52 | 52 | break; |
53 | 53 | case 'integer': |
54 | 54 | case 'double': |
55 | - $out .= (string) $field->value->contents; |
|
55 | + $out .= (string)$field->value->contents; |
|
56 | 56 | break; |
57 | 57 | case 'null': |
58 | 58 | $out .= '<var>'.$ref.'null</var>'; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | - $header = $this->renderer->renderHeaderWrapper($o, (bool) strlen($children), $header); |
|
48 | + $header = $this->renderer->renderHeaderWrapper($o, (bool)strlen($children), $header); |
|
49 | 49 | |
50 | 50 | return '<dl>'.$header.$children.'</dl>'; |
51 | 51 | } |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | */ |
35 | 35 | class FilterInput |
36 | 36 | { |
37 | - protected $tagsArray; // default is empty array |
|
38 | - protected $attrArray; // default is empty array |
|
37 | + protected $tagsArray; // default is empty array |
|
38 | + protected $attrArray; // default is empty array |
|
39 | 39 | |
40 | - protected $tagsMethod; // default is 0 |
|
41 | - protected $attrMethod; // default is 0 |
|
40 | + protected $tagsMethod; // default is 0 |
|
41 | + protected $attrMethod; // default is 0 |
|
42 | 42 | |
43 | - protected $xssAuto; // default is 1 |
|
43 | + protected $xssAuto; // default is 1 |
|
44 | 44 | protected $tagBlacklist = array( |
45 | 45 | 'applet', |
46 | 46 | 'body', |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | $attrArray[$i] = strtolower($attrArray[$i]); |
95 | 95 | } |
96 | 96 | // assign to member vars |
97 | - $this->tagsArray = (array) $tagsArray; |
|
98 | - $this->attrArray = (array) $attrArray; |
|
97 | + $this->tagsArray = (array)$tagsArray; |
|
98 | + $this->attrArray = (array)$attrArray; |
|
99 | 99 | $this->tagsMethod = $tagsMethod; |
100 | 100 | $this->attrMethod = $attrMethod; |
101 | 101 | $this->xssAuto = $xssAuto; |
@@ -213,61 +213,61 @@ discard block |
||
213 | 213 | case 'INT': |
214 | 214 | case 'INTEGER': |
215 | 215 | // Only use the first integer value |
216 | - preg_match('/-?\d+/', (string) $source, $matches); |
|
217 | - $result = @ (int) $matches[0]; |
|
216 | + preg_match('/-?\d+/', (string)$source, $matches); |
|
217 | + $result = @ (int)$matches[0]; |
|
218 | 218 | break; |
219 | 219 | |
220 | 220 | case 'FLOAT': |
221 | 221 | case 'DOUBLE': |
222 | 222 | // Only use the first floating point value |
223 | - preg_match('/-?\d+(\.\d+)?/', (string) $source, $matches); |
|
224 | - $result = @ (float) $matches[0]; |
|
223 | + preg_match('/-?\d+(\.\d+)?/', (string)$source, $matches); |
|
224 | + $result = @ (float)$matches[0]; |
|
225 | 225 | break; |
226 | 226 | |
227 | 227 | case 'BOOL': |
228 | 228 | case 'BOOLEAN': |
229 | - $result = (bool) $source; |
|
229 | + $result = (bool)$source; |
|
230 | 230 | break; |
231 | 231 | |
232 | 232 | case 'WORD': |
233 | - $result = (string) preg_replace('/[^A-Z_]/i', '', $source); |
|
233 | + $result = (string)preg_replace('/[^A-Z_]/i', '', $source); |
|
234 | 234 | break; |
235 | 235 | |
236 | 236 | case 'ALPHANUM': |
237 | 237 | case 'ALNUM': |
238 | - $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source); |
|
238 | + $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source); |
|
239 | 239 | break; |
240 | 240 | |
241 | 241 | case 'CMD': |
242 | - $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source); |
|
242 | + $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source); |
|
243 | 243 | $result = strtolower($result); |
244 | 244 | break; |
245 | 245 | |
246 | 246 | case 'BASE64': |
247 | - $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source); |
|
247 | + $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source); |
|
248 | 248 | break; |
249 | 249 | |
250 | 250 | case 'STRING': |
251 | - $result = (string) $this->process($source); |
|
251 | + $result = (string)$this->process($source); |
|
252 | 252 | break; |
253 | 253 | |
254 | 254 | case 'ARRAY': |
255 | - $result = (array) $this->process($source); |
|
255 | + $result = (array)$this->process($source); |
|
256 | 256 | break; |
257 | 257 | |
258 | 258 | case 'PATH': |
259 | - $source = trim((string) $source); |
|
259 | + $source = trim((string)$source); |
|
260 | 260 | $pattern = '/^([-_\.\/A-Z0-9=&%?~]+)(.*)$/i'; |
261 | 261 | preg_match($pattern, $source, $matches); |
262 | - $result = @ (string) $matches[1]; |
|
262 | + $result = @ (string)$matches[1]; |
|
263 | 263 | break; |
264 | 264 | |
265 | 265 | case 'USERNAME': |
266 | - $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); |
|
266 | + $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); |
|
267 | 267 | break; |
268 | 268 | |
269 | 269 | case 'WEBURL': |
270 | - $result = (string) $this->process($source); |
|
270 | + $result = (string)$this->process($source); |
|
271 | 271 | // allow only relative, http or https |
272 | 272 | $urlparts = parse_url($result); |
273 | 273 | if (!empty($urlparts['scheme']) |
@@ -282,17 +282,17 @@ discard block |
||
282 | 282 | break; |
283 | 283 | |
284 | 284 | case 'EMAIL': |
285 | - $result = (string) $source; |
|
286 | - if (!filter_var((string) $source, FILTER_VALIDATE_EMAIL)) { |
|
285 | + $result = (string)$source; |
|
286 | + if (!filter_var((string)$source, FILTER_VALIDATE_EMAIL)) { |
|
287 | 287 | $result = ''; |
288 | 288 | } |
289 | 289 | break; |
290 | 290 | |
291 | 291 | case 'IP': |
292 | - $result = (string) $source; |
|
292 | + $result = (string)$source; |
|
293 | 293 | // this may be too restrictive. |
294 | 294 | // Should the FILTER_FLAG_NO_PRIV_RANGE flag be excluded? |
295 | - if (!filter_var((string) $source, FILTER_VALIDATE_IP)) { |
|
295 | + if (!filter_var((string)$source, FILTER_VALIDATE_IP)) { |
|
296 | 296 | $result = ''; |
297 | 297 | } |
298 | 298 | break; |
@@ -425,20 +425,20 @@ discard block |
||
425 | 425 | // reconstruct tag with allowed attributes |
426 | 426 | if (!$isCloseTag) { |
427 | 427 | $attrSet = $this->filterAttr($attrSet); |
428 | - $preTag .= '<' . $tagName; |
|
428 | + $preTag .= '<'.$tagName; |
|
429 | 429 | $attrSetCount = count($attrSet); |
430 | 430 | for ($i = 0; $i < $attrSetCount; ++$i) { |
431 | - $preTag .= ' ' . $attrSet[$i]; |
|
431 | + $preTag .= ' '.$attrSet[$i]; |
|
432 | 432 | } |
433 | 433 | // reformat single tags to XHTML |
434 | - if (strpos($fromTagOpen, "</" . $tagName)) { |
|
434 | + if (strpos($fromTagOpen, "</".$tagName)) { |
|
435 | 435 | $preTag .= '>'; |
436 | 436 | } else { |
437 | 437 | $preTag .= ' />'; |
438 | 438 | } |
439 | 439 | } else { |
440 | 440 | // just the tagname |
441 | - $preTag .= '</' . $tagName . '>'; |
|
441 | + $preTag .= '</'.$tagName.'>'; |
|
442 | 442 | } |
443 | 443 | } |
444 | 444 | // find next tag's start |
@@ -515,13 +515,13 @@ discard block |
||
515 | 515 | if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { |
516 | 516 | if ($attrSubSet[1]) { |
517 | 517 | // attr has value |
518 | - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; |
|
518 | + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[1].'"'; |
|
519 | 519 | } elseif ($attrSubSet[1] == "0") { |
520 | 520 | // attr has decimal zero as value |
521 | - $newSet[] = $attrSubSet[0] . '="0"'; |
|
521 | + $newSet[] = $attrSubSet[0].'="0"'; |
|
522 | 522 | } else { |
523 | 523 | // reformat single attributes to XHTML |
524 | - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"'; |
|
524 | + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[0].'"'; |
|
525 | 525 | } |
526 | 526 | } |
527 | 527 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | // convert decimal |
545 | 545 | $source = preg_replace_callback( |
546 | 546 | '/&#(\d+);/m', |
547 | - function ($matches) { |
|
547 | + function($matches) { |
|
548 | 548 | return chr($matches[1]); |
549 | 549 | }, |
550 | 550 | $source |
@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | // convert hex notation |
553 | 553 | $source = preg_replace_callback( |
554 | 554 | '/&#x([a-f0-9]+);/mi', |
555 | - function ($matches) { |
|
556 | - return chr('0x' . $matches[1]); |
|
555 | + function($matches) { |
|
556 | + return chr('0x'.$matches[1]); |
|
557 | 557 | }, |
558 | 558 | $source |
559 | 559 | ); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function __construct($ip) |
35 | 35 | { |
36 | - if (!filter_var((string) $ip, FILTER_VALIDATE_IP)) { |
|
36 | + if (!filter_var((string)$ip, FILTER_VALIDATE_IP)) { |
|
37 | 37 | $this->ip = false; |
38 | 38 | } else { |
39 | 39 | $this->ip = $this->normalize($ip); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $bits = ''; |
155 | 155 | for ($i = 0; $i < $length; $i++) { |
156 | 156 | $byte = decbin(ord($binaryIp[$i])); |
157 | - $bits .= substr("00000000" . $byte, -8); |
|
157 | + $bits .= substr("00000000".$byte, -8); |
|
158 | 158 | } |
159 | 159 | return $bits; |
160 | 160 | } |
@@ -112,8 +112,8 @@ |
||
112 | 112 | */ |
113 | 113 | public function create($payload, $expirationOffset = 0) |
114 | 114 | { |
115 | - if ((int) $expirationOffset > 0) { |
|
116 | - $payload['exp'] = time() + (int) $expirationOffset; |
|
115 | + if ((int)$expirationOffset > 0) { |
|
116 | + $payload['exp'] = time() + (int)$expirationOffset; |
|
117 | 117 | } |
118 | 118 | $value = JWT::encode($payload, $this->key->getSigning(), $this->algorithm); |
119 | 119 | return $value; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $tableau = array_filter($tableau, array(static::stopWordsObject(), 'check')); |
276 | 276 | $title = implode("-", $tableau); |
277 | 277 | |
278 | - $title = (empty($title)) ? '' : $title . $extension; |
|
278 | + $title = (empty($title)) ? '' : $title.$extension; |
|
279 | 279 | return $title; |
280 | 280 | } |
281 | 281 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | $start = empty($pos) ? 0 : min($pos); |
303 | 303 | |
304 | - $start = max($start - (int) ($length / 2), 0); |
|
304 | + $start = max($start - (int)($length / 2), 0); |
|
305 | 305 | |
306 | 306 | $pre = ($start > 0); // need an ellipsis in front? |
307 | 307 | if (function_exists('mb_strlen')) { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | } |
339 | 339 | } |
340 | - $haystack = ($pre ? static::ELLIPSIS : '') . trim($haystack) . ($post ? static::ELLIPSIS : ''); |
|
340 | + $haystack = ($pre ? static::ELLIPSIS : '').trim($haystack).($post ? static::ELLIPSIS : ''); |
|
341 | 341 | return $haystack; |
342 | 342 | } |
343 | 343 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | protected static function getNeedlePositions($haystack, $needles) |
375 | 375 | { |
376 | 376 | $pos = array(); |
377 | - $needles = empty($needles) ? array() : (array) $needles; |
|
377 | + $needles = empty($needles) ? array() : (array)$needles; |
|
378 | 378 | foreach ($needles as $needle) { |
379 | 379 | if (function_exists('mb_stripos')) { |
380 | 380 | $i = mb_stripos($haystack, $needle, 0, static::ENCODING); |
@@ -441,10 +441,10 @@ discard block |
||
441 | 441 | { |
442 | 442 | $search = array( |
443 | 443 | "'<script[^>]*?>.*?</script>'si", // Strip out javascript |
444 | - "'<img.*?/>'si", // Strip out img tags |
|
445 | - "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags |
|
446 | - "'([\r\n])[\s]+'", // Strip out white space |
|
447 | - "'&(quot|#34);'i", // Replace HTML entities |
|
444 | + "'<img.*?/>'si", // Strip out img tags |
|
445 | + "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags |
|
446 | + "'([\r\n])[\s]+'", // Strip out white space |
|
447 | + "'&(quot|#34);'i", // Replace HTML entities |
|
448 | 448 | "'&(amp|#38);'i", |
449 | 449 | "'&(lt|#60);'i", |
450 | 450 | "'&(gt|#62);'i", |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | |
476 | 476 | preg_replace_callback( |
477 | 477 | '/&#(\d+);/', |
478 | - function ($matches) { |
|
478 | + function($matches) { |
|
479 | 479 | return chr($matches[1]); |
480 | 480 | }, |
481 | 481 | $document |
@@ -56,8 +56,8 @@ |
||
56 | 56 | $language = 'english'; |
57 | 57 | } |
58 | 58 | } |
59 | - $path = XOOPS_ROOT_PATH . '/' . ((empty($domain) || 'global' === $domain) ? '' |
|
60 | - : "modules/{$domain}/") . 'language'; |
|
59 | + $path = XOOPS_ROOT_PATH.'/'.((empty($domain) || 'global' === $domain) ? '' |
|
60 | + : "modules/{$domain}/").'language'; |
|
61 | 61 | if (!$ret = static::loadFile("{$path}/{$language}/{$name}.php")) { |
62 | 62 | $ret = static::loadFile("{$path}/english/{$name}.php"); |
63 | 63 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | ini_set('xdebug.collect_params', $collect_params); |
88 | 88 | ini_set('xdebug.collect_return', $collect_return); |
89 | 89 | if ($tracefile == '') { |
90 | - $tracefile = XOOPS_VAR_PATH . '/logs/php_trace'; |
|
90 | + $tracefile = XOOPS_VAR_PATH.'/logs/php_trace'; |
|
91 | 91 | } |
92 | 92 | xdebug_start_trace($tracefile); |
93 | 93 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function init() |
41 | 41 | { |
42 | - $this->prefix = $this->module->getVar('dirname') . '_'; |
|
42 | + $this->prefix = $this->module->getVar('dirname').'_'; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | protected function prefix($name) |
53 | 53 | { |
54 | - $prefixedName = $this->prefix . $name; |
|
54 | + $prefixedName = $this->prefix.$name; |
|
55 | 55 | |
56 | 56 | return $prefixedName; |
57 | 57 | } |