@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function __construct($context) |
58 | 58 | { |
59 | - $this->locale =& $context->get('Locale'); |
|
59 | + $this->locale = & $context->get('Locale'); |
|
60 | 60 | $this->context = $context; |
61 | - $this->_current =& $this->_stacks[0]; |
|
62 | - $this->errors =& $this->_stacks[0]; |
|
61 | + $this->_current = & $this->_stacks[0]; |
|
62 | + $this->errors = & $this->_stacks[0]; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $token = $this->context->get('CurrentToken', true); |
80 | 80 | $line = $token ? $token->line : $this->context->get('CurrentLine', true); |
81 | - $col = $token ? $token->col : $this->context->get('CurrentCol', true); |
|
81 | + $col = $token ? $token->col : $this->context->get('CurrentCol', true); |
|
82 | 82 | $attr = $this->context->get('CurrentAttr', true); |
83 | 83 | |
84 | 84 | // perform special substitutions, also add custom parameters |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if (empty($errors)) { |
199 | - return '<p>' . $this->locale->getMessage('ErrorCollector: No errors') . '</p>'; |
|
199 | + return '<p>'.$this->locale->getMessage('ErrorCollector: No errors').'</p>'; |
|
200 | 200 | } else { |
201 | - return '<ul><li>' . implode('</li><li>', $ret) . '</li></ul>'; |
|
201 | + return '<ul><li>'.implode('</li><li>', $ret).'</li></ul>'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } else { |
222 | 222 | $string .= '<em class="location">End of Document: </em> '; |
223 | 223 | } |
224 | - $string .= '<strong class="description">' . $this->generator->escape($msg) . '</strong> '; |
|
224 | + $string .= '<strong class="description">'.$this->generator->escape($msg).'</strong> '; |
|
225 | 225 | $string .= '</div>'; |
226 | 226 | // Here, have a marker for the character on the column appropriate. |
227 | 227 | // Be sure to clip extremely long lines. |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public static function getCSS() |
73 | 73 | { |
74 | - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); |
|
74 | + return file_get_contents(HTMLPURIFIER_PREFIX.'/HTMLPurifier/Printer/ConfigForm.css'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public static function getJavaScript() |
81 | 81 | { |
82 | - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); |
|
82 | + return file_get_contents(HTMLPURIFIER_PREFIX.'/HTMLPurifier/Printer/ConfigForm.js'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $all = array(); |
108 | 108 | foreach ($allowed as $key) { |
109 | 109 | list($ns, $directive) = $key; |
110 | - $all[$ns][$directive] = $config->get($ns . '.' . $directive); |
|
110 | + $all[$ns][$directive] = $config->get($ns.'.'.$directive); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $ret = ''; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | if (!$this->compress || (strlen($directive) < $this->compress)) { |
164 | 164 | $directive_disp = $directive; |
165 | 165 | } else { |
166 | - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; |
|
166 | + $directive_disp = substr($directive, 0, $this->compress - 2).'...'; |
|
167 | 167 | $attr['title'] = $directive; |
168 | 168 | } |
169 | 169 | |
@@ -251,14 +251,14 @@ discard block |
||
251 | 251 | 'type' => 'checkbox', |
252 | 252 | 'value' => '1', |
253 | 253 | 'class' => 'null-toggle', |
254 | - 'name' => "$name" . "[Null_$ns.$directive]", |
|
254 | + 'name' => "$name"."[Null_$ns.$directive]", |
|
255 | 255 | 'id' => "$name:Null_$ns.$directive", |
256 | 256 | 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! |
257 | 257 | ); |
258 | 258 | if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { |
259 | 259 | // modify inline javascript slightly |
260 | 260 | $attr['onclick'] = |
261 | - "toggleWriteability('$name:Yes_$ns.$directive',checked);" . |
|
261 | + "toggleWriteability('$name:Yes_$ns.$directive',checked);". |
|
262 | 262 | "toggleWriteability('$name:No_$ns.$directive',checked)"; |
263 | 263 | } |
264 | 264 | if ($value === null) { |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | case HTMLPurifier_VarParser::HASH: |
328 | 328 | $nvalue = ''; |
329 | 329 | foreach ($value as $i => $v) { |
330 | - $nvalue .= "$i:$v" . PHP_EOL; |
|
330 | + $nvalue .= "$i:$v".PHP_EOL; |
|
331 | 331 | } |
332 | 332 | $value = $nvalue; |
333 | 333 | break; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $value = serialize($value); |
341 | 341 | } |
342 | 342 | $attr = array( |
343 | - 'name' => "$name" . "[$ns.$directive]", |
|
343 | + 'name' => "$name"."[$ns.$directive]", |
|
344 | 344 | 'id' => "$name:$ns.$directive" |
345 | 345 | ); |
346 | 346 | if ($value === null) { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | |
408 | 408 | $attr = array( |
409 | 409 | 'type' => 'radio', |
410 | - 'name' => "$name" . "[$ns.$directive]", |
|
410 | + 'name' => "$name"."[$ns.$directive]", |
|
411 | 411 | 'id' => "$name:Yes_$ns.$directive", |
412 | 412 | 'value' => '1' |
413 | 413 | ); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | |
427 | 427 | $attr = array( |
428 | 428 | 'type' => 'radio', |
429 | - 'name' => "$name" . "[$ns.$directive]", |
|
429 | + 'name' => "$name"."[$ns.$directive]", |
|
430 | 430 | 'id' => "$name:No_$ns.$directive", |
431 | 431 | 'value' => '0' |
432 | 432 | ); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function render($config) |
16 | 16 | { |
17 | 17 | $ret = ''; |
18 | - $this->config =& $config; |
|
18 | + $this->config = & $config; |
|
19 | 19 | |
20 | 20 | $this->def = $config->getHTMLDefinition(); |
21 | 21 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | $ret .= $this->element( |
219 | 219 | 'td', |
220 | - '<em>Block</em>: ' . |
|
220 | + '<em>Block</em>: '. |
|
221 | 221 | $this->escape($this->listifyTagLookup($def->block->elements)), |
222 | 222 | null, |
223 | 223 | 0 |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $ret .= $this->start('tr'); |
227 | 227 | $ret .= $this->element( |
228 | 228 | 'td', |
229 | - '<em>Inline</em>: ' . |
|
229 | + '<em>Inline</em>: '. |
|
230 | 230 | $this->escape($this->listifyTagLookup($def->inline->elements)), |
231 | 231 | null, |
232 | 232 | 0 |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | |
237 | 237 | $ret .= $this->element( |
238 | 238 | 'td', |
239 | - '<em>' . ucfirst($def->type) . '</em>: ' . |
|
239 | + '<em>'.ucfirst($def->type).'</em>: '. |
|
240 | 240 | $def->dtd_regex |
241 | 241 | ); |
242 | 242 | |
243 | 243 | } else { |
244 | 244 | $ret .= $this->element( |
245 | 245 | 'td', |
246 | - '<em>' . ucfirst($def->type) . '</em>: ' . |
|
246 | + '<em>'.ucfirst($def->type).'</em>: '. |
|
247 | 247 | $this->escape($this->listifyTagLookup($elements)), |
248 | 248 | null, |
249 | 249 | 0 |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | if ($obj === false) { |
301 | 301 | continue; |
302 | 302 | } |
303 | - $list[] = "$name = <i>" . $this->getClass($obj, 'AttrDef_') . '</i>'; |
|
303 | + $list[] = "$name = <i>".$this->getClass($obj, 'AttrDef_').'</i>'; |
|
304 | 304 | } |
305 | 305 | return $this->listify($list); |
306 | 306 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | break; |
125 | 125 | default: |
126 | 126 | throw new HTMLPurifier_Exception( |
127 | - "Cannot instantiate unrecognized Lexer type " . |
|
127 | + "Cannot instantiate unrecognized Lexer type ". |
|
128 | 128 | htmlspecialchars($lexer) |
129 | 129 | ); |
130 | 130 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // hack out something using XSLT, remove this stipulation |
139 | 139 | if ($needs_tracking && !$inst->tracksLineNumbers) { |
140 | 140 | throw new HTMLPurifier_Exception( |
141 | - 'Cannot use lexer that does not support line numbers with ' . |
|
141 | + 'Cannot use lexer that does not support line numbers with '. |
|
142 | 142 | 'Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)' |
143 | 143 | ); |
144 | 144 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | if ($config->get('Core.ConvertDocumentToFragment')) { |
314 | 314 | $e = false; |
315 | 315 | if ($config->get('Core.CollectErrors')) { |
316 | - $e =& $context->get('ErrorCollector'); |
|
316 | + $e = & $context->get('ErrorCollector'); |
|
317 | 317 | } |
318 | 318 | $new_html = $this->extractBody($html); |
319 | 319 | if ($e && $new_html != $html) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | // our default if the initial number has no decimals, or increase |
117 | 117 | // it by how ever many decimals, thus, the number of guard digits |
118 | 118 | // will always be greater than or equal to internalPrecision. |
119 | - $log = (int)floor(log(abs($n), 10)); |
|
119 | + $log = (int) floor(log(abs($n), 10)); |
|
120 | 120 | $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision |
121 | 121 | |
122 | 122 | for ($i = 0; $i < 2; $i++) { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if ($this->bcmath) { |
217 | 217 | return bcadd($s1, $s2, $scale); |
218 | 218 | } else { |
219 | - return $this->scale((float)$s1 + (float)$s2, $scale); |
|
219 | + return $this->scale((float) $s1 + (float) $s2, $scale); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | if ($this->bcmath) { |
233 | 233 | return bcmul($s1, $s2, $scale); |
234 | 234 | } else { |
235 | - return $this->scale((float)$s1 * (float)$s2, $scale); |
|
235 | + return $this->scale((float) $s1 * (float) $s2, $scale); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if ($this->bcmath) { |
249 | 249 | return bcdiv($s1, $s2, $scale); |
250 | 250 | } else { |
251 | - return $this->scale((float)$s1 / (float)$s2, $scale); |
|
251 | + return $this->scale((float) $s1 / (float) $s2, $scale); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
@@ -261,18 +261,18 @@ discard block |
||
261 | 261 | */ |
262 | 262 | private function round($n, $sigfigs) |
263 | 263 | { |
264 | - $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1 |
|
264 | + $new_log = (int) floor(log(abs($n), 10)); // Number of digits left of decimal - 1 |
|
265 | 265 | $rp = $sigfigs - $new_log - 1; // Number of decimal places needed |
266 | 266 | $neg = $n < 0 ? '-' : ''; // Negative sign |
267 | 267 | if ($this->bcmath) { |
268 | 268 | if ($rp >= 0) { |
269 | - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); |
|
269 | + $n = bcadd($n, $neg.'0.'.str_repeat('0', $rp).'5', $rp + 1); |
|
270 | 270 | $n = bcdiv($n, '1', $rp); |
271 | 271 | } else { |
272 | 272 | // This algorithm partially depends on the standardized |
273 | 273 | // form of numbers that comes out of bcmath. |
274 | - $n = bcadd($n, $neg . '5' . str_repeat('0', $new_log - $sigfigs), 0); |
|
275 | - $n = substr($n, 0, $sigfigs + strlen($neg)) . str_repeat('0', $new_log - $sigfigs + 1); |
|
274 | + $n = bcadd($n, $neg.'5'.str_repeat('0', $new_log - $sigfigs), 0); |
|
275 | + $n = substr($n, 0, $sigfigs + strlen($neg)).str_repeat('0', $new_log - $sigfigs + 1); |
|
276 | 276 | } |
277 | 277 | return $n; |
278 | 278 | } else { |
@@ -291,16 +291,16 @@ discard block |
||
291 | 291 | if ($scale < 0) { |
292 | 292 | // The f sprintf type doesn't support negative numbers, so we |
293 | 293 | // need to cludge things manually. First get the string. |
294 | - $r = sprintf('%.0f', (float)$r); |
|
294 | + $r = sprintf('%.0f', (float) $r); |
|
295 | 295 | // Due to floating point precision loss, $r will more than likely |
296 | 296 | // look something like 4652999999999.9234. We grab one more digit |
297 | 297 | // than we need to precise from $r and then use that to round |
298 | 298 | // appropriately. |
299 | - $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1); |
|
299 | + $precise = (string) round(substr($r, 0, strlen($r) + $scale), -1); |
|
300 | 300 | // Now we return it, truncating the zero that was rounded off. |
301 | - return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); |
|
301 | + return substr($precise, 0, -1).str_repeat('0', -$scale + 1); |
|
302 | 302 | } |
303 | - return sprintf('%.' . $scale . 'f', (float)$r); |
|
303 | + return sprintf('%.'.$scale.'f', (float) $r); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $html = ''; |
91 | 91 | for ($i = 0, $size = count($tokens); $i < $size; $i++) { |
92 | 92 | if ($this->_scriptFix && $tokens[$i]->name === 'script' |
93 | - && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { |
|
93 | + && $i + 2 < $size && $tokens[$i + 2] instanceof HTMLPurifier_Token_End) { |
|
94 | 94 | // script special case |
95 | 95 | // the contents of the script block must be ONE token |
96 | 96 | // for this to work. |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->_flashStack[] = $flash; |
153 | 153 | } |
154 | 154 | } |
155 | - return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; |
|
155 | + return '<'.$token->name.($attr ? ' ' : '').$attr.'>'; |
|
156 | 156 | |
157 | 157 | } elseif ($token instanceof HTMLPurifier_Token_End) { |
158 | 158 | $_extra = ''; |
@@ -161,22 +161,22 @@ discard block |
||
161 | 161 | // doesn't do anything for now |
162 | 162 | } |
163 | 163 | } |
164 | - return $_extra . '</' . $token->name . '>'; |
|
164 | + return $_extra.'</'.$token->name.'>'; |
|
165 | 165 | |
166 | 166 | } elseif ($token instanceof HTMLPurifier_Token_Empty) { |
167 | 167 | if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { |
168 | - $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; |
|
168 | + $this->_flashStack[count($this->_flashStack) - 1]->param[$token->attr['name']] = $token->attr['value']; |
|
169 | 169 | } |
170 | 170 | $attr = $this->generateAttributes($token->attr, $token->name); |
171 | - return '<' . $token->name . ($attr ? ' ' : '') . $attr . |
|
172 | - ( $this->_xhtml ? ' /': '' ) // <br /> v. <br> |
|
171 | + return '<'.$token->name.($attr ? ' ' : '').$attr. |
|
172 | + ($this->_xhtml ? ' /' : '') // <br /> v. <br> |
|
173 | 173 | . '>'; |
174 | 174 | |
175 | 175 | } elseif ($token instanceof HTMLPurifier_Token_Text) { |
176 | 176 | return $this->escape($token->data, ENT_NOQUOTES); |
177 | 177 | |
178 | 178 | } elseif ($token instanceof HTMLPurifier_Token_Comment) { |
179 | - return '<!--' . $token->data . '-->'; |
|
179 | + return '<!--'.$token->data.'-->'; |
|
180 | 180 | } else { |
181 | 181 | return ''; |
182 | 182 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | // Thanks <http://lachy.id.au/log/2005/05/script-comments> |
199 | 199 | $data = preg_replace('#//\s*$#', '', $token->data); |
200 | - return '<!--//--><![CDATA[//><!--' . "\n" . trim($data) . "\n" . '//--><!]]>'; |
|
200 | + return '<!--//--><![CDATA[//><!--'."\n".trim($data)."\n".'//--><!]]>'; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | // Check if we should minimize the attribute: val="val" -> val |
224 | 224 | if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { |
225 | - $html .= $key . ' '; |
|
225 | + $html .= $key.' '; |
|
226 | 226 | continue; |
227 | 227 | } |
228 | 228 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | if ($i == $c) { |
88 | 88 | trigger_error( |
89 | - 'Tidy level ' . htmlspecialchars($level) . ' not recognized', |
|
89 | + 'Tidy level '.htmlspecialchars($level).' not recognized', |
|
90 | 90 | E_USER_WARNING |
91 | 91 | ); |
92 | 92 | return array(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | if (!isset($this->fixesForLevel[$this->defaultLevel])) { |
115 | 115 | trigger_error( |
116 | - 'Default level ' . $this->defaultLevel . ' does not exist', |
|
116 | + 'Default level '.$this->defaultLevel.' does not exist', |
|
117 | 117 | E_USER_ERROR |
118 | 118 | ); |
119 | 119 | return; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | // PHP does some weird parsing when I do |
150 | 150 | // $e->$type[$attr], so I have to assign a ref. |
151 | - $f =& $e->$type; |
|
151 | + $f = & $e->$type; |
|
152 | 152 | $f[$attr] = $fix; |
153 | 153 | break; |
154 | 154 | case 'tag_transform': |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | if (is_null($property)) { |
205 | 205 | $property = 'pre'; |
206 | 206 | } |
207 | - $type = 'attr_transform_' . $property; |
|
207 | + $type = 'attr_transform_'.$property; |
|
208 | 208 | return array($type, $params); |
209 | 209 | } |
210 | 210 |
@@ -24,8 +24,8 @@ |
||
24 | 24 | array( |
25 | 25 | 'src*' => 'URI#embedded', |
26 | 26 | 'type' => 'Enum#application/x-shockwave-flash', |
27 | - 'width' => 'Pixels#' . $max, |
|
28 | - 'height' => 'Pixels#' . $max, |
|
27 | + 'width' => 'Pixels#'.$max, |
|
28 | + 'height' => 'Pixels#'.$max, |
|
29 | 29 | 'allowscriptaccess' => 'Enum#never', |
30 | 30 | 'allownetworking' => 'Enum#internal', |
31 | 31 | 'flashvars' => 'Text', |
@@ -31,8 +31,8 @@ |
||
31 | 31 | // While technically not required by the spec, we're forcing |
32 | 32 | // it to this value. |
33 | 33 | 'type' => 'Enum#application/x-shockwave-flash', |
34 | - 'width' => 'Pixels#' . $max, |
|
35 | - 'height' => 'Pixels#' . $max, |
|
34 | + 'width' => 'Pixels#'.$max, |
|
35 | + 'height' => 'Pixels#'.$max, |
|
36 | 36 | 'data' => 'URI#embedded', |
37 | 37 | 'codebase' => new HTMLPurifier_AttrDef_Enum( |
38 | 38 | array( |