@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $this->attr = $attr; |
27 | 27 | if (!isset($this->css[$attr])) { |
28 | - trigger_error(htmlspecialchars($attr) . ' is not valid space attribute'); |
|
28 | + trigger_error(htmlspecialchars($attr).' is not valid space attribute'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | */ |
69 | 69 | public static function makeFromSerial() |
70 | 70 | { |
71 | - $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'); |
|
71 | + $contents = file_get_contents(HTMLPURIFIER_PREFIX.'/HTMLPurifier/ConfigSchema/schema.ser'); |
|
72 | 72 | $r = unserialize($contents); |
73 | 73 | if (!$r) { |
74 | 74 | $hash = sha1($contents); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected function scriptCallback($matches) |
32 | 32 | { |
33 | - return $matches[1] . htmlspecialchars($matches[2], ENT_COMPAT, 'UTF-8') . $matches[3]; |
|
33 | + return $matches[1].htmlspecialchars($matches[2], ENT_COMPAT, 'UTF-8').$matches[3]; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | $e = false; |
87 | 87 | if ($config->get('Core.CollectErrors')) { |
88 | - $e =& $context->get('ErrorCollector'); |
|
88 | + $e = & $context->get('ErrorCollector'); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // for testing synchronization |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($maintain_line_numbers) { |
100 | 100 | // $rcursor, however, is always at the start of a token. |
101 | - $rcursor = $cursor - (int)$inside_tag; |
|
101 | + $rcursor = $cursor - (int) $inside_tag; |
|
102 | 102 | |
103 | 103 | // Column number is cheap, so we calculate it every round. |
104 | 104 | // We're interested at the *end* of the newline string, so |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | $token = new |
325 | 325 | HTMLPurifier_Token_Text( |
326 | - '<' . |
|
326 | + '<'. |
|
327 | 327 | $this->parseData( |
328 | 328 | substr($html, $cursor) |
329 | 329 | ) |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | public function parseAttributeString($string, $config, $context) |
377 | 377 | { |
378 | - $string = (string)$string; // quick typecast |
|
378 | + $string = (string) $string; // quick typecast |
|
379 | 379 | |
380 | 380 | if ($string == '') { |
381 | 381 | return array(); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | $e = false; |
385 | 385 | if ($config->get('Core.CollectErrors')) { |
386 | - $e =& $context->get('ErrorCollector'); |
|
386 | + $e = & $context->get('ErrorCollector'); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | // let's see if we can abort as quickly as possible |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $key_begin = $cursor; //we're currently at the start of the key |
455 | 455 | |
456 | 456 | // scroll past all characters that are the key (not whitespace or =) |
457 | - $cursor += strcspn($string, $this->_whitespace . '=', $cursor); |
|
457 | + $cursor += strcspn($string, $this->_whitespace.'=', $cursor); |
|
458 | 458 | |
459 | 459 | $key_end = $cursor; // now at the end of the key |
460 | 460 |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function callbackUndoCommentSubst($matches) |
233 | 233 | { |
234 | - return '<!--' . strtr($matches[1], array('&' => '&', '<' => '<')) . $matches[2]; |
|
234 | + return '<!--'.strtr($matches[1], array('&' => '&', '<' => '<')).$matches[2]; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function callbackArmorCommentEntities($matches) |
244 | 244 | { |
245 | - return '<!--' . str_replace('&', '&', $matches[1]) . $matches[2]; |
|
245 | + return '<!--'.str_replace('&', '&', $matches[1]).$matches[2]; |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | if (!empty($def->doctype->dtdPublic) || !empty($def->doctype->dtdSystem)) { |
261 | 261 | $ret .= '<!DOCTYPE html '; |
262 | 262 | if (!empty($def->doctype->dtdPublic)) { |
263 | - $ret .= 'PUBLIC "' . $def->doctype->dtdPublic . '" '; |
|
263 | + $ret .= 'PUBLIC "'.$def->doctype->dtdPublic.'" '; |
|
264 | 264 | } |
265 | 265 | if (!empty($def->doctype->dtdSystem)) { |
266 | - $ret .= '"' . $def->doctype->dtdSystem . '" '; |
|
266 | + $ret .= '"'.$def->doctype->dtdSystem.'" '; |
|
267 | 267 | } |
268 | 268 | $ret .= '>'; |
269 | 269 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $ret .= '<html><head>'; |
272 | 272 | $ret .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'; |
273 | 273 | // No protection if $html contains a stray </div>! |
274 | - $ret .= '</head><body>' . $html . '</body></html>'; |
|
274 | + $ret .= '</head><body>'.$html.'</body></html>'; |
|
275 | 275 | return $ret; |
276 | 276 | } |
277 | 277 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $this->state = 'data'; |
470 | 470 | |
471 | 471 | while ($this->state !== null) { |
472 | - $this->{$this->state . 'State'}(); |
|
472 | + $this->{$this->state.'State'}(); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | private function characters($char_class, $start) |
500 | 500 | { |
501 | - return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); |
|
501 | + return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | private function dataState() |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | } else { |
1290 | 1290 | /* Append a U+002D HYPHEN-MINUS (-) character and the input |
1291 | 1291 | character to the comment token's data. Switch to the comment state. */ |
1292 | - $this->token['data'] .= '-' . $char; |
|
1292 | + $this->token['data'] .= '-'.$char; |
|
1293 | 1293 | $this->state = 'comment'; |
1294 | 1294 | } |
1295 | 1295 | } |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | $this->state = 'data'; |
1314 | 1314 | |
1315 | 1315 | } else { |
1316 | - $this->token['data'] .= '--' . $char; |
|
1316 | + $this->token['data'] .= '--'.$char; |
|
1317 | 1317 | $this->state = 'comment'; |
1318 | 1318 | } |
1319 | 1319 | } |
@@ -1547,7 +1547,7 @@ discard block |
||
1547 | 1547 | |
1548 | 1548 | // Return a character token for the character corresponding to the |
1549 | 1549 | // entity name (as given by the second column of the entities table). |
1550 | - return html_entity_decode('&' . $entity . ';', ENT_QUOTES, 'UTF-8'); |
|
1550 | + return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); |
|
1551 | 1551 | } |
1552 | 1552 | |
1553 | 1553 | private function emitToken($token) |
@@ -2656,7 +2656,7 @@ discard block |
||
2656 | 2656 | |
2657 | 2657 | /* Act as if a stream of character tokens had been seen. */ |
2658 | 2658 | $this->insertText( |
2659 | - 'This is a searchable index. ' . |
|
2659 | + 'This is a searchable index. '. |
|
2660 | 2660 | 'Insert your search keywords here: ' |
2661 | 2661 | ); |
2662 | 2662 | |
@@ -2678,7 +2678,7 @@ discard block |
||
2678 | 2678 | /* Act as if a stream of character tokens had been seen |
2679 | 2679 | (see below for what they should say). */ |
2680 | 2680 | $this->insertText( |
2681 | - 'This is a searchable index. ' . |
|
2681 | + 'This is a searchable index. '. |
|
2682 | 2682 | 'Insert your search keywords here: ' |
2683 | 2683 | ); |
2684 | 2684 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | if (is_string($content_model)) { |
90 | 90 | // Assume that $this->keys is alphanumeric |
91 | 91 | $def->content_model = preg_replace_callback( |
92 | - '/\b(' . implode('|', $this->keys) . ')\b/', |
|
92 | + '/\b('.implode('|', $this->keys).')\b/', |
|
93 | 93 | array($this, 'generateChildDefCallback'), |
94 | 94 | $content_model |
95 | 95 | ); |
@@ -104,9 +104,9 @@ |
||
104 | 104 | if ($result !== false) { |
105 | 105 | return $result; |
106 | 106 | } |
107 | - $this->currentNesting =& $context->get('CurrentNesting'); |
|
108 | - $this->currentToken =& $context->get('CurrentToken'); |
|
109 | - $this->inputZipper =& $context->get('InputZipper'); |
|
107 | + $this->currentNesting = & $context->get('CurrentNesting'); |
|
108 | + $this->currentToken = & $context->get('CurrentToken'); |
|
109 | + $this->inputZipper = & $context->get('InputZipper'); |
|
110 | 110 | return false; |
111 | 111 | } |
112 | 112 |
@@ -18,17 +18,17 @@ |
||
18 | 18 | public function validateToken($token, $config, $context) |
19 | 19 | { |
20 | 20 | $definition = $config->getHTMLDefinition(); |
21 | - $e =& $context->get('ErrorCollector', true); |
|
21 | + $e = & $context->get('ErrorCollector', true); |
|
22 | 22 | |
23 | 23 | // initialize IDAccumulator if necessary |
24 | - $ok =& $context->get('IDAccumulator', true); |
|
24 | + $ok = & $context->get('IDAccumulator', true); |
|
25 | 25 | if (!$ok) { |
26 | 26 | $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); |
27 | 27 | $context->register('IDAccumulator', $id_accumulator); |
28 | 28 | } |
29 | 29 | |
30 | 30 | // initialize CurrentToken if necessary |
31 | - $current_token =& $context->get('CurrentToken', true); |
|
31 | + $current_token = & $context->get('CurrentToken', true); |
|
32 | 32 | if (!$current_token) { |
33 | 33 | $context->register('CurrentToken', $token); |
34 | 34 | } |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function generateKey($config) |
33 | 33 | { |
34 | - return $config->version . ',' . // possibly replace with function calls |
|
35 | - $config->getBatchSerial($this->type) . ',' . |
|
36 | - $config->get($this->type . '.DefinitionRev'); |
|
34 | + return $config->version.','.// possibly replace with function calls |
|
35 | + $config->getBatchSerial($this->type).','. |
|
36 | + $config->get($this->type.'.DefinitionRev'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | // versions match, ids match, check revision number |
58 | 58 | if ($hash == $config->getBatchSerial($this->type) && |
59 | - $revision < $config->get($this->type . '.DefinitionRev')) { |
|
59 | + $revision < $config->get($this->type.'.DefinitionRev')) { |
|
60 | 60 | return true; |
61 | 61 | } |
62 | 62 | return false; |