@@ -6,6 +6,6 @@ |
||
6 | 6 | * without any other side-effects. |
7 | 7 | */ |
8 | 8 | |
9 | -set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() ); |
|
9 | +set_include_path(dirname(__FILE__).PATH_SEPARATOR.get_include_path()); |
|
10 | 10 | |
11 | 11 | // vim: et sw=4 sts=4 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * Emulation layer for code that used kses(), substituting in HTML Purifier. |
6 | 6 | */ |
7 | 7 | |
8 | -require_once dirname(__FILE__) . '/HTMLPurifier.auto.php'; |
|
8 | +require_once dirname(__FILE__).'/HTMLPurifier.auto.php'; |
|
9 | 9 | |
10 | 10 | function kses($string, $allowed_html, $allowed_protocols = null) |
11 | 11 | { |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $doctype = $this->aliases[$doctype]; |
87 | 87 | } |
88 | 88 | if (!isset($this->doctypes[$doctype])) { |
89 | - trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); |
|
89 | + trigger_error('Doctype '.htmlspecialchars($doctype).' does not exist', E_USER_ERROR); |
|
90 | 90 | $anon = new HTMLPurifier_Doctype($doctype); |
91 | 91 | return $anon; |
92 | 92 | } |
@@ -101,7 +101,7 @@ |
||
101 | 101 | if (!$this->isValid()) { |
102 | 102 | return false; |
103 | 103 | } |
104 | - return $this->n . $this->unit; |
|
104 | + return $this->n.$this->unit; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -62,7 +62,7 @@ |
||
62 | 62 | if ($filter->always_load) { |
63 | 63 | $this->addFilter($filter, $config); |
64 | 64 | } else { |
65 | - $conf = $config->get('URI.' . $name); |
|
65 | + $conf = $config->get('URI.'.$name); |
|
66 | 66 | if ($conf !== false && $conf !== null) { |
67 | 67 | $this->addFilter($filter, $config); |
68 | 68 | } |
@@ -228,8 +228,7 @@ discard block |
||
228 | 228 | $this->info['width'] = |
229 | 229 | $this->info['height'] = |
230 | 230 | $max === null ? |
231 | - $trusted_wh : |
|
232 | - new HTMLPurifier_AttrDef_Switch( |
|
231 | + $trusted_wh : new HTMLPurifier_AttrDef_Switch( |
|
233 | 232 | 'img', |
234 | 233 | // For img tags: |
235 | 234 | new HTMLPurifier_AttrDef_CSS_Composite( |
@@ -442,7 +441,7 @@ discard block |
||
442 | 441 | protected function setupConfigStuff($config) |
443 | 442 | { |
444 | 443 | // setup allowed elements |
445 | - $support = "(for information on implementing this, see the " . |
|
444 | + $support = "(for information on implementing this, see the ". |
|
446 | 445 | "support forums) "; |
447 | 446 | $allowed_properties = $config->get('CSS.AllowedProperties'); |
448 | 447 | if ($allowed_properties !== null) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (!isset($this->def->info[$key])) { |
182 | 182 | // can't add % due to SimpleTest bug |
183 | 183 | $this->triggerError( |
184 | - 'Cannot retrieve value of undefined directive ' . htmlspecialchars($key), |
|
184 | + 'Cannot retrieve value of undefined directive '.htmlspecialchars($key), |
|
185 | 185 | E_USER_WARNING |
186 | 186 | ); |
187 | 187 | return; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if (isset($this->def->info[$key]->isAlias)) { |
190 | 190 | $d = $this->def->info[$key]; |
191 | 191 | $this->triggerError( |
192 | - 'Cannot get value from aliased directive, use real name ' . $d->key, |
|
192 | + 'Cannot get value from aliased directive, use real name '.$d->key, |
|
193 | 193 | E_USER_ERROR |
194 | 194 | ); |
195 | 195 | return; |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | list($ns) = explode('.', $key); |
199 | 199 | if ($ns !== $this->lock) { |
200 | 200 | $this->triggerError( |
201 | - 'Cannot get value of namespace ' . $ns . ' when lock for ' . |
|
202 | - $this->lock . |
|
203 | - ' is active, this probably indicates a Definition setup method ' . |
|
201 | + 'Cannot get value of namespace '.$ns.' when lock for '. |
|
202 | + $this->lock. |
|
203 | + ' is active, this probably indicates a Definition setup method '. |
|
204 | 204 | 'is accessing directives that are not within its namespace', |
205 | 205 | E_USER_ERROR |
206 | 206 | ); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $full = $this->getAll(); |
226 | 226 | if (!isset($full[$namespace])) { |
227 | 227 | $this->triggerError( |
228 | - 'Cannot retrieve undefined namespace ' . |
|
228 | + 'Cannot retrieve undefined namespace '. |
|
229 | 229 | htmlspecialchars($namespace), |
230 | 230 | E_USER_WARNING |
231 | 231 | ); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | if (!isset($this->def->info[$key])) { |
311 | 311 | $this->triggerError( |
312 | - 'Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', |
|
312 | + 'Cannot set undefined directive '.htmlspecialchars($key).' to value', |
|
313 | 313 | E_USER_WARNING |
314 | 314 | ); |
315 | 315 | return; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | if ($this->aliasMode) { |
321 | 321 | $this->triggerError( |
322 | 322 | 'Double-aliases not allowed, please fix '. |
323 | - 'ConfigSchema bug with' . $key, |
|
323 | + 'ConfigSchema bug with'.$key, |
|
324 | 324 | E_USER_ERROR |
325 | 325 | ); |
326 | 326 | return; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $value = $this->parser->parse($value, $type, $allow_null); |
348 | 348 | } catch (HTMLPurifier_VarParserException $e) { |
349 | 349 | $this->triggerError( |
350 | - 'Value for ' . $key . ' is of invalid type, should be ' . |
|
350 | + 'Value for '.$key.' is of invalid type, should be '. |
|
351 | 351 | HTMLPurifier_VarParser::getTypeName($type), |
352 | 352 | E_USER_WARNING |
353 | 353 | ); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | // check to see if the value is allowed |
362 | 362 | if (isset($def->allowed) && !isset($def->allowed[$value])) { |
363 | 363 | $this->triggerError( |
364 | - 'Value not supported, valid values are: ' . |
|
364 | + 'Value not supported, valid values are: '. |
|
365 | 365 | $this->_listify($def->allowed), |
366 | 366 | E_USER_WARNING |
367 | 367 | ); |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | // check preconditions |
525 | 525 | $def = null; |
526 | 526 | if ($optimized) { |
527 | - if (is_null($this->get($type . '.DefinitionID'))) { |
|
527 | + if (is_null($this->get($type.'.DefinitionID'))) { |
|
528 | 528 | // fatally error out if definition ID not set |
529 | 529 | throw new HTMLPurifier_Exception( |
530 | 530 | "Cannot retrieve raw version without specifying %$type.DefinitionID" |
@@ -535,17 +535,16 @@ discard block |
||
535 | 535 | $def = $this->definitions[$type]; |
536 | 536 | if ($def->setup && !$optimized) { |
537 | 537 | $extra = $this->chatty ? |
538 | - " (try moving this code block earlier in your initialization)" : |
|
539 | - ""; |
|
538 | + " (try moving this code block earlier in your initialization)" : ""; |
|
540 | 539 | throw new HTMLPurifier_Exception( |
541 | - "Cannot retrieve raw definition after it has already been setup" . |
|
540 | + "Cannot retrieve raw definition after it has already been setup". |
|
542 | 541 | $extra |
543 | 542 | ); |
544 | 543 | } |
545 | 544 | if ($def->optimized === null) { |
546 | 545 | $extra = $this->chatty ? " (try flushing your cache)" : ""; |
547 | 546 | throw new HTMLPurifier_Exception( |
548 | - "Optimization status of definition is unknown" . $extra |
|
547 | + "Optimization status of definition is unknown".$extra |
|
549 | 548 | ); |
550 | 549 | } |
551 | 550 | if ($def->optimized !== $optimized) { |
@@ -554,7 +553,7 @@ discard block |
||
554 | 553 | " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" |
555 | 554 | : ""; |
556 | 555 | throw new HTMLPurifier_Exception( |
557 | - "Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra |
|
556 | + "Inconsistent use of optimized and unoptimized raw definition retrievals".$extra |
|
558 | 557 | ); |
559 | 558 | } |
560 | 559 | } |
@@ -586,16 +585,16 @@ discard block |
||
586 | 585 | } |
587 | 586 | // check invariants for creation |
588 | 587 | if (!$optimized) { |
589 | - if (!is_null($this->get($type . '.DefinitionID'))) { |
|
588 | + if (!is_null($this->get($type.'.DefinitionID'))) { |
|
590 | 589 | if ($this->chatty) { |
591 | 590 | $this->triggerError( |
592 | - 'Due to a documentation error in previous version of HTML Purifier, your ' . |
|
593 | - 'definitions are not being cached. If this is OK, you can remove the ' . |
|
594 | - '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, ' . |
|
595 | - 'modify your code to use maybeGetRawDefinition, and test if the returned ' . |
|
596 | - 'value is null before making any edits (if it is null, that means that a ' . |
|
597 | - 'cached version is available, and no raw operations are necessary). See ' . |
|
598 | - '<a href="http://htmlpurifier.org/docs/enduser-customize.html#optimized">' . |
|
591 | + 'Due to a documentation error in previous version of HTML Purifier, your '. |
|
592 | + 'definitions are not being cached. If this is OK, you can remove the '. |
|
593 | + '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, '. |
|
594 | + 'modify your code to use maybeGetRawDefinition, and test if the returned '. |
|
595 | + 'value is null before making any edits (if it is null, that means that a '. |
|
596 | + 'cached version is available, and no raw operations are necessary). See '. |
|
597 | + '<a href="http://htmlpurifier.org/docs/enduser-customize.html#optimized">'. |
|
599 | 598 | 'Customize</a> for more details', |
600 | 599 | E_USER_WARNING |
601 | 600 | ); |
@@ -689,7 +688,7 @@ discard block |
||
689 | 688 | $namespace = $key; |
690 | 689 | $namespace_values = $value; |
691 | 690 | foreach ($namespace_values as $directive => $value2) { |
692 | - $this->set($namespace .'.'. $directive, $value2); |
|
691 | + $this->set($namespace.'.'.$directive, $value2); |
|
693 | 692 | } |
694 | 693 | } |
695 | 694 | } |
@@ -898,7 +897,7 @@ discard block |
||
898 | 897 | break; |
899 | 898 | } |
900 | 899 | } |
901 | - trigger_error($msg . $extra, $no); |
|
900 | + trigger_error($msg.$extra, $no); |
|
902 | 901 | } |
903 | 902 | |
904 | 903 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function setup($file = false) |
22 | 22 | { |
23 | 23 | if (!$file) { |
24 | - $file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/EntityLookup/entities.ser'; |
|
24 | + $file = HTMLPURIFIER_PREFIX.'/HTMLPurifier/EntityLookup/entities.ser'; |
|
25 | 25 | } |
26 | 26 | $this->table = unserialize(file_get_contents($file)); |
27 | 27 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function toArray($t = NULL) { |
48 | 48 | $a = $this->front; |
49 | 49 | if ($t !== NULL) $a[] = $t; |
50 | - for ($i = count($this->back)-1; $i >= 0; $i--) { |
|
50 | + for ($i = count($this->back) - 1; $i >= 0; $i--) { |
|
51 | 51 | $a[] = $this->back[$i]; |
52 | 52 | } |
53 | 53 | return $a; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $r = $this->delete(); |
149 | 149 | } |
150 | 150 | // insert |
151 | - for ($i = count($replacement)-1; $i >= 0; $i--) { |
|
151 | + for ($i = count($replacement) - 1; $i >= 0; $i--) { |
|
152 | 152 | $this->insertAfter($r); |
153 | 153 | $r = $replacement[$i]; |
154 | 154 | } |