@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | $tidy->parseString( |
107 | 107 | $html, |
108 | 108 | array( |
109 | - 'indent'=> true, |
|
110 | - 'output-xhtml' => $this->_xhtml, |
|
111 | - 'show-body-only' => true, |
|
112 | - 'indent-spaces' => 2, |
|
113 | - 'wrap' => 68, |
|
109 | + 'indent'=> true, |
|
110 | + 'output-xhtml' => $this->_xhtml, |
|
111 | + 'show-body-only' => true, |
|
112 | + 'indent-spaces' => 2, |
|
113 | + 'wrap' => 68, |
|
114 | 114 | ), |
115 | 115 | 'utf8' |
116 | 116 | ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 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 . |
|
171 | + return '<' . $token->name . ($attr ? ' ' : '') . $attr . |
|
172 | 172 | ( $this->_xhtml ? ' /': '' ) // <br /> v. <br> |
173 | 173 | . '>'; |
174 | 174 |
@@ -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 |
@@ -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( |
@@ -28,8 +28,8 @@ |
||
28 | 28 | 'alt*' => 'Text', |
29 | 29 | // According to the spec, it's Length, but percents can |
30 | 30 | // be abused, so we allow only Pixels. |
31 | - 'height' => 'Pixels#' . $max, |
|
32 | - 'width' => 'Pixels#' . $max, |
|
31 | + 'height' => 'Pixels#'.$max, |
|
32 | + 'width' => 'Pixels#'.$max, |
|
33 | 33 | 'longdesc' => 'URI', |
34 | 34 | 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded |
35 | 35 | ) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->preserve[45] = true; // Dash - |
37 | 37 | $this->preserve[46] = true; // Period . |
38 | 38 | $this->preserve[95] = true; // Underscore _ |
39 | - $this->preserve[126]= true; // Tilde ~ |
|
39 | + $this->preserve[126] = true; // Tilde ~ |
|
40 | 40 | |
41 | 41 | // extra letters not to escape |
42 | 42 | if ($preserve !== false) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $ret = ''; |
62 | 62 | for ($i = 0, $c = strlen($string); $i < $c; $i++) { |
63 | 63 | if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { |
64 | - $ret .= '%' . sprintf('%02X', $int); |
|
64 | + $ret .= '%'.sprintf('%02X', $int); |
|
65 | 65 | } else { |
66 | 66 | $ret .= $string[$i]; |
67 | 67 | } |
@@ -87,22 +87,22 @@ discard block |
||
87 | 87 | foreach ($parts as $part) { |
88 | 88 | $length = strlen($part); |
89 | 89 | if ($length < 2) { |
90 | - $ret .= '%25' . $part; |
|
90 | + $ret .= '%25'.$part; |
|
91 | 91 | continue; |
92 | 92 | } |
93 | 93 | $encoding = substr($part, 0, 2); |
94 | 94 | $text = substr($part, 2); |
95 | 95 | if (!ctype_xdigit($encoding)) { |
96 | - $ret .= '%25' . $part; |
|
96 | + $ret .= '%25'.$part; |
|
97 | 97 | continue; |
98 | 98 | } |
99 | 99 | $int = hexdec($encoding); |
100 | 100 | if (isset($this->preserve[$int])) { |
101 | - $ret .= chr($int) . $text; |
|
101 | + $ret .= chr($int).$text; |
|
102 | 102 | continue; |
103 | 103 | } |
104 | 104 | $encoding = strtoupper($encoding); |
105 | - $ret .= '%' . $encoding . $text; |
|
105 | + $ret .= '%'.$encoding.$text; |
|
106 | 106 | } |
107 | 107 | return $ret; |
108 | 108 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $this->scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); |
61 | 61 | $this->userinfo = $userinfo; |
62 | 62 | $this->host = $host; |
63 | - $this->port = is_null($port) ? $port : (int)$port; |
|
63 | + $this->port = is_null($port) ? $port : (int) $port; |
|
64 | 64 | $this->path = $path; |
65 | 65 | $this->query = $query; |
66 | 66 | $this->fragment = $fragment; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if (!$scheme_obj) { |
88 | 88 | // something funky happened to the default scheme object |
89 | 89 | trigger_error( |
90 | - 'Default scheme object "' . $def->defaultScheme . '" was not readable', |
|
90 | + 'Default scheme object "'.$def->defaultScheme.'" was not readable', |
|
91 | 91 | E_USER_WARNING |
92 | 92 | ); |
93 | 93 | return false; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // ABNF definitions from RFC 3986 |
109 | 109 | $chars_sub_delims = '!$&\'()*+,;='; |
110 | 110 | $chars_gen_delims = ':/?#[]@'; |
111 | - $chars_pchar = $chars_sub_delims . ':@'; |
|
111 | + $chars_pchar = $chars_sub_delims.':@'; |
|
112 | 112 | |
113 | 113 | // validate host |
114 | 114 | if (!is_null($this->host)) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | // validate username |
138 | 138 | if (!is_null($this->userinfo)) { |
139 | - $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . ':'); |
|
139 | + $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims.':'); |
|
140 | 140 | $this->userinfo = $encoder->encode($this->userinfo); |
141 | 141 | } |
142 | 142 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | // validate path |
151 | - $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); |
|
151 | + $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar.'/'); |
|
152 | 152 | if (!is_null($this->host)) { // this catches $this->host === '' |
153 | 153 | // path-abempty (hier and relative) |
154 | 154 | // http://www.example.com/my/path |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | // path-noscheme (relative) |
183 | 183 | // my/path |
184 | 184 | // (once again, not checking nz) |
185 | - $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@'); |
|
185 | + $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims.'@'); |
|
186 | 186 | $c = strpos($this->path, '/'); |
187 | 187 | if ($c !== false) { |
188 | 188 | $this->path = |
189 | - $segment_nc_encoder->encode(substr($this->path, 0, $c)) . |
|
189 | + $segment_nc_encoder->encode(substr($this->path, 0, $c)). |
|
190 | 190 | $segments_encoder->encode(substr($this->path, $c)); |
191 | 191 | } else { |
192 | 192 | $this->path = $segment_nc_encoder->encode($this->path); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | // qf = query and fragment |
201 | - $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/?'); |
|
201 | + $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar.'/?'); |
|
202 | 202 | |
203 | 203 | if (!is_null($this->query)) { |
204 | 204 | $this->query = $qf_encoder->encode($this->query); |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | if (!is_null($this->host)) { |
225 | 225 | $authority = ''; |
226 | 226 | if (!is_null($this->userinfo)) { |
227 | - $authority .= $this->userinfo . '@'; |
|
227 | + $authority .= $this->userinfo.'@'; |
|
228 | 228 | } |
229 | 229 | $authority .= $this->host; |
230 | 230 | if (!is_null($this->port)) { |
231 | - $authority .= ':' . $this->port; |
|
231 | + $authority .= ':'.$this->port; |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -240,17 +240,17 @@ discard block |
||
240 | 240 | // defer to the schemes to do the right thing. |
241 | 241 | $result = ''; |
242 | 242 | if (!is_null($this->scheme)) { |
243 | - $result .= $this->scheme . ':'; |
|
243 | + $result .= $this->scheme.':'; |
|
244 | 244 | } |
245 | 245 | if (!is_null($authority)) { |
246 | - $result .= '//' . $authority; |
|
246 | + $result .= '//'.$authority; |
|
247 | 247 | } |
248 | 248 | $result .= $this->path; |
249 | 249 | if (!is_null($this->query)) { |
250 | - $result .= '?' . $this->query; |
|
250 | + $result .= '?'.$this->query; |
|
251 | 251 | } |
252 | 252 | if (!is_null($this->fragment)) { |
253 | - $result .= '#' . $this->fragment; |
|
253 | + $result .= '#'.$this->fragment; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | return $result; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $this->base = $def->base; |
30 | 30 | if (is_null($this->base)) { |
31 | 31 | trigger_error( |
32 | - 'URI.MakeAbsolute is being ignored due to lack of ' . |
|
32 | + 'URI.MakeAbsolute is being ignored due to lack of '. |
|
33 | 33 | 'value for URI.Base configuration', |
34 | 34 | E_USER_WARNING |
35 | 35 | ); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function prepare($config) |
45 | 45 | { |
46 | - $this->target = $config->get('URI.' . $this->name); |
|
46 | + $this->target = $config->get('URI.'.$this->name); |
|
47 | 47 | $this->parser = new HTMLPurifier_URIParser(); |
48 | 48 | $this->doEmbed = $config->get('URI.MungeResources'); |
49 | 49 | $this->secretKey = $config->get('URI.MungeSecretKey'); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $decorator = $this->copy(); |
30 | 30 | // reference is necessary for mocks in PHP 4 |
31 | - $decorator->cache =& $cache; |
|
31 | + $decorator->cache = & $cache; |
|
32 | 32 | $decorator->type = $cache->type; |
33 | 33 | return $decorator; |
34 | 34 | } |