@@ -260,8 +260,7 @@ discard block |
||
| 260 | 260 | // Set the extra field to the given data |
| 261 | 261 | $this->extra_field = substr($this->compressed_data, $this->position, $len); |
| 262 | 262 | $this->position += $len; |
| 263 | - } |
|
| 264 | - else |
|
| 263 | + } else |
|
| 265 | 264 | { |
| 266 | 265 | return false; |
| 267 | 266 | } |
@@ -280,8 +279,7 @@ discard block |
||
| 280 | 279 | // Set the original filename to the given string |
| 281 | 280 | $this->filename = substr($this->compressed_data, $this->position, $len); |
| 282 | 281 | $this->position += $len + 1; |
| 283 | - } |
|
| 284 | - else |
|
| 282 | + } else |
|
| 285 | 283 | { |
| 286 | 284 | return false; |
| 287 | 285 | } |
@@ -300,8 +298,7 @@ discard block |
||
| 300 | 298 | // Set the original comment to the given string |
| 301 | 299 | $this->comment = substr($this->compressed_data, $this->position, $len); |
| 302 | 300 | $this->position += $len + 1; |
| 303 | - } |
|
| 304 | - else |
|
| 301 | + } else |
|
| 305 | 302 | { |
| 306 | 303 | return false; |
| 307 | 304 | } |
@@ -321,13 +318,11 @@ discard block |
||
| 321 | 318 | if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) |
| 322 | 319 | { |
| 323 | 320 | $this->position += 2; |
| 324 | - } |
|
| 325 | - else |
|
| 321 | + } else |
|
| 326 | 322 | { |
| 327 | 323 | return false; |
| 328 | 324 | } |
| 329 | - } |
|
| 330 | - else |
|
| 325 | + } else |
|
| 331 | 326 | { |
| 332 | 327 | return false; |
| 333 | 328 | } |
@@ -194,8 +194,7 @@ discard block |
||
| 194 | 194 | if ($hex) |
| 195 | 195 | { |
| 196 | 196 | $codepoint = hexdec($codepoint); |
| 197 | - } |
|
| 198 | - else |
|
| 197 | + } else |
|
| 199 | 198 | { |
| 200 | 199 | $codepoint = intval($codepoint); |
| 201 | 200 | } |
@@ -203,8 +202,7 @@ discard block |
||
| 203 | 202 | if (isset($windows_1252_specials[$codepoint])) |
| 204 | 203 | { |
| 205 | 204 | $replacement = $windows_1252_specials[$codepoint]; |
| 206 | - } |
|
| 207 | - else |
|
| 205 | + } else |
|
| 208 | 206 | { |
| 209 | 207 | $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); |
| 210 | 208 | } |
@@ -84,14 +84,12 @@ discard block |
||
| 84 | 84 | try |
| 85 | 85 | { |
| 86 | 86 | $this->dom->loadHTML($this->file->body); |
| 87 | - } |
|
| 88 | - catch (Throwable $ex) |
|
| 87 | + } catch (Throwable $ex) |
|
| 89 | 88 | { |
| 90 | 89 | $this->dom = null; |
| 91 | 90 | } |
| 92 | 91 | restore_error_handler(); |
| 93 | - } |
|
| 94 | - else |
|
| 92 | + } else |
|
| 95 | 93 | { |
| 96 | 94 | $this->dom = null; |
| 97 | 95 | } |
@@ -168,12 +166,10 @@ discard block |
||
| 168 | 166 | } |
| 169 | 167 | |
| 170 | 168 | return in_array($sniffed, $mime_types); |
| 171 | - } |
|
| 172 | - elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
| 169 | + } elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
| 173 | 170 | { |
| 174 | 171 | return true; |
| 175 | - } |
|
| 176 | - else |
|
| 172 | + } else |
|
| 177 | 173 | { |
| 178 | 174 | return false; |
| 179 | 175 | } |
@@ -242,8 +238,7 @@ discard block |
||
| 242 | 238 | if ($this->base_location < $line) |
| 243 | 239 | { |
| 244 | 240 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); |
| 245 | - } |
|
| 246 | - else |
|
| 241 | + } else |
|
| 247 | 242 | { |
| 248 | 243 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); |
| 249 | 244 | } |
@@ -290,8 +285,7 @@ discard block |
||
| 290 | 285 | if (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo()) |
| 291 | 286 | { |
| 292 | 287 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); |
| 293 | - } |
|
| 294 | - else |
|
| 288 | + } else |
|
| 295 | 289 | { |
| 296 | 290 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); |
| 297 | 291 | } |
@@ -305,8 +299,7 @@ discard block |
||
| 305 | 299 | if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) |
| 306 | 300 | { |
| 307 | 301 | $this->local[] = $href; |
| 308 | - } |
|
| 309 | - else |
|
| 302 | + } else |
|
| 310 | 303 | { |
| 311 | 304 | $this->elsewhere[] = $href; |
| 312 | 305 | } |
@@ -351,8 +344,7 @@ discard block |
||
| 351 | 344 | $this->registry->call('Misc', 'absolutize_url', |
| 352 | 345 | array(trim($link->getAttribute('href')), |
| 353 | 346 | $this->base)); |
| 354 | - } |
|
| 355 | - else |
|
| 347 | + } else |
|
| 356 | 348 | { |
| 357 | 349 | $href = |
| 358 | 350 | $this->registry->call('Misc', 'absolutize_url', |
@@ -392,8 +384,7 @@ discard block |
||
| 392 | 384 | if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) |
| 393 | 385 | { |
| 394 | 386 | return array($feed); |
| 395 | - } |
|
| 396 | - else |
|
| 387 | + } else |
|
| 397 | 388 | { |
| 398 | 389 | unset($array[$key]); |
| 399 | 390 | } |
@@ -420,8 +411,7 @@ discard block |
||
| 420 | 411 | if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) |
| 421 | 412 | { |
| 422 | 413 | return array($feed); |
| 423 | - } |
|
| 424 | - else |
|
| 414 | + } else |
|
| 425 | 415 | { |
| 426 | 416 | unset($array[$key]); |
| 427 | 417 | } |
@@ -96,8 +96,7 @@ discard block |
||
| 96 | 96 | if (($pos = strpos($this->file->headers['content-type'], ';')) !== false) |
| 97 | 97 | { |
| 98 | 98 | $official = substr($this->file->headers['content-type'], 0, $pos); |
| 99 | - } |
|
| 100 | - else |
|
| 99 | + } else |
|
| 101 | 100 | { |
| 102 | 101 | $official = $this->file->headers['content-type']; |
| 103 | 102 | } |
@@ -107,14 +106,12 @@ discard block |
||
| 107 | 106 | || $official === 'application/unknown') |
| 108 | 107 | { |
| 109 | 108 | return $this->unknown(); |
| 110 | - } |
|
| 111 | - elseif (substr($official, -4) === '+xml' |
|
| 109 | + } elseif (substr($official, -4) === '+xml' |
|
| 112 | 110 | || $official === 'text/xml' |
| 113 | 111 | || $official === 'application/xml') |
| 114 | 112 | { |
| 115 | 113 | return $official; |
| 116 | - } |
|
| 117 | - elseif (substr($official, 0, 6) === 'image/') |
|
| 114 | + } elseif (substr($official, 0, 6) === 'image/') |
|
| 118 | 115 | { |
| 119 | 116 | if ($return = $this->image()) |
| 120 | 117 | { |
@@ -122,8 +119,7 @@ discard block |
||
| 122 | 119 | } |
| 123 | 120 | |
| 124 | 121 | return $official; |
| 125 | - } |
|
| 126 | - elseif ($official === 'text/html') |
|
| 122 | + } elseif ($official === 'text/html') |
|
| 127 | 123 | { |
| 128 | 124 | return $this->feed_or_html(); |
| 129 | 125 | } |
@@ -147,8 +143,7 @@ discard block |
||
| 147 | 143 | || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF") |
| 148 | 144 | { |
| 149 | 145 | return 'text/plain'; |
| 150 | - } |
|
| 151 | - elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) |
|
| 146 | + } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) |
|
| 152 | 147 | { |
| 153 | 148 | return 'application/octet-stream'; |
| 154 | 149 | } |
@@ -169,33 +164,26 @@ discard block |
||
| 169 | 164 | || strtolower(substr($this->file->body, $ws, 7)) === '<script') |
| 170 | 165 | { |
| 171 | 166 | return 'text/html'; |
| 172 | - } |
|
| 173 | - elseif (substr($this->file->body, 0, 5) === '%PDF-') |
|
| 167 | + } elseif (substr($this->file->body, 0, 5) === '%PDF-') |
|
| 174 | 168 | { |
| 175 | 169 | return 'application/pdf'; |
| 176 | - } |
|
| 177 | - elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-') |
|
| 170 | + } elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-') |
|
| 178 | 171 | { |
| 179 | 172 | return 'application/postscript'; |
| 180 | - } |
|
| 181 | - elseif (substr($this->file->body, 0, 6) === 'GIF87a' |
|
| 173 | + } elseif (substr($this->file->body, 0, 6) === 'GIF87a' |
|
| 182 | 174 | || substr($this->file->body, 0, 6) === 'GIF89a') |
| 183 | 175 | { |
| 184 | 176 | return 'image/gif'; |
| 185 | - } |
|
| 186 | - elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") |
|
| 177 | + } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") |
|
| 187 | 178 | { |
| 188 | 179 | return 'image/png'; |
| 189 | - } |
|
| 190 | - elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") |
|
| 180 | + } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") |
|
| 191 | 181 | { |
| 192 | 182 | return 'image/jpeg'; |
| 193 | - } |
|
| 194 | - elseif (substr($this->file->body, 0, 2) === "\x42\x4D") |
|
| 183 | + } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") |
|
| 195 | 184 | { |
| 196 | 185 | return 'image/bmp'; |
| 197 | - } |
|
| 198 | - elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") |
|
| 186 | + } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") |
|
| 199 | 187 | { |
| 200 | 188 | return 'image/vnd.microsoft.icon'; |
| 201 | 189 | } |
@@ -214,20 +202,16 @@ discard block |
||
| 214 | 202 | || substr($this->file->body, 0, 6) === 'GIF89a') |
| 215 | 203 | { |
| 216 | 204 | return 'image/gif'; |
| 217 | - } |
|
| 218 | - elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") |
|
| 205 | + } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") |
|
| 219 | 206 | { |
| 220 | 207 | return 'image/png'; |
| 221 | - } |
|
| 222 | - elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") |
|
| 208 | + } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") |
|
| 223 | 209 | { |
| 224 | 210 | return 'image/jpeg'; |
| 225 | - } |
|
| 226 | - elseif (substr($this->file->body, 0, 2) === "\x42\x4D") |
|
| 211 | + } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") |
|
| 227 | 212 | { |
| 228 | 213 | return 'image/bmp'; |
| 229 | - } |
|
| 230 | - elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") |
|
| 214 | + } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") |
|
| 231 | 215 | { |
| 232 | 216 | return 'image/vnd.microsoft.icon'; |
| 233 | 217 | } |
@@ -270,44 +254,36 @@ discard block |
||
| 270 | 254 | if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false) |
| 271 | 255 | { |
| 272 | 256 | $pos += 3; |
| 273 | - } |
|
| 274 | - else |
|
| 257 | + } else |
|
| 275 | 258 | { |
| 276 | 259 | return 'text/html'; |
| 277 | 260 | } |
| 278 | - } |
|
| 279 | - elseif (substr($this->file->body, $pos, 1) === '!') |
|
| 261 | + } elseif (substr($this->file->body, $pos, 1) === '!') |
|
| 280 | 262 | { |
| 281 | 263 | if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false) |
| 282 | 264 | { |
| 283 | 265 | $pos++; |
| 284 | - } |
|
| 285 | - else |
|
| 266 | + } else |
|
| 286 | 267 | { |
| 287 | 268 | return 'text/html'; |
| 288 | 269 | } |
| 289 | - } |
|
| 290 | - elseif (substr($this->file->body, $pos, 1) === '?') |
|
| 270 | + } elseif (substr($this->file->body, $pos, 1) === '?') |
|
| 291 | 271 | { |
| 292 | 272 | if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false) |
| 293 | 273 | { |
| 294 | 274 | $pos += 2; |
| 295 | - } |
|
| 296 | - else |
|
| 275 | + } else |
|
| 297 | 276 | { |
| 298 | 277 | return 'text/html'; |
| 299 | 278 | } |
| 300 | - } |
|
| 301 | - elseif (substr($this->file->body, $pos, 3) === 'rss' |
|
| 279 | + } elseif (substr($this->file->body, $pos, 3) === 'rss' |
|
| 302 | 280 | || substr($this->file->body, $pos, 7) === 'rdf:RDF') |
| 303 | 281 | { |
| 304 | 282 | return 'application/rss+xml'; |
| 305 | - } |
|
| 306 | - elseif (substr($this->file->body, $pos, 4) === 'feed') |
|
| 283 | + } elseif (substr($this->file->body, $pos, 4) === 'feed') |
|
| 307 | 284 | { |
| 308 | 285 | return 'application/atom+xml'; |
| 309 | - } |
|
| 310 | - else |
|
| 286 | + } else |
|
| 311 | 287 | { |
| 312 | 288 | return 'text/html'; |
| 313 | 289 | } |
@@ -29,11 +29,9 @@ |
||
| 29 | 29 | function getenv_docker($env, $default) {
|
| 30 | 30 | if ($fileEnv = getenv($env . '_FILE')) {
|
| 31 | 31 | return rtrim(file_get_contents($fileEnv), "\r\n"); |
| 32 | - } |
|
| 33 | - else if (($val = getenv($env)) !== false) {
|
|
| 32 | + } else if (($val = getenv($env)) !== false) {
|
|
| 34 | 33 | return $val; |
| 35 | - } |
|
| 36 | - else {
|
|
| 34 | + } else {
|
|
| 37 | 35 | return $default; |
| 38 | 36 | } |
| 39 | 37 | } |
@@ -29,11 +29,9 @@ |
||
| 29 | 29 | function getenv_docker($env, $default) {
|
| 30 | 30 | if ($fileEnv = getenv($env . '_FILE')) {
|
| 31 | 31 | return rtrim(file_get_contents($fileEnv), "\r\n"); |
| 32 | - } |
|
| 33 | - else if (($val = getenv($env)) !== false) {
|
|
| 32 | + } else if (($val = getenv($env)) !== false) {
|
|
| 34 | 33 | return $val; |
| 35 | - } |
|
| 36 | - else {
|
|
| 34 | + } else {
|
|
| 37 | 35 | return $default; |
| 38 | 36 | } |
| 39 | 37 | } |
@@ -3249,7 +3249,9 @@ discard block |
||
| 3249 | 3249 | |
| 3250 | 3250 | $args = array_merge( $def_args, $args ); |
| 3251 | 3251 | |
| 3252 | - } else return array(); |
|
| 3252 | + } else { |
|
| 3253 | + return array(); |
|
| 3254 | + } |
|
| 3253 | 3255 | |
| 3254 | 3256 | $operator = 'and'; |
| 3255 | 3257 | |
@@ -3301,7 +3303,9 @@ discard block |
||
| 3301 | 3303 | |
| 3302 | 3304 | $args = array_merge( $def_args, $args ); |
| 3303 | 3305 | |
| 3304 | - } else return array(); |
|
| 3306 | + } else { |
|
| 3307 | + return array(); |
|
| 3308 | + } |
|
| 3305 | 3309 | |
| 3306 | 3310 | $operator = 'and'; |
| 3307 | 3311 | |