@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | $e = false; |
57 | 57 | if ($config->get('Core.CollectErrors')) { |
58 | - $e =& $context->get('ErrorCollector'); |
|
58 | + $e = & $context->get('ErrorCollector'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | foreach ($tokens as $token) { |
@@ -82,10 +82,10 @@ |
||
82 | 82 | $stack = array(); |
83 | 83 | |
84 | 84 | // member variables |
85 | - $this->stack =& $stack; |
|
86 | - $this->tokens =& $tokens; |
|
87 | - $this->token =& $token; |
|
88 | - $this->zipper =& $zipper; |
|
85 | + $this->stack = & $stack; |
|
86 | + $this->tokens = & $tokens; |
|
87 | + $this->token = & $token; |
|
88 | + $this->zipper = & $zipper; |
|
89 | 89 | $this->config = $config; |
90 | 90 | $this->context = $context; |
91 | 91 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | continue; |
28 | 28 | } |
29 | 29 | $node = $token->toNode(); |
30 | - $stack[count($stack)-1]->children[] = $node; |
|
30 | + $stack[count($stack) - 1]->children[] = $node; |
|
31 | 31 | if ($token instanceof HTMLPurifier_Token_Start) { |
32 | 32 | $stack[] = $node; |
33 | 33 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function setup() |
76 | 76 | { |
77 | 77 | $this->validator = new HTMLPurifier_AttrDef_Lang(); |
78 | - $this->dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier'; |
|
78 | + $this->dir = HTMLPURIFIER_PREFIX.'/HTMLPurifier'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | if ($code == 'en') { |
108 | 108 | $lang = new HTMLPurifier_Language($config, $context); |
109 | 109 | } else { |
110 | - $class = 'HTMLPurifier_Language_' . $pcode; |
|
111 | - $file = $this->dir . '/Language/classes/' . $code . '.php'; |
|
110 | + $class = 'HTMLPurifier_Language_'.$pcode; |
|
111 | + $file = $this->dir.'/Language/classes/'.$code.'.php'; |
|
112 | 112 | if (file_exists($file) || class_exists($class, false)) { |
113 | 113 | $lang = new $class($config, $context); |
114 | 114 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | // generate filename |
156 | - $filename = $this->dir . '/Language/messages/' . $code . '.php'; |
|
156 | + $filename = $this->dir.'/Language/messages/'.$code.'.php'; |
|
157 | 157 | |
158 | 158 | // default fallback : may be overwritten by the ensuing include |
159 | 159 | $fallback = ($code != 'en') ? 'en' : false; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // load primary localisation |
162 | 162 | if (!file_exists($filename)) { |
163 | 163 | // skip the include: will rely solely on fallback |
164 | - $filename = $this->dir . '/Language/messages/en.php'; |
|
164 | + $filename = $this->dir.'/Language/messages/en.php'; |
|
165 | 165 | $cache = array(); |
166 | 166 | } else { |
167 | 167 | include $filename; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | // infinite recursion guard |
175 | 175 | if (isset($languages_seen[$code])) { |
176 | 176 | trigger_error( |
177 | - 'Circular fallback reference in language ' . |
|
177 | + 'Circular fallback reference in language '. |
|
178 | 178 | $code, |
179 | 179 | E_USER_ERROR |
180 | 180 | ); |
@@ -31,11 +31,11 @@ |
||
31 | 31 | // Note that ["<>] are an addition to the RFC's recommended |
32 | 32 | // characters, because they represent external delimeters. |
33 | 33 | $r_URI = '!'. |
34 | - '(([a-zA-Z0-9\.\+\-]+):)?'. // 2. Scheme |
|
35 | - '(//([^/?#"<>]*))?'. // 4. Authority |
|
36 | - '([^?#"<>]*)'. // 5. Path |
|
37 | - '(\?([^#"<>]*))?'. // 7. Query |
|
38 | - '(#([^"<>]*))?'. // 8. Fragment |
|
34 | + '(([a-zA-Z0-9\.\+\-]+):)?'.// 2. Scheme |
|
35 | + '(//([^/?#"<>]*))?'.// 4. Authority |
|
36 | + '([^?#"<>]*)'.// 5. Path |
|
37 | + '(\?([^#"<>]*))?'.// 7. Query |
|
38 | + '(#([^"<>]*))?'.// 8. Fragment |
|
39 | 39 | '!'; |
40 | 40 | |
41 | 41 | $matches = array(); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $uri->port = null; |
114 | 114 | $uri->fragment = null; |
115 | 115 | $uri->query = null; |
116 | - $uri->path = "$content_type;base64," . base64_encode($raw_data); |
|
116 | + $uri->path = "$content_type;base64,".base64_encode($raw_data); |
|
117 | 117 | return true; |
118 | 118 | } |
119 | 119 |
@@ -41,12 +41,12 @@ |
||
41 | 41 | list($key, $typecode) = explode('=', $type, 2); |
42 | 42 | if ($key !== 'type') { |
43 | 43 | // invalid key, tack it back on encoded |
44 | - $uri->path .= '%3B' . $type; |
|
44 | + $uri->path .= '%3B'.$type; |
|
45 | 45 | } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') { |
46 | 46 | $type_ret = ";type=$typecode"; |
47 | 47 | } |
48 | 48 | } else { |
49 | - $uri->path .= '%3B' . $type; |
|
49 | + $uri->path .= '%3B'.$type; |
|
50 | 50 | } |
51 | 51 | $uri->path = str_replace(';', '%3B', $uri->path); |
52 | 52 | $uri->path .= $type_ret; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $mState = 0; |
274 | 274 | $mUcs4 = 0; |
275 | 275 | $mBytes = 1; |
276 | - $char =''; |
|
276 | + $char = ''; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | public static function unichr($code) |
310 | 310 | { |
311 | 311 | if ($code > 1114111 or $code < 0 or |
312 | - ($code >= 55296 and $code <= 57343) ) { |
|
312 | + ($code >= 55296 and $code <= 57343)) { |
|
313 | 313 | // bits are set outside the "valid" range as defined |
314 | 314 | // by UNICODE 4.1.0 |
315 | 315 | return ''; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $z = (($code >> 12) & 15) | 224; |
331 | 331 | } else { |
332 | 332 | $z = (($code >> 12) & 63) | 128; |
333 | - $w = (($code >> 18) & 7) | 240; |
|
333 | + $w = (($code >> 18) & 7) | 240; |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); |
385 | 385 | if ($str === false) { |
386 | 386 | // $encoding is not a valid encoding |
387 | - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); |
|
387 | + trigger_error('Invalid encoding '.$encoding, E_USER_ERROR); |
|
388 | 388 | return ''; |
389 | 389 | } |
390 | 390 | // If the string is bjorked by Shift_JIS or a similar encoding |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); |
402 | 402 | } else { |
403 | 403 | trigger_error( |
404 | - 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . |
|
404 | + 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 '. |
|
405 | 405 | 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', |
406 | 406 | E_USER_ERROR |
407 | 407 | ); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | } |
443 | 443 | $str = strtr($str, array_flip($ascii_fix)); |
444 | 444 | // Normal stuff |
445 | - $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); |
|
445 | + $str = self::iconv('utf-8', $encoding.'//IGNORE', $str); |
|
446 | 446 | return $str; |
447 | 447 | } elseif ($encoding === 'iso-8859-1') { |
448 | 448 | $str = utf8_decode($str); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $working += ($bytevalue & 0x3F); |
488 | 488 | $bytesleft--; |
489 | 489 | if ($bytesleft <= 0) { |
490 | - $result .= "&#" . $working . ";"; |
|
490 | + $result .= "&#".$working.";"; |
|
491 | 491 | } |
492 | 492 | } elseif ($bytevalue <= 0xDF) { //110x xxxx |
493 | 493 | $working = $bytevalue & 0x1F; |
@@ -533,14 +533,14 @@ discard block |
||
533 | 533 | static $code = null; |
534 | 534 | if ($code === null) { |
535 | 535 | // better not use iconv, otherwise infinite loop! |
536 | - $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); |
|
536 | + $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1".str_repeat('a', 9000)); |
|
537 | 537 | if ($r === false) { |
538 | 538 | $code = self::ICONV_UNUSABLE; |
539 | 539 | } elseif (($c = strlen($r)) < 9000) { |
540 | 540 | $code = self::ICONV_TRUNCATES; |
541 | 541 | } elseif ($c > 9000) { |
542 | 542 | trigger_error( |
543 | - 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . |
|
543 | + 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: '. |
|
544 | 544 | 'include your iconv version as per phpversion()', |
545 | 545 | E_USER_ERROR |
546 | 546 | ); |
@@ -31,17 +31,17 @@ discard block |
||
31 | 31 | return $var; |
32 | 32 | case self::INT: |
33 | 33 | if (is_string($var) && ctype_digit($var)) { |
34 | - $var = (int)$var; |
|
34 | + $var = (int) $var; |
|
35 | 35 | } |
36 | 36 | return $var; |
37 | 37 | case self::FLOAT: |
38 | 38 | if ((is_string($var) && is_numeric($var)) || is_int($var)) { |
39 | - $var = (float)$var; |
|
39 | + $var = (float) $var; |
|
40 | 40 | } |
41 | 41 | return $var; |
42 | 42 | case self::BOOL: |
43 | 43 | if (is_int($var) && ($var === 0 || $var === 1)) { |
44 | - $var = (bool)$var; |
|
44 | + $var = (bool) $var; |
|
45 | 45 | } elseif (is_string($var)) { |
46 | 46 | if ($var == 'on' || $var == 'true' || $var == '1') { |
47 | 47 | $var = true; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ($var as $key => $value) { |
112 | 112 | if ($value !== true) { |
113 | 113 | trigger_error( |
114 | - "Lookup array has non-true value at key '$key'; " . |
|
114 | + "Lookup array has non-true value at key '$key'; ". |
|
115 | 115 | "maybe your input array was not indexed numerically", |
116 | 116 | E_USER_WARNING |
117 | 117 | ); |