@@ -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 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if ($filename[0] === '.') { |
105 | 105 | continue; |
106 | 106 | } |
107 | - unlink($dir . '/' . $filename); |
|
107 | + unlink($dir.'/'.$filename); |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | $key = substr($filename, 0, strlen($filename) - 4); |
130 | 130 | if ($this->isOld($key, $config)) { |
131 | - unlink($dir . '/' . $filename); |
|
131 | + unlink($dir.'/'.$filename); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public function generateFilePath($config) |
144 | 144 | { |
145 | 145 | $key = $this->generateKey($config); |
146 | - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; |
|
146 | + return $this->generateDirectoryPath($config).'/'.$key.'.ser'; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public function generateDirectoryPath($config) |
157 | 157 | { |
158 | 158 | $base = $this->generateBaseDirectoryPath($config); |
159 | - return $base . '/' . $this->type; |
|
159 | + return $base.'/'.$this->type; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | public function generateBaseDirectoryPath($config) |
170 | 170 | { |
171 | 171 | $base = $config->get('Cache.SerializerPath'); |
172 | - $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; |
|
172 | + $base = is_null($base) ? HTMLPURIFIER_PREFIX.'/HTMLPurifier/DefinitionCache/Serializer' : $base; |
|
173 | 173 | return $base; |
174 | 174 | } |
175 | 175 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $base = $this->generateBaseDirectoryPath($config); |
212 | 212 | if (!is_dir($base)) { |
213 | 213 | trigger_error( |
214 | - 'Base directory ' . $base . ' does not exist, |
|
214 | + 'Base directory '.$base.' does not exist, |
|
215 | 215 | please create or change using %Cache.SerializerPath', |
216 | 216 | E_USER_WARNING |
217 | 217 | ); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | mkdir($directory, $chmod); |
223 | 223 | if (!$this->_testPermissions($directory, $chmod)) { |
224 | 224 | trigger_error( |
225 | - 'Base directory ' . $base . ' does not exist, |
|
225 | + 'Base directory '.$base.' does not exist, |
|
226 | 226 | please create or change using %Cache.SerializerPath', |
227 | 227 | E_USER_WARNING |
228 | 228 | ); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // generally, you'll want to handle this beforehand |
252 | 252 | // so a more specific error message can be given |
253 | 253 | trigger_error( |
254 | - 'Directory ' . $dir . ' does not exist', |
|
254 | + 'Directory '.$dir.' does not exist', |
|
255 | 255 | E_USER_WARNING |
256 | 256 | ); |
257 | 257 | return false; |
@@ -272,14 +272,14 @@ discard block |
||
272 | 272 | $chmod = $chmod | 0777; |
273 | 273 | } |
274 | 274 | trigger_error( |
275 | - 'Directory ' . $dir . ' not writable, ' . |
|
276 | - 'please chmod to ' . decoct($chmod), |
|
275 | + 'Directory '.$dir.' not writable, '. |
|
276 | + 'please chmod to '.decoct($chmod), |
|
277 | 277 | E_USER_WARNING |
278 | 278 | ); |
279 | 279 | } else { |
280 | 280 | // generic error message |
281 | 281 | trigger_error( |
282 | - 'Directory ' . $dir . ' not writable, ' . |
|
282 | + 'Directory '.$dir.' not writable, '. |
|
283 | 283 | 'please alter file permissions', |
284 | 284 | E_USER_WARNING |
285 | 285 | ); |
@@ -140,12 +140,10 @@ |
||
140 | 140 | $is_hex = (@$entity[2] === 'x'); |
141 | 141 | $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; |
142 | 142 | return isset($this->_special_dec2str[$int]) ? |
143 | - $this->_special_dec2str[$int] : |
|
144 | - $entity; |
|
143 | + $this->_special_dec2str[$int] : $entity; |
|
145 | 144 | } else { |
146 | 145 | return isset($this->_special_ent2dec[$matches[3]]) ? |
147 | - $this->_special_ent2dec[$matches[3]] : |
|
148 | - $entity; |
|
146 | + $this->_special_ent2dec[$matches[3]] : $entity; |
|
149 | 147 | } |
150 | 148 | } |
151 | 149 | } |