@@ -2760,7 +2760,7 @@ discard block |
||
| 2760 | 2760 | * @since 1.0 |
| 2761 | 2761 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 2762 | 2762 | * @link http://www.georss.org/ GeoRSS |
| 2763 | - * @return string|null |
|
| 2763 | + * @return double|null |
|
| 2764 | 2764 | */ |
| 2765 | 2765 | public function get_latitude() |
| 2766 | 2766 | { |
@@ -2789,7 +2789,7 @@ discard block |
||
| 2789 | 2789 | * @since 1.0 |
| 2790 | 2790 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 2791 | 2791 | * @link http://www.georss.org/ GeoRSS |
| 2792 | - * @return string|null |
|
| 2792 | + * @return double|null |
|
| 2793 | 2793 | */ |
| 2794 | 2794 | public function get_longitude() |
| 2795 | 2795 | { |
@@ -2930,7 +2930,7 @@ discard block |
||
| 2930 | 2930 | * Uses `<image><width>` or defaults to 88.0 if no width is specified and |
| 2931 | 2931 | * the feed is an RSS 2.0 feed. |
| 2932 | 2932 | * |
| 2933 | - * @return int|float|null |
|
| 2933 | + * @return double|null |
|
| 2934 | 2934 | */ |
| 2935 | 2935 | public function get_image_width() |
| 2936 | 2936 | { |
@@ -2956,7 +2956,7 @@ discard block |
||
| 2956 | 2956 | * Uses `<image><height>` or defaults to 31.0 if no height is specified and |
| 2957 | 2957 | * the feed is an RSS 2.0 feed. |
| 2958 | 2958 | * |
| 2959 | - * @return int|float|null |
|
| 2959 | + * @return double|null |
|
| 2960 | 2960 | */ |
| 2961 | 2961 | public function get_image_height() |
| 2962 | 2962 | { |
@@ -3185,7 +3185,7 @@ discard block |
||
| 3185 | 3185 | * @access private |
| 3186 | 3186 | * @param SimplePie $a |
| 3187 | 3187 | * @param SimplePie $b |
| 3188 | - * @return boolean |
|
| 3188 | + * @return integer |
|
| 3189 | 3189 | */ |
| 3190 | 3190 | public static function sort_items($a, $b) |
| 3191 | 3191 | { |
@@ -4384,7 +4384,7 @@ discard block |
||
| 4384 | 4384 | /** |
| 4385 | 4385 | * Retrieve the last modified time for the cache |
| 4386 | 4386 | * |
| 4387 | - * @return int Timestamp |
|
| 4387 | + * @return false|string Timestamp |
|
| 4388 | 4388 | */ |
| 4389 | 4389 | public function mtime() |
| 4390 | 4390 | { |
@@ -4504,7 +4504,6 @@ discard block |
||
| 4504 | 4504 | * |
| 4505 | 4505 | * @param string $location Location string (from SimplePie::$cache_location) |
| 4506 | 4506 | * @param string $name Unique ID for the cache |
| 4507 | - * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data |
|
| 4508 | 4507 | */ |
| 4509 | 4508 | public function __construct($location, $name, $options = null) { |
| 4510 | 4509 | //$this->cache = \flow\simple\cache\Redis::getRedisClientInstance(); |
@@ -5461,7 +5460,7 @@ discard block |
||
| 5461 | 5460 | * Consume the next byte |
| 5462 | 5461 | * |
| 5463 | 5462 | * @access private |
| 5464 | - * @return mixed The next byte, or false, if there is no more data |
|
| 5463 | + * @return string|false The next byte, or false, if there is no more data |
|
| 5465 | 5464 | */ |
| 5466 | 5465 | public function consume() |
| 5467 | 5466 | { |
@@ -5481,7 +5480,7 @@ discard block |
||
| 5481 | 5480 | * |
| 5482 | 5481 | * @access private |
| 5483 | 5482 | * @param string $chars Characters to consume |
| 5484 | - * @return mixed A series of characters that match the range, or false |
|
| 5483 | + * @return string|false A series of characters that match the range, or false |
|
| 5485 | 5484 | */ |
| 5486 | 5485 | public function consume_range($chars) |
| 5487 | 5486 | { |
@@ -6571,7 +6570,7 @@ discard block |
||
| 6571 | 6570 | /** |
| 6572 | 6571 | * Get length |
| 6573 | 6572 | * |
| 6574 | - * @return float Length in bytes |
|
| 6573 | + * @return string|null Length in bytes |
|
| 6575 | 6574 | */ |
| 6576 | 6575 | public function get_length() |
| 6577 | 6576 | { |
@@ -8279,7 +8278,7 @@ discard block |
||
| 8279 | 8278 | * |
| 8280 | 8279 | * Returns false if $base is not absolute, otherwise an IRI. |
| 8281 | 8280 | * |
| 8282 | - * @param IRI|string $base (Absolute) Base IRI |
|
| 8281 | + * @param SimplePie_IRI $base (Absolute) Base IRI |
|
| 8283 | 8282 | * @param IRI|string $relative Relative IRI |
| 8284 | 8283 | * @return IRI|false |
| 8285 | 8284 | */ |
@@ -9068,7 +9067,7 @@ discard block |
||
| 9068 | 9067 | * Set the ipath. |
| 9069 | 9068 | * |
| 9070 | 9069 | * @param string $ipath |
| 9071 | - * @return bool |
|
| 9070 | + * @return null|boolean |
|
| 9072 | 9071 | */ |
| 9073 | 9072 | public function set_path($ipath, $clear_cache = false) |
| 9074 | 9073 | { |
@@ -9145,6 +9144,7 @@ discard block |
||
| 9145 | 9144 | /** |
| 9146 | 9145 | * Convert an IRI to a URI (or parts thereof) |
| 9147 | 9146 | * |
| 9147 | + * @param false|string $string |
|
| 9148 | 9148 | * @return string |
| 9149 | 9149 | */ |
| 9150 | 9150 | public function to_uri($string) |
@@ -10114,7 +10114,7 @@ discard block |
||
| 10114 | 10114 | * @since 1.0 |
| 10115 | 10115 | * |
| 10116 | 10116 | * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) |
| 10117 | - * @return int|string|null |
|
| 10117 | + * @return string|null |
|
| 10118 | 10118 | */ |
| 10119 | 10119 | public function get_local_date($date_format = '%c') |
| 10120 | 10120 | { |
@@ -10137,7 +10137,7 @@ discard block |
||
| 10137 | 10137 | * |
| 10138 | 10138 | * @see get_date |
| 10139 | 10139 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
| 10140 | - * @return int|string|null |
|
| 10140 | + * @return null|string |
|
| 10141 | 10141 | */ |
| 10142 | 10142 | public function get_gmdate($date_format = 'j F Y, g:i a') |
| 10143 | 10143 | { |
@@ -10155,7 +10155,7 @@ discard block |
||
| 10155 | 10155 | * |
| 10156 | 10156 | * @see get_updated_date |
| 10157 | 10157 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
| 10158 | - * @return int|string|null |
|
| 10158 | + * @return null|string |
|
| 10159 | 10159 | */ |
| 10160 | 10160 | public function get_updated_gmdate($date_format = 'j F Y, g:i a') |
| 10161 | 10161 | { |
@@ -12159,7 +12159,7 @@ discard block |
||
| 12159 | 12159 | * @since 1.0 |
| 12160 | 12160 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 12161 | 12161 | * @link http://www.georss.org/ GeoRSS |
| 12162 | - * @return string|null |
|
| 12162 | + * @return double|null |
|
| 12163 | 12163 | */ |
| 12164 | 12164 | public function get_latitude() |
| 12165 | 12165 | { |
@@ -12187,7 +12187,7 @@ discard block |
||
| 12187 | 12187 | * @since 1.0 |
| 12188 | 12188 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 12189 | 12189 | * @link http://www.georss.org/ GeoRSS |
| 12190 | - * @return string|null |
|
| 12190 | + * @return double|null |
|
| 12191 | 12191 | */ |
| 12192 | 12192 | public function get_longitude() |
| 12193 | 12193 | { |
@@ -12403,6 +12403,9 @@ discard block |
||
| 12403 | 12403 | } |
| 12404 | 12404 | } |
| 12405 | 12405 | |
| 12406 | + /** |
|
| 12407 | + * @param string $name |
|
| 12408 | + */ |
|
| 12406 | 12409 | protected function search_elements_by_tag($name, &$done, $feeds) |
| 12407 | 12410 | { |
| 12408 | 12411 | if ($this->dom === null) |
@@ -12621,6 +12624,9 @@ discard block |
||
| 12621 | 12624 | */ |
| 12622 | 12625 | class SimplePie_Misc |
| 12623 | 12626 | { |
| 12627 | + /** |
|
| 12628 | + * @param integer $seconds |
|
| 12629 | + */ |
|
| 12624 | 12630 | public static function time_hms($seconds) |
| 12625 | 12631 | { |
| 12626 | 12632 | $time = ''; |
@@ -12923,6 +12929,11 @@ discard block |
||
| 12923 | 12929 | } |
| 12924 | 12930 | } |
| 12925 | 12931 | |
| 12932 | + /** |
|
| 12933 | + * @param string $data |
|
| 12934 | + * @param string $input |
|
| 12935 | + * @param string $output |
|
| 12936 | + */ |
|
| 12926 | 12937 | protected static function change_encoding_mbstring($data, $input, $output) |
| 12927 | 12938 | { |
| 12928 | 12939 | if ($input === 'windows-949') |
@@ -12961,6 +12972,11 @@ discard block |
||
| 12961 | 12972 | return false; |
| 12962 | 12973 | } |
| 12963 | 12974 | |
| 12975 | + /** |
|
| 12976 | + * @param string $data |
|
| 12977 | + * @param string $input |
|
| 12978 | + * @param string $output |
|
| 12979 | + */ |
|
| 12964 | 12980 | protected static function change_encoding_iconv($data, $input, $output) |
| 12965 | 12981 | { |
| 12966 | 12982 | return @iconv($input, $output, $data); |
@@ -14301,6 +14317,9 @@ discard block |
||
| 14301 | 14317 | } |
| 14302 | 14318 | } |
| 14303 | 14319 | |
| 14320 | + /** |
|
| 14321 | + * @return string |
|
| 14322 | + */ |
|
| 14304 | 14323 | public static function get_curl_version() |
| 14305 | 14324 | { |
| 14306 | 14325 | if (is_array($curl = curl_version())) |
@@ -14368,7 +14387,6 @@ discard block |
||
| 14368 | 14387 | /** |
| 14369 | 14388 | * Remove RFC822 comments |
| 14370 | 14389 | * |
| 14371 | - * @param string $data Data to strip comments from |
|
| 14372 | 14390 | * @return string Comment stripped string |
| 14373 | 14391 | */ |
| 14374 | 14392 | public static function uncomment_rfc822($string) |
@@ -14624,7 +14642,7 @@ discard block |
||
| 14624 | 14642 | * @todo Add support for EBCDIC |
| 14625 | 14643 | * @param string $data XML data |
| 14626 | 14644 | * @param SimplePie_Registry $registry Class registry |
| 14627 | - * @return array Possible encodings |
|
| 14645 | + * @return string[] Possible encodings |
|
| 14628 | 14646 | */ |
| 14629 | 14647 | public static function xml_encoding($data, $registry) |
| 14630 | 14648 | { |
@@ -14997,7 +15015,7 @@ discard block |
||
| 14997 | 15015 | * 0:0:0:0:0:FFFF:129.144.52.38 |
| 14998 | 15016 | * |
| 14999 | 15017 | * @param string $ip An IPv6 address |
| 15000 | - * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
| 15018 | + * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
| 15001 | 15019 | */ |
| 15002 | 15020 | private static function split_v6_v4($ip) |
| 15003 | 15021 | { |
@@ -15744,7 +15762,6 @@ discard block |
||
| 15744 | 15762 | * Remove RFC822 comments |
| 15745 | 15763 | * |
| 15746 | 15764 | * @access protected |
| 15747 | - * @param string $data Data to strip comments from |
|
| 15748 | 15765 | * @return string Comment stripped string |
| 15749 | 15766 | */ |
| 15750 | 15767 | public function remove_rfc2822_comments($string) |
@@ -16258,6 +16275,9 @@ discard block |
||
| 16258 | 16275 | return $this->data; |
| 16259 | 16276 | } |
| 16260 | 16277 | |
| 16278 | + /** |
|
| 16279 | + * @param string $tag |
|
| 16280 | + */ |
|
| 16261 | 16281 | public function tag_open($parser, $tag, $attributes) |
| 16262 | 16282 | { |
| 16263 | 16283 | list($this->namespace[], $this->element[]) = $this->split_ns($tag); |
@@ -16325,6 +16345,9 @@ discard block |
||
| 16325 | 16345 | } |
| 16326 | 16346 | } |
| 16327 | 16347 | |
| 16348 | + /** |
|
| 16349 | + * @param string $cdata |
|
| 16350 | + */ |
|
| 16328 | 16351 | public function cdata($parser, $cdata) |
| 16329 | 16352 | { |
| 16330 | 16353 | if ($this->current_xhtml_construct >= 0) |
@@ -16337,6 +16360,9 @@ discard block |
||
| 16337 | 16360 | } |
| 16338 | 16361 | } |
| 16339 | 16362 | |
| 16363 | + /** |
|
| 16364 | + * @param string $tag |
|
| 16365 | + */ |
|
| 16340 | 16366 | public function tag_close($parser, $tag) |
| 16341 | 16367 | { |
| 16342 | 16368 | if ($this->current_xhtml_construct >= 0) |
@@ -16422,6 +16448,9 @@ discard block |
||
| 16422 | 16448 | return isset($data['value']) ? $data['value'] : ''; |
| 16423 | 16449 | } |
| 16424 | 16450 | |
| 16451 | + /** |
|
| 16452 | + * @param string $url |
|
| 16453 | + */ |
|
| 16425 | 16454 | private function parse_microformats(&$data, $url) { |
| 16426 | 16455 | $feed_title = ''; |
| 16427 | 16456 | $feed_author = NULL; |
@@ -16953,6 +16982,8 @@ discard block |
||
| 16953 | 16982 | * |
| 16954 | 16983 | * For documentation on all the parameters, see the corresponding |
| 16955 | 16984 | * properties and their accessors |
| 16985 | + * @param string $relationship |
|
| 16986 | + * @param string $value |
|
| 16956 | 16987 | */ |
| 16957 | 16988 | public function __construct($relationship = null, $type = null, $value = null) |
| 16958 | 16989 | { |
@@ -17390,6 +17421,9 @@ discard block |
||
| 17390 | 17421 | return $data; |
| 17391 | 17422 | } |
| 17392 | 17423 | |
| 17424 | + /** |
|
| 17425 | + * @param string $html |
|
| 17426 | + */ |
|
| 17393 | 17427 | protected function preprocess($html, $type) |
| 17394 | 17428 | { |
| 17395 | 17429 | $ret = ''; |
@@ -17414,6 +17448,9 @@ discard block |
||
| 17414 | 17448 | return $ret; |
| 17415 | 17449 | } |
| 17416 | 17450 | |
| 17451 | + /** |
|
| 17452 | + * @param DOMDocument $document |
|
| 17453 | + */ |
|
| 17417 | 17454 | public function replace_urls($document, $tag, $attributes) |
| 17418 | 17455 | { |
| 17419 | 17456 | if (!is_array($attributes)) |
@@ -17466,6 +17503,10 @@ discard block |
||
| 17466 | 17503 | } |
| 17467 | 17504 | } |
| 17468 | 17505 | |
| 17506 | + /** |
|
| 17507 | + * @param DOMDocument $document |
|
| 17508 | + * @param DOMXPath $xpath |
|
| 17509 | + */ |
|
| 17469 | 17510 | protected function strip_tag($tag, $document, $xpath, $type) |
| 17470 | 17511 | { |
| 17471 | 17512 | $elements = $xpath->query('body//' . $tag); |
@@ -17550,6 +17591,9 @@ discard block |
||
| 17550 | 17591 | } |
| 17551 | 17592 | } |
| 17552 | 17593 | |
| 17594 | + /** |
|
| 17595 | + * @param DOMXPath $xpath |
|
| 17596 | + */ |
|
| 17553 | 17597 | protected function strip_attr($attrib, $xpath) |
| 17554 | 17598 | { |
| 17555 | 17599 | $elements = $xpath->query('//*[@' . $attrib . ']'); |
@@ -17560,6 +17604,9 @@ discard block |
||
| 17560 | 17604 | } |
| 17561 | 17605 | } |
| 17562 | 17606 | |
| 17607 | + /** |
|
| 17608 | + * @param DOMDocument $document |
|
| 17609 | + */ |
|
| 17563 | 17610 | protected function add_attr($tag, $valuePairs, $document) |
| 17564 | 17611 | { |
| 17565 | 17612 | $elements = $document->getElementsByTagName($tag); |
@@ -17605,6 +17652,10 @@ discard block |
||
| 17605 | 17652 | return md5(serialize($this->data)); |
| 17606 | 17653 | } |
| 17607 | 17654 | |
| 17655 | + /** |
|
| 17656 | + * @param string $namespace |
|
| 17657 | + * @param string $tag |
|
| 17658 | + */ |
|
| 17608 | 17659 | public function get_source_tags($namespace, $tag) |
| 17609 | 17660 | { |
| 17610 | 17661 | if (isset($this->data['child'][$namespace][$tag])) |
@@ -17617,6 +17668,9 @@ discard block |
||
| 17617 | 17668 | } |
| 17618 | 17669 | } |
| 17619 | 17670 | |
| 17671 | + /** |
|
| 17672 | + * @return string |
|
| 17673 | + */ |
|
| 17620 | 17674 | public function get_base($element = array()) |
| 17621 | 17675 | { |
| 17622 | 17676 | return $this->item->get_base($element); |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | * SimplePie Useragent |
| 70 | 70 | * @see SimplePie::set_useragent() |
| 71 | 71 | */ |
| 72 | -define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD); |
|
| 72 | +define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME.'/'.SIMPLEPIE_VERSION.' (Feed Parser; '.SIMPLEPIE_URL.'; Allow like Gecko) Build/'.SIMPLEPIE_BUILD); |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * SimplePie Linkback |
| 76 | 76 | */ |
| 77 | -define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>'); |
|
| 77 | +define('SIMPLEPIE_LINKBACK', '<a href="'.SIMPLEPIE_URL.'" title="'.SIMPLEPIE_NAME.' '.SIMPLEPIE_VERSION.'">'.SIMPLEPIE_NAME.'</a>'); |
|
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * No Autodiscovery |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | { |
| 786 | 786 | $this->feed_url = $file->url; |
| 787 | 787 | $this->permanent_url = $this->feed_url; |
| 788 | - $this->file =& $file; |
|
| 788 | + $this->file = & $file; |
|
| 789 | 789 | return true; |
| 790 | 790 | } |
| 791 | 791 | return false; |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | */ |
| 874 | 874 | public function force_cache_fallback($enable = false) |
| 875 | 875 | { |
| 876 | - $this->force_cache_fallback= (bool) $enable; |
|
| 876 | + $this->force_cache_fallback = (bool) $enable; |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | /** |
@@ -1258,7 +1258,7 @@ discard block |
||
| 1258 | 1258 | { |
| 1259 | 1259 | if ($page !== false) |
| 1260 | 1260 | { |
| 1261 | - $this->sanitize->set_image_handler($page . '?' . $qs . '='); |
|
| 1261 | + $this->sanitize->set_image_handler($page.'?'.$qs.'='); |
|
| 1262 | 1262 | } |
| 1263 | 1263 | else |
| 1264 | 1264 | { |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | } |
| 1390 | 1390 | |
| 1391 | 1391 | // Empty response check |
| 1392 | - if(empty($this->raw_data)){ |
|
| 1392 | + if (empty($this->raw_data)) { |
|
| 1393 | 1393 | $this->error = "A feed could not be found at `$this->feed_url`. Empty body."; |
| 1394 | 1394 | $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); |
| 1395 | 1395 | return false; |
@@ -1455,7 +1455,7 @@ discard block |
||
| 1455 | 1455 | if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url)) |
| 1456 | 1456 | { |
| 1457 | 1457 | $this->data = $parser->get_data(); |
| 1458 | - if (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE)) |
|
| 1458 | + if (!($this->get_type()&~SIMPLEPIE_TYPE_NONE)) |
|
| 1459 | 1459 | { |
| 1460 | 1460 | $this->error = "A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed."; |
| 1461 | 1461 | $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | if (!class_exists('\UConverter')) { |
| 1501 | 1501 | $missingExtensions[] = 'intl (PHP 5.5+)'; |
| 1502 | 1502 | } |
| 1503 | - $this->error .= ' Try installing/enabling the ' . implode(' or ', $missingExtensions) . ' extension.'; |
|
| 1503 | + $this->error .= ' Try installing/enabling the '.implode(' or ', $missingExtensions).' extension.'; |
|
| 1504 | 1504 | } |
| 1505 | 1505 | } |
| 1506 | 1506 | |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | else |
| 1592 | 1592 | { |
| 1593 | 1593 | $this->check_modified = false; |
| 1594 | - if($this->force_cache_fallback) |
|
| 1594 | + if ($this->force_cache_fallback) |
|
| 1595 | 1595 | { |
| 1596 | 1596 | $cache->touch(); |
| 1597 | 1597 | return true; |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | { |
| 1621 | 1621 | if ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url) |
| 1622 | 1622 | { |
| 1623 | - $file =& $this->file; |
|
| 1623 | + $file = & $this->file; |
|
| 1624 | 1624 | } |
| 1625 | 1625 | else |
| 1626 | 1626 | { |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | } |
| 1632 | 1632 | } |
| 1633 | 1633 | // If the file connection has an error, set SimplePie::error to that and quit |
| 1634 | - if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) |
|
| 1634 | + if (!$file->success && !($file->method&SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) |
|
| 1635 | 1635 | { |
| 1636 | 1636 | $this->error = $file->error; |
| 1637 | 1637 | return !empty($this->data); |
@@ -1786,7 +1786,7 @@ discard block |
||
| 1786 | 1786 | $header = "Content-type: $mime;"; |
| 1787 | 1787 | if ($this->get_encoding()) |
| 1788 | 1788 | { |
| 1789 | - $header .= ' charset=' . $this->get_encoding(); |
|
| 1789 | + $header .= ' charset='.$this->get_encoding(); |
|
| 1790 | 1790 | } |
| 1791 | 1791 | else |
| 1792 | 1792 | { |
@@ -1978,28 +1978,28 @@ discard block |
||
| 1978 | 1978 | public function get_feed_tags($namespace, $tag) |
| 1979 | 1979 | { |
| 1980 | 1980 | $type = $this->get_type(); |
| 1981 | - if ($type & SIMPLEPIE_TYPE_ATOM_10) |
|
| 1981 | + if ($type&SIMPLEPIE_TYPE_ATOM_10) |
|
| 1982 | 1982 | { |
| 1983 | 1983 | if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag])) |
| 1984 | 1984 | { |
| 1985 | 1985 | return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]; |
| 1986 | 1986 | } |
| 1987 | 1987 | } |
| 1988 | - if ($type & SIMPLEPIE_TYPE_ATOM_03) |
|
| 1988 | + if ($type&SIMPLEPIE_TYPE_ATOM_03) |
|
| 1989 | 1989 | { |
| 1990 | 1990 | if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag])) |
| 1991 | 1991 | { |
| 1992 | 1992 | return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]; |
| 1993 | 1993 | } |
| 1994 | 1994 | } |
| 1995 | - if ($type & SIMPLEPIE_TYPE_RSS_RDF) |
|
| 1995 | + if ($type&SIMPLEPIE_TYPE_RSS_RDF) |
|
| 1996 | 1996 | { |
| 1997 | 1997 | if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag])) |
| 1998 | 1998 | { |
| 1999 | 1999 | return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]; |
| 2000 | 2000 | } |
| 2001 | 2001 | } |
| 2002 | - if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2002 | + if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2003 | 2003 | { |
| 2004 | 2004 | if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag])) |
| 2005 | 2005 | { |
@@ -2026,14 +2026,14 @@ discard block |
||
| 2026 | 2026 | public function get_channel_tags($namespace, $tag) |
| 2027 | 2027 | { |
| 2028 | 2028 | $type = $this->get_type(); |
| 2029 | - if ($type & SIMPLEPIE_TYPE_ATOM_ALL) |
|
| 2029 | + if ($type&SIMPLEPIE_TYPE_ATOM_ALL) |
|
| 2030 | 2030 | { |
| 2031 | 2031 | if ($return = $this->get_feed_tags($namespace, $tag)) |
| 2032 | 2032 | { |
| 2033 | 2033 | return $return; |
| 2034 | 2034 | } |
| 2035 | 2035 | } |
| 2036 | - if ($type & SIMPLEPIE_TYPE_RSS_10) |
|
| 2036 | + if ($type&SIMPLEPIE_TYPE_RSS_10) |
|
| 2037 | 2037 | { |
| 2038 | 2038 | if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel')) |
| 2039 | 2039 | { |
@@ -2043,7 +2043,7 @@ discard block |
||
| 2043 | 2043 | } |
| 2044 | 2044 | } |
| 2045 | 2045 | } |
| 2046 | - if ($type & SIMPLEPIE_TYPE_RSS_090) |
|
| 2046 | + if ($type&SIMPLEPIE_TYPE_RSS_090) |
|
| 2047 | 2047 | { |
| 2048 | 2048 | if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel')) |
| 2049 | 2049 | { |
@@ -2053,7 +2053,7 @@ discard block |
||
| 2053 | 2053 | } |
| 2054 | 2054 | } |
| 2055 | 2055 | } |
| 2056 | - if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2056 | + if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2057 | 2057 | { |
| 2058 | 2058 | if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel')) |
| 2059 | 2059 | { |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | public function get_image_tags($namespace, $tag) |
| 2084 | 2084 | { |
| 2085 | 2085 | $type = $this->get_type(); |
| 2086 | - if ($type & SIMPLEPIE_TYPE_RSS_10) |
|
| 2086 | + if ($type&SIMPLEPIE_TYPE_RSS_10) |
|
| 2087 | 2087 | { |
| 2088 | 2088 | if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image')) |
| 2089 | 2089 | { |
@@ -2093,7 +2093,7 @@ discard block |
||
| 2093 | 2093 | } |
| 2094 | 2094 | } |
| 2095 | 2095 | } |
| 2096 | - if ($type & SIMPLEPIE_TYPE_RSS_090) |
|
| 2096 | + if ($type&SIMPLEPIE_TYPE_RSS_090) |
|
| 2097 | 2097 | { |
| 2098 | 2098 | if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image')) |
| 2099 | 2099 | { |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | } |
| 2104 | 2104 | } |
| 2105 | 2105 | } |
| 2106 | - if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2106 | + if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION) |
|
| 2107 | 2107 | { |
| 2108 | 2108 | if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image')) |
| 2109 | 2109 | { |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | */ |
| 2131 | 2131 | public function get_base($element = array()) |
| 2132 | 2132 | { |
| 2133 | - if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base'])) |
|
| 2133 | + if (!($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base'])) |
|
| 2134 | 2134 | { |
| 2135 | 2135 | return $element['xml_base']; |
| 2136 | 2136 | } |
@@ -2578,19 +2578,19 @@ discard block |
||
| 2578 | 2578 | { |
| 2579 | 2579 | if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) |
| 2580 | 2580 | { |
| 2581 | - if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) |
|
| 2581 | + if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key])) |
|
| 2582 | 2582 | { |
| 2583 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
|
| 2584 | - $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
|
| 2583 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]); |
|
| 2584 | + $this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]; |
|
| 2585 | 2585 | } |
| 2586 | 2586 | else |
| 2587 | 2587 | { |
| 2588 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
|
| 2588 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key]; |
|
| 2589 | 2589 | } |
| 2590 | 2590 | } |
| 2591 | 2591 | elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
| 2592 | 2592 | { |
| 2593 | - $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
|
| 2593 | + $this->data['links'][substr($key, 41)] = & $this->data['links'][$key]; |
|
| 2594 | 2594 | } |
| 2595 | 2595 | $this->data['links'][$key] = array_unique($this->data['links'][$key]); |
| 2596 | 2596 | } |
@@ -2938,7 +2938,7 @@ discard block |
||
| 2938 | 2938 | { |
| 2939 | 2939 | return round($return[0]['data']); |
| 2940 | 2940 | } |
| 2941 | - elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) |
|
| 2941 | + elseif ($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) |
|
| 2942 | 2942 | { |
| 2943 | 2943 | return 88.0; |
| 2944 | 2944 | } |
@@ -2964,7 +2964,7 @@ discard block |
||
| 2964 | 2964 | { |
| 2965 | 2965 | return round($return[0]['data']); |
| 2966 | 2966 | } |
| 2967 | - elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) |
|
| 2967 | + elseif ($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) |
|
| 2968 | 2968 | { |
| 2969 | 2969 | return 31.0; |
| 2970 | 2970 | } |
@@ -3144,7 +3144,7 @@ discard block |
||
| 3144 | 3144 | |
| 3145 | 3145 | if (($url = $this->get_link()) !== null) |
| 3146 | 3146 | { |
| 3147 | - return 'https://www.google.com/s2/favicons?domain=' . urlencode($url); |
|
| 3147 | + return 'https://www.google.com/s2/favicons?domain='.urlencode($url); |
|
| 3148 | 3148 | } |
| 3149 | 3149 | |
| 3150 | 3150 | return false; |
@@ -3606,19 +3606,19 @@ discard block |
||
| 3606 | 3606 | |
| 3607 | 3607 | if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) |
| 3608 | 3608 | { |
| 3609 | - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; |
|
| 3609 | + $channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; |
|
| 3610 | 3610 | } |
| 3611 | 3611 | elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) |
| 3612 | 3612 | { |
| 3613 | - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; |
|
| 3613 | + $channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; |
|
| 3614 | 3614 | } |
| 3615 | 3615 | elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) |
| 3616 | 3616 | { |
| 3617 | - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; |
|
| 3617 | + $channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; |
|
| 3618 | 3618 | } |
| 3619 | 3619 | elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0])) |
| 3620 | 3620 | { |
| 3621 | - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; |
|
| 3621 | + $channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; |
|
| 3622 | 3622 | } |
| 3623 | 3623 | else |
| 3624 | 3624 | { |
@@ -3838,7 +3838,7 @@ discard block |
||
| 3838 | 3838 | ); |
| 3839 | 3839 | $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location)); |
| 3840 | 3840 | |
| 3841 | - $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); |
|
| 3841 | + $this->name = $this->options['extras']['prefix'].md5("$name:$type"); |
|
| 3842 | 3842 | |
| 3843 | 3843 | $this->cache = new Memcache(); |
| 3844 | 3844 | $this->cache->addServer($this->options['host'], (int) $this->options['port']); |
@@ -3972,10 +3972,10 @@ discard block |
||
| 3972 | 3972 | ); |
| 3973 | 3973 | $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location)); |
| 3974 | 3974 | |
| 3975 | - $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); |
|
| 3975 | + $this->name = $this->options['extras']['prefix'].md5("$name:$type"); |
|
| 3976 | 3976 | |
| 3977 | 3977 | $this->cache = new Memcached(); |
| 3978 | - $this->cache->addServer($this->options['host'], (int)$this->options['port']); |
|
| 3978 | + $this->cache->addServer($this->options['host'], (int) $this->options['port']); |
|
| 3979 | 3979 | } |
| 3980 | 3980 | |
| 3981 | 3981 | /** |
@@ -4009,7 +4009,7 @@ discard block |
||
| 4009 | 4009 | * @return int Timestamp |
| 4010 | 4010 | */ |
| 4011 | 4011 | public function mtime() { |
| 4012 | - $data = $this->cache->get($this->name . '_mtime'); |
|
| 4012 | + $data = $this->cache->get($this->name.'_mtime'); |
|
| 4013 | 4013 | return (int) $data; |
| 4014 | 4014 | } |
| 4015 | 4015 | |
@@ -4037,8 +4037,8 @@ discard block |
||
| 4037 | 4037 | private function setData($data) { |
| 4038 | 4038 | |
| 4039 | 4039 | if ($data !== false) { |
| 4040 | - $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']); |
|
| 4041 | - return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']); |
|
| 4040 | + $this->cache->set($this->name.'_mtime', time(), (int) $this->options['extras']['timeout']); |
|
| 4041 | + return $this->cache->set($this->name, $data, (int) $this->options['extras']['timeout']); |
|
| 4042 | 4042 | } |
| 4043 | 4043 | |
| 4044 | 4044 | return false; |
@@ -4116,7 +4116,7 @@ discard block |
||
| 4116 | 4116 | return; |
| 4117 | 4117 | } |
| 4118 | 4118 | |
| 4119 | - $this->id = $name . $type; |
|
| 4119 | + $this->id = $name.$type; |
|
| 4120 | 4120 | |
| 4121 | 4121 | if (!$query = $this->mysql->query('SHOW TABLES')) |
| 4122 | 4122 | { |
@@ -4130,23 +4130,23 @@ discard block |
||
| 4130 | 4130 | $db[] = $row; |
| 4131 | 4131 | } |
| 4132 | 4132 | |
| 4133 | - if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db)) |
|
| 4133 | + if (!in_array($this->options['extras']['prefix'].'cache_data', $db)) |
|
| 4134 | 4134 | { |
| 4135 | - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); |
|
| 4135 | + $query = $this->mysql->exec('CREATE TABLE `'.$this->options['extras']['prefix'].'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); |
|
| 4136 | 4136 | if ($query === false) |
| 4137 | 4137 | { |
| 4138 | - trigger_error("Can't create " . $this->options['extras']['prefix'] . "cache_data table, check permissions", E_USER_WARNING); |
|
| 4138 | + trigger_error("Can't create ".$this->options['extras']['prefix']."cache_data table, check permissions", E_USER_WARNING); |
|
| 4139 | 4139 | $this->mysql = null; |
| 4140 | 4140 | return; |
| 4141 | 4141 | } |
| 4142 | 4142 | } |
| 4143 | 4143 | |
| 4144 | - if (!in_array($this->options['extras']['prefix'] . 'items', $db)) |
|
| 4144 | + if (!in_array($this->options['extras']['prefix'].'items', $db)) |
|
| 4145 | 4145 | { |
| 4146 | - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); |
|
| 4146 | + $query = $this->mysql->exec('CREATE TABLE `'.$this->options['extras']['prefix'].'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); |
|
| 4147 | 4147 | if ($query === false) |
| 4148 | 4148 | { |
| 4149 | - trigger_error("Can't create " . $this->options['extras']['prefix'] . "items table, check permissions", E_USER_WARNING); |
|
| 4149 | + trigger_error("Can't create ".$this->options['extras']['prefix']."items table, check permissions", E_USER_WARNING); |
|
| 4150 | 4150 | $this->mysql = null; |
| 4151 | 4151 | return; |
| 4152 | 4152 | } |
@@ -4166,9 +4166,9 @@ discard block |
||
| 4166 | 4166 | return false; |
| 4167 | 4167 | } |
| 4168 | 4168 | |
| 4169 | - $query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' . |
|
| 4170 | - '`' . $this->options['extras']['prefix'] . 'items` i ' . |
|
| 4171 | - 'WHERE cd.id = i.feed_id ' . |
|
| 4169 | + $query = $this->mysql->prepare('DELETE i, cd FROM `'.$this->options['extras']['prefix'].'cache_data` cd, '. |
|
| 4170 | + '`'.$this->options['extras']['prefix'].'items` i '. |
|
| 4171 | + 'WHERE cd.id = i.feed_id '. |
|
| 4172 | 4172 | 'AND cd.mtime < (unix_timestamp() - :purge_time)'); |
| 4173 | 4173 | $query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']); |
| 4174 | 4174 | |
@@ -4183,7 +4183,7 @@ discard block |
||
| 4183 | 4183 | |
| 4184 | 4184 | $prepared = self::prepare_simplepie_object_for_cache($data); |
| 4185 | 4185 | |
| 4186 | - $query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); |
|
| 4186 | + $query = $this->mysql->prepare('SELECT COUNT(*) FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :feed'); |
|
| 4187 | 4187 | $query->bindValue(':feed', $this->id); |
| 4188 | 4188 | if ($query->execute()) |
| 4189 | 4189 | { |
@@ -4192,13 +4192,13 @@ discard block |
||
| 4192 | 4192 | $items = count($prepared[1]); |
| 4193 | 4193 | if ($items) |
| 4194 | 4194 | { |
| 4195 | - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed'; |
|
| 4195 | + $sql = 'UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed'; |
|
| 4196 | 4196 | $query = $this->mysql->prepare($sql); |
| 4197 | 4197 | $query->bindValue(':items', $items); |
| 4198 | 4198 | } |
| 4199 | 4199 | else |
| 4200 | 4200 | { |
| 4201 | - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed'; |
|
| 4201 | + $sql = 'UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed'; |
|
| 4202 | 4202 | $query = $this->mysql->prepare($sql); |
| 4203 | 4203 | } |
| 4204 | 4204 | |
@@ -4212,7 +4212,7 @@ discard block |
||
| 4212 | 4212 | } |
| 4213 | 4213 | else |
| 4214 | 4214 | { |
| 4215 | - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)'); |
|
| 4215 | + $query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)'); |
|
| 4216 | 4216 | $query->bindValue(':feed', $this->id); |
| 4217 | 4217 | $query->bindValue(':count', count($prepared[1])); |
| 4218 | 4218 | $query->bindValue(':data', $prepared[0]); |
@@ -4231,7 +4231,7 @@ discard block |
||
| 4231 | 4231 | $database_ids[] = $this->mysql->quote($id); |
| 4232 | 4232 | } |
| 4233 | 4233 | |
| 4234 | - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed'); |
|
| 4234 | + $query = $this->mysql->prepare('SELECT `id` FROM `'.$this->options['extras']['prefix'].'items` WHERE `id` = '.implode(' OR `id` = ', $database_ids).' AND `feed_id` = :feed'); |
|
| 4235 | 4235 | $query->bindValue(':feed', $this->id); |
| 4236 | 4236 | |
| 4237 | 4237 | if ($query->execute()) |
@@ -4251,7 +4251,7 @@ discard block |
||
| 4251 | 4251 | $date = time(); |
| 4252 | 4252 | } |
| 4253 | 4253 | |
| 4254 | - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)'); |
|
| 4254 | + $query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)'); |
|
| 4255 | 4255 | $query->bindValue(':feed', $this->id); |
| 4256 | 4256 | $query->bindValue(':id', $new_id); |
| 4257 | 4257 | $query->bindValue(':data', serialize($prepared[1][$new_id]->data)); |
@@ -4272,13 +4272,13 @@ discard block |
||
| 4272 | 4272 | } |
| 4273 | 4273 | else |
| 4274 | 4274 | { |
| 4275 | - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); |
|
| 4275 | + $query = $this->mysql->prepare('SELECT `id` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :feed'); |
|
| 4276 | 4276 | $query->bindValue(':feed', $this->id); |
| 4277 | 4277 | if ($query->execute()) |
| 4278 | 4278 | { |
| 4279 | 4279 | if ($query->rowCount() > 0) |
| 4280 | 4280 | { |
| 4281 | - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed'); |
|
| 4281 | + $query = $this->mysql->prepare('UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed'); |
|
| 4282 | 4282 | $query->bindValue(':data', serialize($data)); |
| 4283 | 4283 | $query->bindValue(':time', time()); |
| 4284 | 4284 | $query->bindValue(':feed', $this->id); |
@@ -4289,7 +4289,7 @@ discard block |
||
| 4289 | 4289 | } |
| 4290 | 4290 | else |
| 4291 | 4291 | { |
| 4292 | - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)'); |
|
| 4292 | + $query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)'); |
|
| 4293 | 4293 | $query->bindValue(':id', $this->id); |
| 4294 | 4294 | $query->bindValue(':data', serialize($data)); |
| 4295 | 4295 | $query->bindValue(':time', time()); |
@@ -4315,7 +4315,7 @@ discard block |
||
| 4315 | 4315 | return false; |
| 4316 | 4316 | } |
| 4317 | 4317 | |
| 4318 | - $query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); |
|
| 4318 | + $query = $this->mysql->prepare('SELECT `items`, `data` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id'); |
|
| 4319 | 4319 | $query->bindValue(':id', $this->id); |
| 4320 | 4320 | if ($query->execute() && ($row = $query->fetch())) |
| 4321 | 4321 | { |
@@ -4334,19 +4334,19 @@ discard block |
||
| 4334 | 4334 | { |
| 4335 | 4335 | if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) |
| 4336 | 4336 | { |
| 4337 | - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; |
|
| 4337 | + $feed = & $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; |
|
| 4338 | 4338 | } |
| 4339 | 4339 | elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) |
| 4340 | 4340 | { |
| 4341 | - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; |
|
| 4341 | + $feed = & $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; |
|
| 4342 | 4342 | } |
| 4343 | 4343 | elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) |
| 4344 | 4344 | { |
| 4345 | - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; |
|
| 4345 | + $feed = & $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; |
|
| 4346 | 4346 | } |
| 4347 | 4347 | elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0])) |
| 4348 | 4348 | { |
| 4349 | - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; |
|
| 4349 | + $feed = & $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; |
|
| 4350 | 4350 | } |
| 4351 | 4351 | else |
| 4352 | 4352 | { |
@@ -4355,10 +4355,10 @@ discard block |
||
| 4355 | 4355 | |
| 4356 | 4356 | if ($feed !== null) |
| 4357 | 4357 | { |
| 4358 | - $sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC'; |
|
| 4358 | + $sql = 'SELECT `data` FROM `'.$this->options['extras']['prefix'].'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC'; |
|
| 4359 | 4359 | if ($items > 0) |
| 4360 | 4360 | { |
| 4361 | - $sql .= ' LIMIT ' . $items; |
|
| 4361 | + $sql .= ' LIMIT '.$items; |
|
| 4362 | 4362 | } |
| 4363 | 4363 | |
| 4364 | 4364 | $query = $this->mysql->prepare($sql); |
@@ -4393,7 +4393,7 @@ discard block |
||
| 4393 | 4393 | return false; |
| 4394 | 4394 | } |
| 4395 | 4395 | |
| 4396 | - $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); |
|
| 4396 | + $query = $this->mysql->prepare('SELECT `mtime` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id'); |
|
| 4397 | 4397 | $query->bindValue(':id', $this->id); |
| 4398 | 4398 | if ($query->execute() && ($time = $query->fetchColumn())) |
| 4399 | 4399 | { |
@@ -4417,7 +4417,7 @@ discard block |
||
| 4417 | 4417 | return false; |
| 4418 | 4418 | } |
| 4419 | 4419 | |
| 4420 | - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id'); |
|
| 4420 | + $query = $this->mysql->prepare('UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `mtime` = :time WHERE `id` = :id'); |
|
| 4421 | 4421 | $query->bindValue(':time', time()); |
| 4422 | 4422 | $query->bindValue(':id', $this->id); |
| 4423 | 4423 | if ($query->execute() && $query->rowCount() > 0) |
@@ -4442,9 +4442,9 @@ discard block |
||
| 4442 | 4442 | return false; |
| 4443 | 4443 | } |
| 4444 | 4444 | |
| 4445 | - $query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); |
|
| 4445 | + $query = $this->mysql->prepare('DELETE FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id'); |
|
| 4446 | 4446 | $query->bindValue(':id', $this->id); |
| 4447 | - $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id'); |
|
| 4447 | + $query2 = $this->mysql->prepare('DELETE FROM `'.$this->options['extras']['prefix'].'items` WHERE `feed_id` = :id'); |
|
| 4448 | 4448 | $query2->bindValue(':id', $this->id); |
| 4449 | 4449 | if ($query->execute() && $query2->execute()) |
| 4450 | 4450 | { |
@@ -4516,13 +4516,13 @@ discard block |
||
| 4516 | 4516 | if (!is_null($options) && is_array($options)) { |
| 4517 | 4517 | $this->options = $options; |
| 4518 | 4518 | } else { |
| 4519 | - $this->options = array ( |
|
| 4519 | + $this->options = array( |
|
| 4520 | 4520 | 'prefix' => 'rss:simple_primary:', |
| 4521 | 4521 | 'expire' => 0, |
| 4522 | 4522 | ); |
| 4523 | 4523 | } |
| 4524 | 4524 | |
| 4525 | - $this->name = $this->options['prefix'] . $name; |
|
| 4525 | + $this->name = $this->options['prefix'].$name; |
|
| 4526 | 4526 | } |
| 4527 | 4527 | |
| 4528 | 4528 | /** |
@@ -6841,7 +6841,7 @@ discard block |
||
| 6841 | 6841 | * @param array|string $options See first paramter to {@see embed} |
| 6842 | 6842 | * @return string HTML string to output |
| 6843 | 6843 | */ |
| 6844 | - public function native_embed($options='') |
|
| 6844 | + public function native_embed($options = '') |
|
| 6845 | 6845 | { |
| 6846 | 6846 | return $this->embed($options, true); |
| 6847 | 6847 | } |
@@ -6915,7 +6915,7 @@ discard block |
||
| 6915 | 6915 | else |
| 6916 | 6916 | { |
| 6917 | 6917 | $options = explode(',', $options); |
| 6918 | - foreach($options as $option) |
|
| 6918 | + foreach ($options as $option) |
|
| 6919 | 6919 | { |
| 6920 | 6920 | $opt = explode(':', $option, 2); |
| 6921 | 6921 | if (isset($opt[0], $opt[1])) |
@@ -7050,11 +7050,11 @@ discard block |
||
| 7050 | 7050 | { |
| 7051 | 7051 | if ($native) |
| 7052 | 7052 | { |
| 7053 | - $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; |
|
| 7053 | + $embed .= "<embed src=\"".$this->get_link()."\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; |
|
| 7054 | 7054 | } |
| 7055 | 7055 | else |
| 7056 | 7056 | { |
| 7057 | - $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>"; |
|
| 7057 | + $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '".$this->get_link()."', '$loop', '$type');</script>"; |
|
| 7058 | 7058 | } |
| 7059 | 7059 | } |
| 7060 | 7060 | |
@@ -7065,11 +7065,11 @@ discard block |
||
| 7065 | 7065 | $height += 20; |
| 7066 | 7066 | if ($native) |
| 7067 | 7067 | { |
| 7068 | - $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; |
|
| 7068 | + $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; |
|
| 7069 | 7069 | } |
| 7070 | 7070 | else |
| 7071 | 7071 | { |
| 7072 | - $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>"; |
|
| 7072 | + $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."', '$placeholder', '$loop', '$mediaplayer');</script>"; |
|
| 7073 | 7073 | } |
| 7074 | 7074 | } |
| 7075 | 7075 | |
@@ -7082,16 +7082,16 @@ discard block |
||
| 7082 | 7082 | { |
| 7083 | 7083 | if ($placeholder !== '') |
| 7084 | 7084 | { |
| 7085 | - $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
| 7085 | + $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"".$this->get_link()."\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
| 7086 | 7086 | } |
| 7087 | 7087 | else |
| 7088 | 7088 | { |
| 7089 | - $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
| 7089 | + $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"".$this->get_link()."\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
| 7090 | 7090 | } |
| 7091 | 7091 | } |
| 7092 | 7092 | else |
| 7093 | 7093 | { |
| 7094 | - $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>"; |
|
| 7094 | + $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '".$this->get_link()."', '$placeholder', '$loop');</script>"; |
|
| 7095 | 7095 | } |
| 7096 | 7096 | } |
| 7097 | 7097 | |
@@ -7101,16 +7101,16 @@ discard block |
||
| 7101 | 7101 | $height += 45; |
| 7102 | 7102 | if ($native) |
| 7103 | 7103 | { |
| 7104 | - $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; |
|
| 7104 | + $embed .= "<embed type=\"application/x-mplayer2\" src=\"".$this->get_link()."\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; |
|
| 7105 | 7105 | } |
| 7106 | 7106 | else |
| 7107 | 7107 | { |
| 7108 | - $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>"; |
|
| 7108 | + $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '".$this->get_link()."');</script>"; |
|
| 7109 | 7109 | } |
| 7110 | 7110 | } |
| 7111 | 7111 | |
| 7112 | 7112 | // Everything else |
| 7113 | - else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; |
|
| 7113 | + else $embed .= '<a href="'.$this->get_link().'" class="'.$altclass.'">'.$alt.'</a>'; |
|
| 7114 | 7114 | |
| 7115 | 7115 | return $embed; |
| 7116 | 7116 | } |
@@ -7130,7 +7130,7 @@ discard block |
||
| 7130 | 7130 | { |
| 7131 | 7131 | // Mime-types by handler. |
| 7132 | 7132 | $types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash |
| 7133 | - $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player |
|
| 7133 | + $types_fmedia = array('video/flv', 'video/x-flv', 'flv-application/octet-stream'); // Flash Media Player |
|
| 7134 | 7134 | $types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime |
| 7135 | 7135 | $types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media |
| 7136 | 7136 | $types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3 |
@@ -7359,7 +7359,7 @@ discard block |
||
| 7359 | 7359 | } |
| 7360 | 7360 | if (!$force_fsockopen && function_exists('curl_exec')) |
| 7361 | 7361 | { |
| 7362 | - $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL; |
|
| 7362 | + $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE|SIMPLEPIE_FILE_SOURCE_CURL; |
|
| 7363 | 7363 | $fp = curl_init(); |
| 7364 | 7364 | $headers2 = array(); |
| 7365 | 7365 | foreach ($headers as $key => $value) |
@@ -7396,7 +7396,7 @@ discard block |
||
| 7396 | 7396 | } |
| 7397 | 7397 | if (curl_errno($fp)) |
| 7398 | 7398 | { |
| 7399 | - $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); |
|
| 7399 | + $this->error = 'cURL error '.curl_errno($fp).': '.curl_error($fp); |
|
| 7400 | 7400 | $this->success = false; |
| 7401 | 7401 | } |
| 7402 | 7402 | else |
@@ -7427,7 +7427,7 @@ discard block |
||
| 7427 | 7427 | } |
| 7428 | 7428 | else |
| 7429 | 7429 | { |
| 7430 | - $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; |
|
| 7430 | + $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE|SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; |
|
| 7431 | 7431 | $url_parts = parse_url($url); |
| 7432 | 7432 | $socket_host = $url_parts['host']; |
| 7433 | 7433 | if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') |
@@ -7442,7 +7442,7 @@ discard block |
||
| 7442 | 7442 | $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout); |
| 7443 | 7443 | if (!$fp) |
| 7444 | 7444 | { |
| 7445 | - $this->error = 'fsockopen error: ' . $errstr; |
|
| 7445 | + $this->error = 'fsockopen error: '.$errstr; |
|
| 7446 | 7446 | $this->success = false; |
| 7447 | 7447 | } |
| 7448 | 7448 | else |
@@ -7473,7 +7473,7 @@ discard block |
||
| 7473 | 7473 | |
| 7474 | 7474 | if (isset($url_parts['user']) && isset($url_parts['pass'])) |
| 7475 | 7475 | { |
| 7476 | - $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n"; |
|
| 7476 | + $out .= "Authorization: Basic ".base64_encode("$url_parts[user]:$url_parts[pass]")."\r\n"; |
|
| 7477 | 7477 | } |
| 7478 | 7478 | foreach ($headers as $key => $value) |
| 7479 | 7479 | { |
@@ -7564,7 +7564,7 @@ discard block |
||
| 7564 | 7564 | } |
| 7565 | 7565 | else |
| 7566 | 7566 | { |
| 7567 | - $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; |
|
| 7567 | + $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL|SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; |
|
| 7568 | 7568 | if (empty($url) || !($this->body = trim(file_get_contents($url)))) |
| 7569 | 7569 | { |
| 7570 | 7570 | $this->error = 'file_get_contents could not read the file'; |
@@ -7789,7 +7789,7 @@ discard block |
||
| 7789 | 7789 | // We should only use the last Content-Type header. c.f. issue #1 |
| 7790 | 7790 | if (isset($this->headers[$this->name]) && $this->name !== 'content-type') |
| 7791 | 7791 | { |
| 7792 | - $this->headers[$this->name] .= ', ' . $this->value; |
|
| 7792 | + $this->headers[$this->name] .= ', '.$this->value; |
|
| 7793 | 7793 | } |
| 7794 | 7794 | else |
| 7795 | 7795 | { |
@@ -7999,7 +7999,7 @@ discard block |
||
| 7999 | 7999 | |
| 8000 | 8000 | while (true) |
| 8001 | 8001 | { |
| 8002 | - $is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches ); |
|
| 8002 | + $is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches); |
|
| 8003 | 8003 | if (!$is_chunked) |
| 8004 | 8004 | { |
| 8005 | 8005 | // Looks like it's not chunked after all |
@@ -8154,9 +8154,9 @@ discard block |
||
| 8154 | 8154 | */ |
| 8155 | 8155 | public function __set($name, $value) |
| 8156 | 8156 | { |
| 8157 | - if (method_exists($this, 'set_' . $name)) |
|
| 8157 | + if (method_exists($this, 'set_'.$name)) |
|
| 8158 | 8158 | { |
| 8159 | - call_user_func(array($this, 'set_' . $name), $value); |
|
| 8159 | + call_user_func(array($this, 'set_'.$name), $value); |
|
| 8160 | 8160 | } |
| 8161 | 8161 | elseif ( |
| 8162 | 8162 | $name === 'iauthority' |
@@ -8167,7 +8167,7 @@ discard block |
||
| 8167 | 8167 | || $name === 'ifragment' |
| 8168 | 8168 | ) |
| 8169 | 8169 | { |
| 8170 | - call_user_func(array($this, 'set_' . substr($name, 1)), $value); |
|
| 8170 | + call_user_func(array($this, 'set_'.substr($name, 1)), $value); |
|
| 8171 | 8171 | } |
| 8172 | 8172 | } |
| 8173 | 8173 | |
@@ -8197,7 +8197,7 @@ discard block |
||
| 8197 | 8197 | $return = $this->$name; |
| 8198 | 8198 | } |
| 8199 | 8199 | // host -> ihost |
| 8200 | - elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) |
|
| 8200 | + elseif (($prop = 'i'.$name) && array_key_exists($prop, $props)) |
|
| 8201 | 8201 | { |
| 8202 | 8202 | $name = $prop; |
| 8203 | 8203 | $return = $this->$prop; |
@@ -8210,7 +8210,7 @@ discard block |
||
| 8210 | 8210 | } |
| 8211 | 8211 | else |
| 8212 | 8212 | { |
| 8213 | - trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); |
|
| 8213 | + trigger_error('Undefined property: '.get_class($this).'::'.$name, E_USER_NOTICE); |
|
| 8214 | 8214 | $return = null; |
| 8215 | 8215 | } |
| 8216 | 8216 | |
@@ -8232,7 +8232,7 @@ discard block |
||
| 8232 | 8232 | */ |
| 8233 | 8233 | public function __isset($name) |
| 8234 | 8234 | { |
| 8235 | - if (method_exists($this, 'get_' . $name) || isset($this->$name)) |
|
| 8235 | + if (method_exists($this, 'get_'.$name) || isset($this->$name)) |
|
| 8236 | 8236 | { |
| 8237 | 8237 | return true; |
| 8238 | 8238 | } |
@@ -8249,9 +8249,9 @@ discard block |
||
| 8249 | 8249 | */ |
| 8250 | 8250 | public function __unset($name) |
| 8251 | 8251 | { |
| 8252 | - if (method_exists($this, 'set_' . $name)) |
|
| 8252 | + if (method_exists($this, 'set_'.$name)) |
|
| 8253 | 8253 | { |
| 8254 | - call_user_func(array($this, 'set_' . $name), ''); |
|
| 8254 | + call_user_func(array($this, 'set_'.$name), ''); |
|
| 8255 | 8255 | } |
| 8256 | 8256 | } |
| 8257 | 8257 | |
@@ -8327,11 +8327,11 @@ discard block |
||
| 8327 | 8327 | } |
| 8328 | 8328 | elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') |
| 8329 | 8329 | { |
| 8330 | - $target->ipath = '/' . $relative->ipath; |
|
| 8330 | + $target->ipath = '/'.$relative->ipath; |
|
| 8331 | 8331 | } |
| 8332 | 8332 | elseif (($last_segment = strrpos($base->ipath, '/')) !== false) |
| 8333 | 8333 | { |
| 8334 | - $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; |
|
| 8334 | + $target->ipath = substr($base->ipath, 0, $last_segment + 1).$relative->ipath; |
|
| 8335 | 8335 | } |
| 8336 | 8336 | else |
| 8337 | 8337 | { |
@@ -8467,7 +8467,7 @@ discard block |
||
| 8467 | 8467 | $input = ''; |
| 8468 | 8468 | } |
| 8469 | 8469 | } |
| 8470 | - return $output . $input; |
|
| 8470 | + return $output.$input; |
|
| 8471 | 8471 | } |
| 8472 | 8472 | |
| 8473 | 8473 | /** |
@@ -8506,23 +8506,23 @@ discard block |
||
| 8506 | 8506 | |
| 8507 | 8507 | // No one byte sequences are valid due to the while. |
| 8508 | 8508 | // Two byte sequence: |
| 8509 | - if (($value & 0xE0) === 0xC0) |
|
| 8509 | + if (($value&0xE0) === 0xC0) |
|
| 8510 | 8510 | { |
| 8511 | - $character = ($value & 0x1F) << 6; |
|
| 8511 | + $character = ($value&0x1F) << 6; |
|
| 8512 | 8512 | $length = 2; |
| 8513 | 8513 | $remaining = 1; |
| 8514 | 8514 | } |
| 8515 | 8515 | // Three byte sequence: |
| 8516 | - elseif (($value & 0xF0) === 0xE0) |
|
| 8516 | + elseif (($value&0xF0) === 0xE0) |
|
| 8517 | 8517 | { |
| 8518 | - $character = ($value & 0x0F) << 12; |
|
| 8518 | + $character = ($value&0x0F) << 12; |
|
| 8519 | 8519 | $length = 3; |
| 8520 | 8520 | $remaining = 2; |
| 8521 | 8521 | } |
| 8522 | 8522 | // Four byte sequence: |
| 8523 | - elseif (($value & 0xF8) === 0xF0) |
|
| 8523 | + elseif (($value&0xF8) === 0xF0) |
|
| 8524 | 8524 | { |
| 8525 | - $character = ($value & 0x07) << 18; |
|
| 8525 | + $character = ($value&0x07) << 18; |
|
| 8526 | 8526 | $length = 4; |
| 8527 | 8527 | $remaining = 3; |
| 8528 | 8528 | } |
@@ -8543,9 +8543,9 @@ discard block |
||
| 8543 | 8543 | $value = ord($string[$position]); |
| 8544 | 8544 | |
| 8545 | 8545 | // Check that the byte is valid, then add it to the character: |
| 8546 | - if (($value & 0xC0) === 0x80) |
|
| 8546 | + if (($value&0xC0) === 0x80) |
|
| 8547 | 8547 | { |
| 8548 | - $character |= ($value & 0x3F) << (--$remaining * 6); |
|
| 8548 | + $character |= ($value&0x3F) << (--$remaining*6); |
|
| 8549 | 8549 | } |
| 8550 | 8550 | // If it is invalid, count the sequence as invalid and reprocess the current byte: |
| 8551 | 8551 | else |
@@ -8573,7 +8573,7 @@ discard block |
||
| 8573 | 8573 | || $length > 3 && $character <= 0xFFFF |
| 8574 | 8574 | // Outside of range of ucschar codepoints |
| 8575 | 8575 | // Noncharacters |
| 8576 | - || ($character & 0xFFFE) === 0xFFFE |
|
| 8576 | + || ($character&0xFFFE) === 0xFFFE |
|
| 8577 | 8577 | || $character >= 0xFDD0 && $character <= 0xFDEF |
| 8578 | 8578 | || ( |
| 8579 | 8579 | // Everything else not in ucschar |
@@ -8648,23 +8648,23 @@ discard block |
||
| 8648 | 8648 | $length = 1; |
| 8649 | 8649 | } |
| 8650 | 8650 | // Two byte sequence: |
| 8651 | - elseif (($value & 0xE0) === 0xC0) |
|
| 8651 | + elseif (($value&0xE0) === 0xC0) |
|
| 8652 | 8652 | { |
| 8653 | - $character = ($value & 0x1F) << 6; |
|
| 8653 | + $character = ($value&0x1F) << 6; |
|
| 8654 | 8654 | $length = 2; |
| 8655 | 8655 | $remaining = 1; |
| 8656 | 8656 | } |
| 8657 | 8657 | // Three byte sequence: |
| 8658 | - elseif (($value & 0xF0) === 0xE0) |
|
| 8658 | + elseif (($value&0xF0) === 0xE0) |
|
| 8659 | 8659 | { |
| 8660 | - $character = ($value & 0x0F) << 12; |
|
| 8660 | + $character = ($value&0x0F) << 12; |
|
| 8661 | 8661 | $length = 3; |
| 8662 | 8662 | $remaining = 2; |
| 8663 | 8663 | } |
| 8664 | 8664 | // Four byte sequence: |
| 8665 | - elseif (($value & 0xF8) === 0xF0) |
|
| 8665 | + elseif (($value&0xF8) === 0xF0) |
|
| 8666 | 8666 | { |
| 8667 | - $character = ($value & 0x07) << 18; |
|
| 8667 | + $character = ($value&0x07) << 18; |
|
| 8668 | 8668 | $length = 4; |
| 8669 | 8669 | $remaining = 3; |
| 8670 | 8670 | } |
@@ -8679,10 +8679,10 @@ discard block |
||
| 8679 | 8679 | else |
| 8680 | 8680 | { |
| 8681 | 8681 | // Check that the byte is valid, then add it to the character: |
| 8682 | - if (($value & 0xC0) === 0x80) |
|
| 8682 | + if (($value&0xC0) === 0x80) |
|
| 8683 | 8683 | { |
| 8684 | 8684 | $remaining--; |
| 8685 | - $character |= ($value & 0x3F) << ($remaining * 6); |
|
| 8685 | + $character |= ($value&0x3F) << ($remaining*6); |
|
| 8686 | 8686 | } |
| 8687 | 8687 | // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: |
| 8688 | 8688 | else |
@@ -8708,7 +8708,7 @@ discard block |
||
| 8708 | 8708 | || $character < 0x2D |
| 8709 | 8709 | || $character > 0xEFFFD |
| 8710 | 8710 | // Noncharacters |
| 8711 | - || ($character & 0xFFFE) === 0xFFFE |
|
| 8711 | + || ($character&0xFFFE) === 0xFFFE |
|
| 8712 | 8712 | || $character >= 0xFDD0 && $character <= 0xFDEF |
| 8713 | 8713 | // Everything else not in iunreserved (this is all BMP) |
| 8714 | 8714 | || $character === 0x2F |
@@ -8721,7 +8721,7 @@ discard block |
||
| 8721 | 8721 | { |
| 8722 | 8722 | for ($j = $start; $j <= $i; $j++) |
| 8723 | 8723 | { |
| 8724 | - $string .= '%' . strtoupper($bytes[$j]); |
|
| 8724 | + $string .= '%'.strtoupper($bytes[$j]); |
|
| 8725 | 8725 | } |
| 8726 | 8726 | } |
| 8727 | 8727 | else |
@@ -8740,7 +8740,7 @@ discard block |
||
| 8740 | 8740 | { |
| 8741 | 8741 | for ($j = $start; $j < $len; $j++) |
| 8742 | 8742 | { |
| 8743 | - $string .= '%' . strtoupper($bytes[$j]); |
|
| 8743 | + $string .= '%'.strtoupper($bytes[$j]); |
|
| 8744 | 8744 | } |
| 8745 | 8745 | } |
| 8746 | 8746 | |
@@ -8999,7 +8999,7 @@ discard block |
||
| 8999 | 8999 | { |
| 9000 | 9000 | if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1))) |
| 9001 | 9001 | { |
| 9002 | - $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']'; |
|
| 9002 | + $this->ihost = '['.SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)).']'; |
|
| 9003 | 9003 | } |
| 9004 | 9004 | else |
| 9005 | 9005 | { |
@@ -9095,7 +9095,7 @@ discard block |
||
| 9095 | 9095 | $removed = $this->remove_dot_segments($valid); |
| 9096 | 9096 | |
| 9097 | 9097 | $cache[$ipath] = array($valid, $removed); |
| 9098 | - $this->ipath = ($this->scheme !== null) ? $removed : $valid; |
|
| 9098 | + $this->ipath = ($this->scheme !== null) ? $removed : $valid; |
|
| 9099 | 9099 | } |
| 9100 | 9100 | |
| 9101 | 9101 | $this->scheme_normalization(); |
@@ -9182,11 +9182,11 @@ discard block |
||
| 9182 | 9182 | $iri = ''; |
| 9183 | 9183 | if ($this->scheme !== null) |
| 9184 | 9184 | { |
| 9185 | - $iri .= $this->scheme . ':'; |
|
| 9185 | + $iri .= $this->scheme.':'; |
|
| 9186 | 9186 | } |
| 9187 | 9187 | if (($iauthority = $this->get_iauthority()) !== null) |
| 9188 | 9188 | { |
| 9189 | - $iri .= '//' . $iauthority; |
|
| 9189 | + $iri .= '//'.$iauthority; |
|
| 9190 | 9190 | } |
| 9191 | 9191 | if ($this->ipath !== '') |
| 9192 | 9192 | { |
@@ -9198,11 +9198,11 @@ discard block |
||
| 9198 | 9198 | } |
| 9199 | 9199 | if ($this->iquery !== null) |
| 9200 | 9200 | { |
| 9201 | - $iri .= '?' . $this->iquery; |
|
| 9201 | + $iri .= '?'.$this->iquery; |
|
| 9202 | 9202 | } |
| 9203 | 9203 | if ($this->ifragment !== null) |
| 9204 | 9204 | { |
| 9205 | - $iri .= '#' . $this->ifragment; |
|
| 9205 | + $iri .= '#'.$this->ifragment; |
|
| 9206 | 9206 | } |
| 9207 | 9207 | |
| 9208 | 9208 | return $iri; |
@@ -9230,7 +9230,7 @@ discard block |
||
| 9230 | 9230 | $iauthority = ''; |
| 9231 | 9231 | if ($this->iuserinfo !== null) |
| 9232 | 9232 | { |
| 9233 | - $iauthority .= $this->iuserinfo . '@'; |
|
| 9233 | + $iauthority .= $this->iuserinfo.'@'; |
|
| 9234 | 9234 | } |
| 9235 | 9235 | if ($this->ihost !== null) |
| 9236 | 9236 | { |
@@ -9238,7 +9238,7 @@ discard block |
||
| 9238 | 9238 | } |
| 9239 | 9239 | if ($this->port !== null) |
| 9240 | 9240 | { |
| 9241 | - $iauthority .= ':' . $this->port; |
|
| 9241 | + $iauthority .= ':'.$this->port; |
|
| 9242 | 9242 | } |
| 9243 | 9243 | return $iauthority; |
| 9244 | 9244 | } |
@@ -10273,19 +10273,19 @@ discard block |
||
| 10273 | 10273 | { |
| 10274 | 10274 | if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) |
| 10275 | 10275 | { |
| 10276 | - if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) |
|
| 10276 | + if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key])) |
|
| 10277 | 10277 | { |
| 10278 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
|
| 10279 | - $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
|
| 10278 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]); |
|
| 10279 | + $this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]; |
|
| 10280 | 10280 | } |
| 10281 | 10281 | else |
| 10282 | 10282 | { |
| 10283 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
|
| 10283 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key]; |
|
| 10284 | 10284 | } |
| 10285 | 10285 | } |
| 10286 | 10286 | elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
| 10287 | 10287 | { |
| 10288 | - $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
|
| 10288 | + $this->data['links'][substr($key, 41)] = & $this->data['links'][$key]; |
|
| 10289 | 10289 | } |
| 10290 | 10290 | $this->data['links'][$key] = array_unique($this->data['links'][$key]); |
| 10291 | 10291 | } |
@@ -10626,12 +10626,12 @@ discard block |
||
| 10626 | 10626 | if (sizeof($temp) > 0) |
| 10627 | 10627 | { |
| 10628 | 10628 | $minutes = (int) array_pop($temp); |
| 10629 | - $seconds += $minutes * 60; |
|
| 10629 | + $seconds += $minutes*60; |
|
| 10630 | 10630 | } |
| 10631 | 10631 | if (sizeof($temp) > 0) |
| 10632 | 10632 | { |
| 10633 | 10633 | $hours = (int) array_pop($temp); |
| 10634 | - $seconds += $hours * 3600; |
|
| 10634 | + $seconds += $hours*3600; |
|
| 10635 | 10635 | } |
| 10636 | 10636 | unset($temp); |
| 10637 | 10637 | $duration_parent = $seconds; |
@@ -10986,7 +10986,7 @@ discard block |
||
| 10986 | 10986 | // If we have media:group tags, loop through them. |
| 10987 | 10987 | foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group) |
| 10988 | 10988 | { |
| 10989 | - if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) |
|
| 10989 | + if (isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) |
|
| 10990 | 10990 | { |
| 10991 | 10991 | // If we have media:content tags, loop through them. |
| 10992 | 10992 | foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) |
@@ -12284,7 +12284,7 @@ discard block |
||
| 12284 | 12284 | return $this->file; |
| 12285 | 12285 | } |
| 12286 | 12286 | |
| 12287 | - if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) |
|
| 12287 | + if ($this->file->method&SIMPLEPIE_FILE_SOURCE_REMOTE) |
|
| 12288 | 12288 | { |
| 12289 | 12289 | $sniffer = $this->registry->create('Content_Type_Sniffer', array($this->file)); |
| 12290 | 12290 | if ($sniffer->get_type() !== 'text/html') |
@@ -12293,34 +12293,34 @@ discard block |
||
| 12293 | 12293 | } |
| 12294 | 12294 | } |
| 12295 | 12295 | |
| 12296 | - if ($type & ~SIMPLEPIE_LOCATOR_NONE) |
|
| 12296 | + if ($type&~SIMPLEPIE_LOCATOR_NONE) |
|
| 12297 | 12297 | { |
| 12298 | 12298 | $this->get_base(); |
| 12299 | 12299 | } |
| 12300 | 12300 | |
| 12301 | - if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) |
|
| 12301 | + if ($type&SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) |
|
| 12302 | 12302 | { |
| 12303 | 12303 | return $working[0]; |
| 12304 | 12304 | } |
| 12305 | 12305 | |
| 12306 | - if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links()) |
|
| 12306 | + if ($type&(SIMPLEPIE_LOCATOR_LOCAL_EXTENSION|SIMPLEPIE_LOCATOR_LOCAL_BODY|SIMPLEPIE_LOCATOR_REMOTE_EXTENSION|SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links()) |
|
| 12307 | 12307 | { |
| 12308 | - if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local)) |
|
| 12308 | + if ($type&SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local)) |
|
| 12309 | 12309 | { |
| 12310 | 12310 | return $working[0]; |
| 12311 | 12311 | } |
| 12312 | 12312 | |
| 12313 | - if ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local)) |
|
| 12313 | + if ($type&SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local)) |
|
| 12314 | 12314 | { |
| 12315 | 12315 | return $working[0]; |
| 12316 | 12316 | } |
| 12317 | 12317 | |
| 12318 | - if ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere)) |
|
| 12318 | + if ($type&SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere)) |
|
| 12319 | 12319 | { |
| 12320 | 12320 | return $working[0]; |
| 12321 | 12321 | } |
| 12322 | 12322 | |
| 12323 | - if ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere)) |
|
| 12323 | + if ($type&SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere)) |
|
| 12324 | 12324 | { |
| 12325 | 12325 | return $working[0]; |
| 12326 | 12326 | } |
@@ -12330,7 +12330,7 @@ discard block |
||
| 12330 | 12330 | |
| 12331 | 12331 | public function is_feed($file, $check_html = false) |
| 12332 | 12332 | { |
| 12333 | - if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) |
|
| 12333 | + if ($file->method&SIMPLEPIE_FILE_SOURCE_REMOTE) |
|
| 12334 | 12334 | { |
| 12335 | 12335 | $sniffer = $this->registry->create('Content_Type_Sniffer', array($file)); |
| 12336 | 12336 | $sniffed = $sniffer->get_type(); |
@@ -12350,7 +12350,7 @@ discard block |
||
| 12350 | 12350 | return false; |
| 12351 | 12351 | } |
| 12352 | 12352 | } |
| 12353 | - elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
| 12353 | + elseif ($file->method&SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
| 12354 | 12354 | { |
| 12355 | 12355 | return true; |
| 12356 | 12356 | } |
@@ -12442,7 +12442,7 @@ discard block |
||
| 12442 | 12442 | 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', |
| 12443 | 12443 | ); |
| 12444 | 12444 | $feed = $this->registry->create('File', array($href, $this->timeout, 5, $headers, $this->useragent)); |
| 12445 | - 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, true)) |
|
| 12445 | + 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, true)) |
|
| 12446 | 12446 | { |
| 12447 | 12447 | $feeds[$href] = $feed; |
| 12448 | 12448 | } |
@@ -12572,7 +12572,7 @@ discard block |
||
| 12572 | 12572 | 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', |
| 12573 | 12573 | ); |
| 12574 | 12574 | $feed = $this->registry->create('File', array($value, $this->timeout, 5, $headers, $this->useragent)); |
| 12575 | - 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)) |
|
| 12575 | + 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)) |
|
| 12576 | 12576 | { |
| 12577 | 12577 | return array($feed); |
| 12578 | 12578 | } |
@@ -12600,7 +12600,7 @@ discard block |
||
| 12600 | 12600 | 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', |
| 12601 | 12601 | ); |
| 12602 | 12602 | $feed = $this->registry->create('File', array($value, $this->timeout, 5, null, $this->useragent)); |
| 12603 | - 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)) |
|
| 12603 | + 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)) |
|
| 12604 | 12604 | { |
| 12605 | 12605 | return array($feed); |
| 12606 | 12606 | } |
@@ -12625,22 +12625,22 @@ discard block |
||
| 12625 | 12625 | { |
| 12626 | 12626 | $time = ''; |
| 12627 | 12627 | |
| 12628 | - $hours = floor($seconds / 3600); |
|
| 12629 | - $remainder = $seconds % 3600; |
|
| 12628 | + $hours = floor($seconds/3600); |
|
| 12629 | + $remainder = $seconds%3600; |
|
| 12630 | 12630 | if ($hours > 0) |
| 12631 | 12631 | { |
| 12632 | 12632 | $time .= $hours.':'; |
| 12633 | 12633 | } |
| 12634 | 12634 | |
| 12635 | - $minutes = floor($remainder / 60); |
|
| 12636 | - $seconds = $remainder % 60; |
|
| 12635 | + $minutes = floor($remainder/60); |
|
| 12636 | + $seconds = $remainder%60; |
|
| 12637 | 12637 | if ($minutes < 10 && $hours > 0) |
| 12638 | 12638 | { |
| 12639 | - $minutes = '0' . $minutes; |
|
| 12639 | + $minutes = '0'.$minutes; |
|
| 12640 | 12640 | } |
| 12641 | 12641 | if ($seconds < 10) |
| 12642 | 12642 | { |
| 12643 | - $seconds = '0' . $seconds; |
|
| 12643 | + $seconds = '0'.$seconds; |
|
| 12644 | 12644 | } |
| 12645 | 12645 | |
| 12646 | 12646 | $time .= $minutes.':'; |
@@ -12671,7 +12671,7 @@ discard block |
||
| 12671 | 12671 | { |
| 12672 | 12672 | $return = array(); |
| 12673 | 12673 | $name = preg_quote($realname, '/'); |
| 12674 | - if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) |
|
| 12674 | + if (preg_match_all("/<($name)".SIMPLEPIE_PCRE_HTML_ATTRIBUTE."(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE)) |
|
| 12675 | 12675 | { |
| 12676 | 12676 | for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++) |
| 12677 | 12677 | { |
@@ -12688,7 +12688,7 @@ discard block |
||
| 12688 | 12688 | $return[$i]['content'] = $matches[$i][4][0]; |
| 12689 | 12689 | } |
| 12690 | 12690 | $return[$i]['attribs'] = array(); |
| 12691 | - if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) |
|
| 12691 | + if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' '.$matches[$i][2][0].' ', $attribs, PREG_SET_ORDER)) |
|
| 12692 | 12692 | { |
| 12693 | 12693 | for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) |
| 12694 | 12694 | { |
@@ -12710,7 +12710,7 @@ discard block |
||
| 12710 | 12710 | foreach ($element['attribs'] as $key => $value) |
| 12711 | 12711 | { |
| 12712 | 12712 | $key = strtolower($key); |
| 12713 | - $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"'; |
|
| 12713 | + $full .= " $key=\"".htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8').'"'; |
|
| 12714 | 12714 | } |
| 12715 | 12715 | if ($element['self_closing']) |
| 12716 | 12716 | { |
@@ -12725,7 +12725,7 @@ discard block |
||
| 12725 | 12725 | |
| 12726 | 12726 | public static function error($message, $level, $file, $line) |
| 12727 | 12727 | { |
| 12728 | - if ((ini_get('error_reporting') & $level) > 0) |
|
| 12728 | + if ((ini_get('error_reporting')&$level) > 0) |
|
| 12729 | 12729 | { |
| 12730 | 12730 | switch ($level) |
| 12731 | 12731 | { |
@@ -14343,7 +14343,7 @@ discard block |
||
| 14343 | 14343 | $data = ''; |
| 14344 | 14344 | } |
| 14345 | 14345 | } |
| 14346 | - return $output . $data; |
|
| 14346 | + return $output.$data; |
|
| 14347 | 14347 | } |
| 14348 | 14348 | |
| 14349 | 14349 | public static function parse_date($dt) |
@@ -14453,23 +14453,23 @@ discard block |
||
| 14453 | 14453 | { |
| 14454 | 14454 | case 'text': |
| 14455 | 14455 | case 'text/plain': |
| 14456 | - return SIMPLEPIE_CONSTRUCT_TEXT | $mode; |
|
| 14456 | + return SIMPLEPIE_CONSTRUCT_TEXT|$mode; |
|
| 14457 | 14457 | |
| 14458 | 14458 | case 'html': |
| 14459 | 14459 | case 'text/html': |
| 14460 | - return SIMPLEPIE_CONSTRUCT_HTML | $mode; |
|
| 14460 | + return SIMPLEPIE_CONSTRUCT_HTML|$mode; |
|
| 14461 | 14461 | |
| 14462 | 14462 | case 'xhtml': |
| 14463 | 14463 | case 'application/xhtml+xml': |
| 14464 | - return SIMPLEPIE_CONSTRUCT_XHTML | $mode; |
|
| 14464 | + return SIMPLEPIE_CONSTRUCT_XHTML|$mode; |
|
| 14465 | 14465 | |
| 14466 | 14466 | default: |
| 14467 | - return SIMPLEPIE_CONSTRUCT_NONE | $mode; |
|
| 14467 | + return SIMPLEPIE_CONSTRUCT_NONE|$mode; |
|
| 14468 | 14468 | } |
| 14469 | 14469 | } |
| 14470 | 14470 | else |
| 14471 | 14471 | { |
| 14472 | - return SIMPLEPIE_CONSTRUCT_TEXT | $mode; |
|
| 14472 | + return SIMPLEPIE_CONSTRUCT_TEXT|$mode; |
|
| 14473 | 14473 | } |
| 14474 | 14474 | } |
| 14475 | 14475 | |
@@ -14570,15 +14570,15 @@ discard block |
||
| 14570 | 14570 | } |
| 14571 | 14571 | else if ($codepoint <= 0x7ff) |
| 14572 | 14572 | { |
| 14573 | - return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); |
|
| 14573 | + return chr(0xc0|($codepoint >> 6)).chr(0x80|($codepoint&0x3f)); |
|
| 14574 | 14574 | } |
| 14575 | 14575 | else if ($codepoint <= 0xffff) |
| 14576 | 14576 | { |
| 14577 | - return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
|
| 14577 | + return chr(0xe0|($codepoint >> 12)).chr(0x80|(($codepoint >> 6)&0x3f)).chr(0x80|($codepoint&0x3f)); |
|
| 14578 | 14578 | } |
| 14579 | 14579 | else if ($codepoint <= 0x10ffff) |
| 14580 | 14580 | { |
| 14581 | - return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
|
| 14581 | + return chr(0xf0|($codepoint >> 18)).chr(0x80|(($codepoint >> 12)&0x3f)).chr(0x80|(($codepoint >> 6)&0x3f)).chr(0x80|($codepoint&0x3f)); |
|
| 14582 | 14582 | } |
| 14583 | 14583 | else |
| 14584 | 14584 | { |
@@ -14734,7 +14734,7 @@ discard block |
||
| 14734 | 14734 | } |
| 14735 | 14735 | header('Content-type: text/javascript; charset: UTF-8'); |
| 14736 | 14736 | header('Cache-Control: must-revalidate'); |
| 14737 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days |
|
| 14737 | + header('Expires: '.gmdate('D, d M Y H:i:s', time() + 604800).' GMT'); // 7 days |
|
| 14738 | 14738 | ?> |
| 14739 | 14739 | function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { |
| 14740 | 14740 | if (placeholder != '') { |
@@ -14768,14 +14768,14 @@ discard block |
||
| 14768 | 14768 | public static function get_build() |
| 14769 | 14769 | { |
| 14770 | 14770 | $root = dirname(dirname(__FILE__)); |
| 14771 | - if (file_exists($root . '/.git/index')) |
|
| 14771 | + if (file_exists($root.'/.git/index')) |
|
| 14772 | 14772 | { |
| 14773 | - return filemtime($root . '/.git/index'); |
|
| 14773 | + return filemtime($root.'/.git/index'); |
|
| 14774 | 14774 | } |
| 14775 | - elseif (file_exists($root . '/SimplePie')) |
|
| 14775 | + elseif (file_exists($root.'/SimplePie')) |
|
| 14776 | 14776 | { |
| 14777 | 14777 | $time = 0; |
| 14778 | - foreach (glob($root . '/SimplePie/*.php') as $file) |
|
| 14778 | + foreach (glob($root.'/SimplePie/*.php') as $file) |
|
| 14779 | 14779 | { |
| 14780 | 14780 | if (($mtime = filemtime($file)) > $time) |
| 14781 | 14781 | { |
@@ -14784,9 +14784,9 @@ discard block |
||
| 14784 | 14784 | } |
| 14785 | 14785 | return $time; |
| 14786 | 14786 | } |
| 14787 | - elseif (file_exists(dirname(__FILE__) . '/Core.php')) |
|
| 14787 | + elseif (file_exists(dirname(__FILE__).'/Core.php')) |
|
| 14788 | 14788 | { |
| 14789 | - return filemtime(dirname(__FILE__) . '/Core.php'); |
|
| 14789 | + return filemtime(dirname(__FILE__).'/Core.php'); |
|
| 14790 | 14790 | } |
| 14791 | 14791 | else |
| 14792 | 14792 | { |
@@ -14799,11 +14799,11 @@ discard block |
||
| 14799 | 14799 | */ |
| 14800 | 14800 | public static function debug(&$sp) |
| 14801 | 14801 | { |
| 14802 | - $info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n"; |
|
| 14803 | - $info .= 'PHP ' . PHP_VERSION . "\n"; |
|
| 14802 | + $info = 'SimplePie '.SIMPLEPIE_VERSION.' Build '.SIMPLEPIE_BUILD."\n"; |
|
| 14803 | + $info .= 'PHP '.PHP_VERSION."\n"; |
|
| 14804 | 14804 | if ($sp->error() !== null) |
| 14805 | 14805 | { |
| 14806 | - $info .= 'Error occurred: ' . $sp->error() . "\n"; |
|
| 14806 | + $info .= 'Error occurred: '.$sp->error()."\n"; |
|
| 14807 | 14807 | } |
| 14808 | 14808 | else |
| 14809 | 14809 | { |
@@ -14819,20 +14819,20 @@ discard block |
||
| 14819 | 14819 | switch ($ext) |
| 14820 | 14820 | { |
| 14821 | 14821 | case 'pcre': |
| 14822 | - $info .= ' Version ' . PCRE_VERSION . "\n"; |
|
| 14822 | + $info .= ' Version '.PCRE_VERSION."\n"; |
|
| 14823 | 14823 | break; |
| 14824 | 14824 | case 'curl': |
| 14825 | 14825 | $version = curl_version(); |
| 14826 | - $info .= ' Version ' . $version['version'] . "\n"; |
|
| 14826 | + $info .= ' Version '.$version['version']."\n"; |
|
| 14827 | 14827 | break; |
| 14828 | 14828 | case 'mbstring': |
| 14829 | - $info .= ' Overloading: ' . mb_get_info('func_overload') . "\n"; |
|
| 14829 | + $info .= ' Overloading: '.mb_get_info('func_overload')."\n"; |
|
| 14830 | 14830 | break; |
| 14831 | 14831 | case 'iconv': |
| 14832 | - $info .= ' Version ' . ICONV_VERSION . "\n"; |
|
| 14832 | + $info .= ' Version '.ICONV_VERSION."\n"; |
|
| 14833 | 14833 | break; |
| 14834 | 14834 | case 'xml': |
| 14835 | - $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n"; |
|
| 14835 | + $info .= ' Version '.LIBXML_DOTTED_VERSION."\n"; |
|
| 14836 | 14836 | break; |
| 14837 | 14837 | } |
| 14838 | 14838 | } |
@@ -14930,7 +14930,7 @@ discard block |
||
| 14930 | 14930 | // xxx::xxx |
| 14931 | 14931 | else |
| 14932 | 14932 | { |
| 14933 | - $fill = ':' . str_repeat('0:', 6 - $c2 - $c1); |
|
| 14933 | + $fill = ':'.str_repeat('0:', 6 - $c2 - $c1); |
|
| 14934 | 14934 | $ip = str_replace('::', $fill, $ip); |
| 14935 | 14935 | } |
| 14936 | 14936 | } |
@@ -15581,8 +15581,8 @@ discard block |
||
| 15581 | 15581 | */ |
| 15582 | 15582 | public function __construct() |
| 15583 | 15583 | { |
| 15584 | - $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; |
|
| 15585 | - $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; |
|
| 15584 | + $this->day_pcre = '('.implode(array_keys($this->day), '|').')'; |
|
| 15585 | + $this->month_pcre = '('.implode(array_keys($this->month), '|').')'; |
|
| 15586 | 15586 | |
| 15587 | 15587 | static $cache; |
| 15588 | 15588 | if (!isset($cache[get_class($this)])) |
@@ -15684,7 +15684,7 @@ discard block |
||
| 15684 | 15684 | $month = $day = $hour = $minute = $second = '([0-9]{2})'; |
| 15685 | 15685 | $decimal = '([0-9]*)'; |
| 15686 | 15686 | $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))'; |
| 15687 | - $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/'; |
|
| 15687 | + $pcre = '/^'.$year.'(?:-?'.$month.'(?:-?'.$day.'(?:[Tt\x09\x20]+'.$hour.'(?::?'.$minute.'(?::?'.$second.'(?:.'.$decimal.')?)?)?'.$zone.')?)?)?$/'; |
|
| 15688 | 15688 | } |
| 15689 | 15689 | if (preg_match($pcre, $date, $match)) |
| 15690 | 15690 | { |
@@ -15717,8 +15717,8 @@ discard block |
||
| 15717 | 15717 | // Numeric timezone |
| 15718 | 15718 | if (isset($match[9]) && $match[9] !== '') |
| 15719 | 15719 | { |
| 15720 | - $timezone = $match[10] * 3600; |
|
| 15721 | - $timezone += $match[11] * 60; |
|
| 15720 | + $timezone = $match[10]*3600; |
|
| 15721 | + $timezone += $match[11]*60; |
|
| 15722 | 15722 | if ($match[9] === '-') |
| 15723 | 15723 | { |
| 15724 | 15724 | $timezone = 0 - $timezone; |
@@ -15730,7 +15730,7 @@ discard block |
||
| 15730 | 15730 | } |
| 15731 | 15731 | |
| 15732 | 15732 | // Convert the number of seconds to an integer, taking decimals into account |
| 15733 | - $second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7]))); |
|
| 15733 | + $second = round((int) $match[6] + (int) $match[7]/pow(10, strlen($match[7]))); |
|
| 15734 | 15734 | |
| 15735 | 15735 | return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; |
| 15736 | 15736 | } |
@@ -15813,8 +15813,8 @@ discard block |
||
| 15813 | 15813 | if (!$pcre) |
| 15814 | 15814 | { |
| 15815 | 15815 | $wsp = '[\x09\x20]'; |
| 15816 | - $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)'; |
|
| 15817 | - $optional_fws = $fws . '?'; |
|
| 15816 | + $fws = '(?:'.$wsp.'+|'.$wsp.'*(?:\x0D\x0A'.$wsp.'+)+)'; |
|
| 15817 | + $optional_fws = $fws.'?'; |
|
| 15818 | 15818 | $day_name = $this->day_pcre; |
| 15819 | 15819 | $month = $this->month_pcre; |
| 15820 | 15820 | $day = '([0-9]{1,2})'; |
@@ -15822,8 +15822,8 @@ discard block |
||
| 15822 | 15822 | $year = '([0-9]{2,4})'; |
| 15823 | 15823 | $num_zone = '([+\-])([0-9]{2})([0-9]{2})'; |
| 15824 | 15824 | $character_zone = '([A-Z]{1,5})'; |
| 15825 | - $zone = '(?:' . $num_zone . '|' . $character_zone . ')'; |
|
| 15826 | - $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i'; |
|
| 15825 | + $zone = '(?:'.$num_zone.'|'.$character_zone.')'; |
|
| 15826 | + $pcre = '/(?:'.$optional_fws.$day_name.$optional_fws.',)?'.$optional_fws.$day.$fws.$month.$fws.$year.$fws.$hour.$optional_fws.':'.$optional_fws.$minute.'(?:'.$optional_fws.':'.$optional_fws.$second.')?'.$fws.$zone.'/i'; |
|
| 15827 | 15827 | } |
| 15828 | 15828 | if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match)) |
| 15829 | 15829 | { |
@@ -15848,8 +15848,8 @@ discard block |
||
| 15848 | 15848 | // Numeric timezone |
| 15849 | 15849 | if ($match[8] !== '') |
| 15850 | 15850 | { |
| 15851 | - $timezone = $match[9] * 3600; |
|
| 15852 | - $timezone += $match[10] * 60; |
|
| 15851 | + $timezone = $match[9]*3600; |
|
| 15852 | + $timezone += $match[10]*60; |
|
| 15853 | 15853 | if ($match[8] === '-') |
| 15854 | 15854 | { |
| 15855 | 15855 | $timezone = 0 - $timezone; |
@@ -15911,7 +15911,7 @@ discard block |
||
| 15911 | 15911 | $day = '([0-9]{1,2})'; |
| 15912 | 15912 | $year = $hour = $minute = $second = '([0-9]{2})'; |
| 15913 | 15913 | $zone = '([A-Z]{1,5})'; |
| 15914 | - $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i'; |
|
| 15914 | + $pcre = '/^'.$day_name.','.$space.$day.'-'.$month.'-'.$year.$space.$hour.':'.$minute.':'.$second.$space.$zone.'$/i'; |
|
| 15915 | 15915 | } |
| 15916 | 15916 | if (preg_match($pcre, $date, $match)) |
| 15917 | 15917 | { |
@@ -15977,7 +15977,7 @@ discard block |
||
| 15977 | 15977 | $hour = $sec = $min = '([0-9]{2})'; |
| 15978 | 15978 | $year = '([0-9]{4})'; |
| 15979 | 15979 | $terminator = '\x0A?\x00?'; |
| 15980 | - $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i'; |
|
| 15980 | + $pcre = '/^'.$wday_name.$space.$mon_name.$space.$day.$space.$hour.':'.$min.':'.$sec.$space.$year.$terminator.'$/i'; |
|
| 15981 | 15981 | } |
| 15982 | 15982 | if (preg_match($pcre, $date, $match)) |
| 15983 | 15983 | { |
@@ -16113,7 +16113,7 @@ discard block |
||
| 16113 | 16113 | if ($declaration->parse()) |
| 16114 | 16114 | { |
| 16115 | 16115 | $data = substr($data, $pos + 2); |
| 16116 | - $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data; |
|
| 16116 | + $data = '<?xml version="'.$declaration->version.'" encoding="'.$encoding.'" standalone="'.(($declaration->standalone) ? 'yes' : 'no').'"?>'."\n".$this->declare_html_entities().$data; |
|
| 16117 | 16117 | } |
| 16118 | 16118 | else |
| 16119 | 16119 | { |
@@ -16169,7 +16169,7 @@ discard block |
||
| 16169 | 16169 | case constant('XMLReader::END_ELEMENT'): |
| 16170 | 16170 | if ($xml->namespaceURI !== '') |
| 16171 | 16171 | { |
| 16172 | - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
| 16172 | + $tagName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
| 16173 | 16173 | } |
| 16174 | 16174 | else |
| 16175 | 16175 | { |
@@ -16181,7 +16181,7 @@ discard block |
||
| 16181 | 16181 | $empty = $xml->isEmptyElement; |
| 16182 | 16182 | if ($xml->namespaceURI !== '') |
| 16183 | 16183 | { |
| 16184 | - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
| 16184 | + $tagName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
| 16185 | 16185 | } |
| 16186 | 16186 | else |
| 16187 | 16187 | { |
@@ -16192,7 +16192,7 @@ discard block |
||
| 16192 | 16192 | { |
| 16193 | 16193 | if ($xml->namespaceURI !== '') |
| 16194 | 16194 | { |
| 16195 | - $attrName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
| 16195 | + $attrName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
| 16196 | 16196 | } |
| 16197 | 16197 | else |
| 16198 | 16198 | { |
@@ -16298,12 +16298,12 @@ discard block |
||
| 16298 | 16298 | $this->current_xhtml_construct++; |
| 16299 | 16299 | if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML) |
| 16300 | 16300 | { |
| 16301 | - $this->data['data'] .= '<' . end($this->element); |
|
| 16301 | + $this->data['data'] .= '<'.end($this->element); |
|
| 16302 | 16302 | if (isset($attribs[''])) |
| 16303 | 16303 | { |
| 16304 | 16304 | foreach ($attribs[''] as $name => $value) |
| 16305 | 16305 | { |
| 16306 | - $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"'; |
|
| 16306 | + $this->data['data'] .= ' '.$name.'="'.htmlspecialchars($value, ENT_COMPAT, $this->encoding).'"'; |
|
| 16307 | 16307 | } |
| 16308 | 16308 | } |
| 16309 | 16309 | $this->data['data'] .= '>'; |
@@ -16311,8 +16311,8 @@ discard block |
||
| 16311 | 16311 | } |
| 16312 | 16312 | else |
| 16313 | 16313 | { |
| 16314 | - $this->datas[] =& $this->data; |
|
| 16315 | - $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; |
|
| 16314 | + $this->datas[] = & $this->data; |
|
| 16315 | + $this->data = & $this->data['child'][end($this->namespace)][end($this->element)][]; |
|
| 16316 | 16316 | $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); |
| 16317 | 16317 | if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') |
| 16318 | 16318 | || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml') |
@@ -16344,12 +16344,12 @@ discard block |
||
| 16344 | 16344 | $this->current_xhtml_construct--; |
| 16345 | 16345 | if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) |
| 16346 | 16346 | { |
| 16347 | - $this->data['data'] .= '</' . end($this->element) . '>'; |
|
| 16347 | + $this->data['data'] .= '</'.end($this->element).'>'; |
|
| 16348 | 16348 | } |
| 16349 | 16349 | } |
| 16350 | 16350 | if ($this->current_xhtml_construct === -1) |
| 16351 | 16351 | { |
| 16352 | - $this->data =& $this->datas[count($this->datas) - 1]; |
|
| 16352 | + $this->data = & $this->datas[count($this->datas) - 1]; |
|
| 16353 | 16353 | array_pop($this->datas); |
| 16354 | 16354 | } |
| 16355 | 16355 | |
@@ -16384,7 +16384,7 @@ discard block |
||
| 16384 | 16384 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 || |
| 16385 | 16385 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 || |
| 16386 | 16386 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 || |
| 16387 | - $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 ) |
|
| 16387 | + $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5) |
|
| 16388 | 16388 | { |
| 16389 | 16389 | $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; |
| 16390 | 16390 | } |
@@ -17227,11 +17227,11 @@ discard block |
||
| 17227 | 17227 | public function sanitize($data, $type, $base = '') |
| 17228 | 17228 | { |
| 17229 | 17229 | $data = trim($data); |
| 17230 | - if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI) |
|
| 17230 | + if ($data !== '' || $type&SIMPLEPIE_CONSTRUCT_IRI) |
|
| 17231 | 17231 | { |
| 17232 | - if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML) |
|
| 17232 | + if ($type&SIMPLEPIE_CONSTRUCT_MAYBE_HTML) |
|
| 17233 | 17233 | { |
| 17234 | - if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) |
|
| 17234 | + if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*'.SIMPLEPIE_PCRE_HTML_ATTRIBUTE.'>)/', $data)) |
|
| 17235 | 17235 | { |
| 17236 | 17236 | $type |= SIMPLEPIE_CONSTRUCT_HTML; |
| 17237 | 17237 | } |
@@ -17241,12 +17241,12 @@ discard block |
||
| 17241 | 17241 | } |
| 17242 | 17242 | } |
| 17243 | 17243 | |
| 17244 | - if ($type & SIMPLEPIE_CONSTRUCT_BASE64) |
|
| 17244 | + if ($type&SIMPLEPIE_CONSTRUCT_BASE64) |
|
| 17245 | 17245 | { |
| 17246 | 17246 | $data = base64_decode($data); |
| 17247 | 17247 | } |
| 17248 | 17248 | |
| 17249 | - if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML)) |
|
| 17249 | + if ($type&(SIMPLEPIE_CONSTRUCT_HTML|SIMPLEPIE_CONSTRUCT_XHTML)) |
|
| 17250 | 17250 | { |
| 17251 | 17251 | |
| 17252 | 17252 | if (!class_exists('DOMDocument')) |
@@ -17322,18 +17322,18 @@ discard block |
||
| 17322 | 17322 | |
| 17323 | 17323 | if ($cache->load()) |
| 17324 | 17324 | { |
| 17325 | - $img->setAttribute('src', $this->image_handler . $image_url); |
|
| 17325 | + $img->setAttribute('src', $this->image_handler.$image_url); |
|
| 17326 | 17326 | } |
| 17327 | 17327 | else |
| 17328 | 17328 | { |
| 17329 | 17329 | $file = $this->registry->create('File', array($img->getAttribute('src'), $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen)); |
| 17330 | 17330 | $headers = $file->headers; |
| 17331 | 17331 | |
| 17332 | - if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) |
|
| 17332 | + if ($file->success && ($file->method&SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) |
|
| 17333 | 17333 | { |
| 17334 | 17334 | if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) |
| 17335 | 17335 | { |
| 17336 | - $img->setAttribute('src', $this->image_handler . $image_url); |
|
| 17336 | + $img->setAttribute('src', $this->image_handler.$image_url); |
|
| 17337 | 17337 | } |
| 17338 | 17338 | else |
| 17339 | 17339 | { |
@@ -17359,16 +17359,16 @@ discard block |
||
| 17359 | 17359 | |
| 17360 | 17360 | if ($this->remove_div) |
| 17361 | 17361 | { |
| 17362 | - $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data); |
|
| 17362 | + $data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '', $data); |
|
| 17363 | 17363 | $data = preg_replace('/<\/div>$/', '', $data); |
| 17364 | 17364 | } |
| 17365 | 17365 | else |
| 17366 | 17366 | { |
| 17367 | - $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); |
|
| 17367 | + $data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '<div>', $data); |
|
| 17368 | 17368 | } |
| 17369 | 17369 | } |
| 17370 | 17370 | |
| 17371 | - if ($type & SIMPLEPIE_CONSTRUCT_IRI) |
|
| 17371 | + if ($type&SIMPLEPIE_CONSTRUCT_IRI) |
|
| 17372 | 17372 | { |
| 17373 | 17373 | $absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); |
| 17374 | 17374 | if ($absolute !== false) |
@@ -17377,7 +17377,7 @@ discard block |
||
| 17377 | 17377 | } |
| 17378 | 17378 | } |
| 17379 | 17379 | |
| 17380 | - if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI)) |
|
| 17380 | + if ($type&(SIMPLEPIE_CONSTRUCT_TEXT|SIMPLEPIE_CONSTRUCT_IRI)) |
|
| 17381 | 17381 | { |
| 17382 | 17382 | $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); |
| 17383 | 17383 | } |
@@ -17394,11 +17394,11 @@ discard block |
||
| 17394 | 17394 | { |
| 17395 | 17395 | $ret = ''; |
| 17396 | 17396 | $html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html); |
| 17397 | - if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML) |
|
| 17397 | + if ($type&~SIMPLEPIE_CONSTRUCT_XHTML) |
|
| 17398 | 17398 | { |
| 17399 | 17399 | // Atom XHTML constructs are wrapped with a div by default |
| 17400 | 17400 | // Note: No protection if $html contains a stray </div>! |
| 17401 | - $html = '<div>' . $html . '</div>'; |
|
| 17401 | + $html = '<div>'.$html.'</div>'; |
|
| 17402 | 17402 | $ret .= '<!DOCTYPE html>'; |
| 17403 | 17403 | $content_type = 'text/html'; |
| 17404 | 17404 | } |
@@ -17409,8 +17409,8 @@ discard block |
||
| 17409 | 17409 | } |
| 17410 | 17410 | |
| 17411 | 17411 | $ret .= '<html><head>'; |
| 17412 | - $ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />'; |
|
| 17413 | - $ret .= '</head><body>' . $html . '</body></html>'; |
|
| 17412 | + $ret .= '<meta http-equiv="Content-Type" content="'.$content_type.'; charset=utf-8" />'; |
|
| 17413 | + $ret .= '</head><body>'.$html.'</body></html>'; |
|
| 17414 | 17414 | return $ret; |
| 17415 | 17415 | } |
| 17416 | 17416 | |
@@ -17468,7 +17468,7 @@ discard block |
||
| 17468 | 17468 | |
| 17469 | 17469 | protected function strip_tag($tag, $document, $xpath, $type) |
| 17470 | 17470 | { |
| 17471 | - $elements = $xpath->query('body//' . $tag); |
|
| 17471 | + $elements = $xpath->query('body//'.$tag); |
|
| 17472 | 17472 | if ($this->encode_instead_of_strip) |
| 17473 | 17473 | { |
| 17474 | 17474 | foreach ($elements as $element) |
@@ -17478,7 +17478,7 @@ discard block |
||
| 17478 | 17478 | // For elements which aren't script or style, include the tag itself |
| 17479 | 17479 | if (!in_array($tag, array('script', 'style'))) |
| 17480 | 17480 | { |
| 17481 | - $text = '<' . $tag; |
|
| 17481 | + $text = '<'.$tag; |
|
| 17482 | 17482 | if ($element->hasAttributes()) |
| 17483 | 17483 | { |
| 17484 | 17484 | $attrs = array(); |
@@ -17487,21 +17487,21 @@ discard block |
||
| 17487 | 17487 | $value = $attr->value; |
| 17488 | 17488 | |
| 17489 | 17489 | // In XHTML, empty values should never exist, so we repeat the value |
| 17490 | - if (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML)) |
|
| 17490 | + if (empty($value) && ($type&SIMPLEPIE_CONSTRUCT_XHTML)) |
|
| 17491 | 17491 | { |
| 17492 | 17492 | $value = $name; |
| 17493 | 17493 | } |
| 17494 | 17494 | // For HTML, empty is fine |
| 17495 | - elseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML)) |
|
| 17495 | + elseif (empty($value) && ($type&SIMPLEPIE_CONSTRUCT_HTML)) |
|
| 17496 | 17496 | { |
| 17497 | 17497 | $attrs[] = $name; |
| 17498 | 17498 | continue; |
| 17499 | 17499 | } |
| 17500 | 17500 | |
| 17501 | 17501 | // Standard attribute text |
| 17502 | - $attrs[] = $name . '="' . $attr->value . '"'; |
|
| 17502 | + $attrs[] = $name.'="'.$attr->value.'"'; |
|
| 17503 | 17503 | } |
| 17504 | - $text .= ' ' . implode(' ', $attrs); |
|
| 17504 | + $text .= ' '.implode(' ', $attrs); |
|
| 17505 | 17505 | } |
| 17506 | 17506 | $text .= '>'; |
| 17507 | 17507 | $fragment->appendChild(new DOMText($text)); |
@@ -17516,7 +17516,7 @@ discard block |
||
| 17516 | 17516 | |
| 17517 | 17517 | if (!in_array($tag, array('script', 'style'))) |
| 17518 | 17518 | { |
| 17519 | - $fragment->appendChild(new DOMText('</' . $tag . '>')); |
|
| 17519 | + $fragment->appendChild(new DOMText('</'.$tag.'>')); |
|
| 17520 | 17520 | } |
| 17521 | 17521 | |
| 17522 | 17522 | $element->parentNode->replaceChild($fragment, $element); |
@@ -17552,7 +17552,7 @@ discard block |
||
| 17552 | 17552 | |
| 17553 | 17553 | protected function strip_attr($attrib, $xpath) |
| 17554 | 17554 | { |
| 17555 | - $elements = $xpath->query('//*[@' . $attrib . ']'); |
|
| 17555 | + $elements = $xpath->query('//*[@'.$attrib.']'); |
|
| 17556 | 17556 | |
| 17557 | 17557 | foreach ($elements as $element) |
| 17558 | 17558 | { |
@@ -17959,19 +17959,19 @@ discard block |
||
| 17959 | 17959 | { |
| 17960 | 17960 | if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) |
| 17961 | 17961 | { |
| 17962 | - if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) |
|
| 17962 | + if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key])) |
|
| 17963 | 17963 | { |
| 17964 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
|
| 17965 | - $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
|
| 17964 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]); |
|
| 17965 | + $this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]; |
|
| 17966 | 17966 | } |
| 17967 | 17967 | else |
| 17968 | 17968 | { |
| 17969 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
|
| 17969 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key]; |
|
| 17970 | 17970 | } |
| 17971 | 17971 | } |
| 17972 | 17972 | elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
| 17973 | 17973 | { |
| 17974 | - $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
|
| 17974 | + $this->data['links'][substr($key, 41)] = & $this->data['links'][$key]; |
|
| 17975 | 17975 | } |
| 17976 | 17976 | $this->data['links'][$key] = array_unique($this->data['links'][$key]); |
| 17977 | 17977 | } |
@@ -18653,7 +18653,7 @@ discard block |
||
| 18653 | 18653 | $this->OS = ord($this->compressed_data[$this->position++]); |
| 18654 | 18654 | |
| 18655 | 18655 | // Parse the FEXTRA |
| 18656 | - if ($this->flags & 4) |
|
| 18656 | + if ($this->flags&4) |
|
| 18657 | 18657 | { |
| 18658 | 18658 | // Read subfield IDs |
| 18659 | 18659 | $this->SI1 = $this->compressed_data[$this->position++]; |
@@ -18684,7 +18684,7 @@ discard block |
||
| 18684 | 18684 | } |
| 18685 | 18685 | |
| 18686 | 18686 | // Parse the FNAME |
| 18687 | - if ($this->flags & 8) |
|
| 18687 | + if ($this->flags&8) |
|
| 18688 | 18688 | { |
| 18689 | 18689 | // Get the length of the filename |
| 18690 | 18690 | $len = strcspn($this->compressed_data, "\x00", $this->position); |
@@ -18704,7 +18704,7 @@ discard block |
||
| 18704 | 18704 | } |
| 18705 | 18705 | |
| 18706 | 18706 | // Parse the FCOMMENT |
| 18707 | - if ($this->flags & 16) |
|
| 18707 | + if ($this->flags&16) |
|
| 18708 | 18708 | { |
| 18709 | 18709 | // Get the length of the comment |
| 18710 | 18710 | $len = strcspn($this->compressed_data, "\x00", $this->position); |
@@ -18724,7 +18724,7 @@ discard block |
||
| 18724 | 18724 | } |
| 18725 | 18725 | |
| 18726 | 18726 | // Parse the FHCRC |
| 18727 | - if ($this->flags & 2) |
|
| 18727 | + if ($this->flags&2) |
|
| 18728 | 18728 | { |
| 18729 | 18729 | // Check the length of the string is still valid |
| 18730 | 18730 | $this->min_compressed_size += $len + 2; |
@@ -18734,7 +18734,7 @@ discard block |
||
| 18734 | 18734 | $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2))); |
| 18735 | 18735 | |
| 18736 | 18736 | // Check the CRC matches |
| 18737 | - if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) |
|
| 18737 | + if ((crc32(substr($this->compressed_data, 0, $this->position))&0xFFFF) === $crc) |
|
| 18738 | 18738 | { |
| 18739 | 18739 | $this->position += 2; |
| 18740 | 18740 | } |
@@ -18770,7 +18770,7 @@ discard block |
||
| 18770 | 18770 | // Check ISIZE of data |
| 18771 | 18771 | $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4))); |
| 18772 | 18772 | $this->position += 4; |
| 18773 | - if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize)) |
|
| 18773 | + if (sprintf('%u', strlen($this->data)&0xFFFFFFFF) !== sprintf('%u', $isize)) |
|
| 18774 | 18774 | { |
| 18775 | 18775 | return false; |
| 18776 | 18776 | } |
@@ -10,24 +10,24 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | if (isset($_GET['coord'])) |
| 12 | 12 | { |
| 13 | - $coords = explode(',',$_GET['coord']); |
|
| 13 | + $coords = explode(',', $_GET['coord']); |
|
| 14 | 14 | if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] != '' && $_COOKIE['notamscope'] != 'All') { |
| 15 | - $scope = filter_var($_COOKIE['notamscope'],FILTER_SANITIZE_STRING); |
|
| 16 | - $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope); |
|
| 15 | + $scope = filter_var($_COOKIE['notamscope'], FILTER_SANITIZE_STRING); |
|
| 16 | + $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope); |
|
| 17 | 17 | } elseif (isset($_GET['scope']) && $_GET['scope'] != '' && $_GET['scope'] != 'All') { |
| 18 | - $scope = filter_input(INPUT_GET,'scope',FILTER_SANITIZE_STRING); |
|
| 19 | - $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope); |
|
| 18 | + $scope = filter_input(INPUT_GET, 'scope', FILTER_SANITIZE_STRING); |
|
| 19 | + $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope); |
|
| 20 | 20 | } else { |
| 21 | 21 | $spotter_array = $NOTAM->getAllNOTAMbyCoord($coords); |
| 22 | 22 | } |
| 23 | 23 | // $spotter_array = $NOTAM->getAllNOTAM(); |
| 24 | 24 | } else { |
| 25 | 25 | if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] != '' && $_COOKIE['notamscope'] != 'All') { |
| 26 | - $scope = filter_var($_COOKIE['notamscope'],FILTER_SANITIZE_STRING); |
|
| 26 | + $scope = filter_var($_COOKIE['notamscope'], FILTER_SANITIZE_STRING); |
|
| 27 | 27 | $spotter_array = $NOTAM->getAllNOTAMbyScope($scope); |
| 28 | 28 | } elseif (isset($_GET['scope']) && $_GET['scope'] != '' && $_GET['scope'] != 'All') { |
| 29 | - $scope = filter_input(INPUT_GET,'scope',FILTER_SANITIZE_STRING); |
|
| 30 | - $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope); |
|
| 29 | + $scope = filter_input(INPUT_GET, 'scope', FILTER_SANITIZE_STRING); |
|
| 30 | + $spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope); |
|
| 31 | 31 | } else { |
| 32 | 32 | $spotter_array = $NOTAM->getAllNOTAM(); |
| 33 | 33 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if (!empty($spotter_array)) |
| 39 | 39 | { |
| 40 | - foreach($spotter_array as $spotter_item) |
|
| 40 | + foreach ($spotter_array as $spotter_item) |
|
| 41 | 41 | { |
| 42 | 42 | date_default_timezone_set('UTC'); |
| 43 | 43 | //waypoint plotting |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $output .= '"ref": "'.$spotter_item['ref'].'",'; |
| 47 | 47 | $output .= '"title": "'.$spotter_item['title'].'",'; |
| 48 | 48 | $output .= '"fir": "'.$spotter_item['fir'].'",'; |
| 49 | - $output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"),'<br />',str_replace(array('"',"\t"), '',$spotter_item['notam_text'])).'",'; |
|
| 49 | + $output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"), '<br />', str_replace(array('"', "\t"), '', $spotter_item['notam_text'])).'",'; |
|
| 50 | 50 | $output .= '"latitude": '.$spotter_item['center_latitude'].','; |
| 51 | 51 | $output .= '"longitude": '.$spotter_item['center_longitude'].','; |
| 52 | 52 | $output .= '"lower_limit": '.$spotter_item['lower_limit'].','; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $output .= '}'; |
| 86 | 86 | $output .= '},'; |
| 87 | 87 | } |
| 88 | - $output = substr($output, 0, -1); |
|
| 88 | + $output = substr($output, 0, -1); |
|
| 89 | 89 | } |
| 90 | 90 | $output .= ']}'; |
| 91 | 91 | |
@@ -17,62 +17,62 @@ discard block |
||
| 17 | 17 | * @param Array $filter the filter |
| 18 | 18 | * @return Array the SQL part |
| 19 | 19 | */ |
| 20 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 20 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 22 | 22 | $filters = array(); |
| 23 | 23 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 24 | 24 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 25 | 25 | $filters = $globalStatsFilters[$globalFilterName]; |
| 26 | 26 | } else { |
| 27 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
| 27 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | if (isset($filter[0]['source'])) { |
| 31 | - $filters = array_merge($filters,$filter); |
|
| 31 | + $filters = array_merge($filters, $filter); |
|
| 32 | 32 | } |
| 33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 33 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
| 34 | 34 | $filter_query_join = ''; |
| 35 | 35 | $filter_query_where = ''; |
| 36 | - foreach($filters as $flt) { |
|
| 36 | + foreach ($filters as $flt) { |
|
| 37 | 37 | if (isset($flt['airlines']) && !empty($flt['airlines'])) { |
| 38 | 38 | if ($flt['airlines'][0] != '') { |
| 39 | 39 | if (isset($flt['source'])) { |
| 40 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
| 40 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
| 41 | 41 | } else { |
| 42 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
| 42 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | if (isset($flt['pilots_id']) && !empty($flt['pilots_id'])) { |
| 47 | 47 | if (isset($flt['source'])) { |
| 48 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
| 48 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
| 49 | 49 | } else { |
| 50 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
| 50 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
| 54 | 54 | if (isset($flt['source'])) { |
| 55 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','",$flt['idents'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
| 55 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','", $flt['idents'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
| 56 | 56 | } else { |
| 57 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','",$flt['idents'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
| 57 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','", $flt['idents'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | if (isset($flt['registrations']) && !empty($flt['registrations'])) { |
| 61 | 61 | if (isset($flt['source'])) { |
| 62 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','",$flt['registrations'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
| 62 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','", $flt['registrations'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
| 63 | 63 | } else { |
| 64 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','",$flt['registrations'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
| 64 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','", $flt['registrations'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | if ((isset($flt['airlines']) && empty($flt['airlines']) && isset($flt['pilots_id']) && empty($flt['pilots_id']) && isset($flt['idents']) && empty($flt['idents'])) || (!isset($flt['airlines']) && !isset($flt['pilots_id']) && !isset($flt['idents']) && !isset($flt['registrations']))) { |
| 68 | 68 | if (isset($flt['source'])) { |
| 69 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','",$flt['source'])."')) ssf ON ssf.flightaware_id = spotter_live.flightaware_id"; |
|
| 69 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','", $flt['source'])."')) ssf ON ssf.flightaware_id = spotter_live.flightaware_id"; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 74 | 74 | if ($filter['airlines'][0] != '') { |
| 75 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) sai ON sai.flightaware_id = spotter_live.flightaware_id"; |
|
| 75 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) sai ON sai.flightaware_id = spotter_live.flightaware_id"; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | if (isset($filter['alliance']) && !empty($filter['alliance'])) { |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_live.flightaware_id "; |
| 83 | 83 | } |
| 84 | 84 | if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
| 85 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) sp ON sp.flightaware_id = spotter_live.flightaware_id"; |
|
| 85 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) sp ON sp.flightaware_id = spotter_live.flightaware_id"; |
|
| 86 | 86 | } |
| 87 | 87 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 88 | 88 | if (count($filter['source']) == 1) { |
| 89 | 89 | $filter_query_where .= " AND format_source = '".$filter['source'][0]."'"; |
| 90 | 90 | } else { |
| 91 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 91 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
@@ -118,15 +118,15 @@ discard block |
||
| 118 | 118 | $filter_query_date .= " AND EXTRACT(DAY FROM spotter_output.date) = '".$filter['day']."'"; |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.flightaware_id = spotter_live.flightaware_id"; |
|
| 121 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.flightaware_id = spotter_live.flightaware_id"; |
|
| 122 | 122 | } |
| 123 | 123 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 124 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 124 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 125 | 125 | } |
| 126 | 126 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 127 | 127 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
| 128 | 128 | if ($filter_query_where != '') { |
| 129 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
| 129 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
| 130 | 130 | } |
| 131 | 131 | $filter_query = $filter_query_join.$filter_query_where; |
| 132 | 132 | return $filter_query; |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | if ($limit != '') |
| 150 | 150 | { |
| 151 | 151 | $limit_array = explode(',', $limit); |
| 152 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 153 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 152 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 153 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 154 | 154 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 155 | 155 | { |
| 156 | 156 | $limit_query = ' LIMIT '.$limit_array[1].' OFFSET '.$limit_array[0]; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } else { |
| 175 | 175 | $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate".$filter_query.$orderby_query; |
| 176 | 176 | } |
| 177 | - $spotter_array = $Spotter->getDataFromDB($query.$limit_query,array(),'',true); |
|
| 177 | + $spotter_array = $Spotter->getDataFromDB($query.$limit_query, array(), '', true); |
|
| 178 | 178 | |
| 179 | 179 | return $spotter_array; |
| 180 | 180 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | { |
| 190 | 190 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
| 191 | 191 | date_default_timezone_set('UTC'); |
| 192 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 192 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 193 | 193 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 194 | 194 | if ($globalDBdriver == 'mysql') { |
| 195 | 195 | if (isset($globalArchive) && $globalArchive === TRUE) { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | try { |
| 213 | 213 | $sth = $this->db->prepare($query); |
| 214 | 214 | $sth->execute(); |
| 215 | - } catch(PDOException $e) { |
|
| 215 | + } catch (PDOException $e) { |
|
| 216 | 216 | echo $e->getMessage(); |
| 217 | 217 | die; |
| 218 | 218 | } |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | * @return Array the spotter information |
| 227 | 227 | * |
| 228 | 228 | */ |
| 229 | - public function getMinLastLiveSpotterData($coord = array(),$filter = array(), $limit = false) |
|
| 229 | + public function getMinLastLiveSpotterData($coord = array(), $filter = array(), $limit = false) |
|
| 230 | 230 | { |
| 231 | 231 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit; |
| 232 | 232 | date_default_timezone_set('UTC'); |
| 233 | 233 | $usecoord = false; |
| 234 | 234 | if (is_array($coord) && !empty($coord)) { |
| 235 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 236 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 237 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 238 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 235 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 236 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 237 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 238 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 239 | 239 | $usecoord = true; |
| 240 | 240 | } |
| 241 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 241 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 242 | 242 | |
| 243 | 243 | if (!isset($globalLiveInterval) || $globalLiveInterval == '') $globalLiveInterval = '200'; |
| 244 | 244 | if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') $globalMap3DAircraftsLimit = '300'; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | try { |
| 300 | 300 | $sth = $this->db->prepare($query); |
| 301 | 301 | $sth->execute(); |
| 302 | - } catch(PDOException $e) { |
|
| 302 | + } catch (PDOException $e) { |
|
| 303 | 303 | echo $e->getMessage(); |
| 304 | 304 | die; |
| 305 | 305 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | public function getLiveSpotterCount($filter = array()) |
| 317 | 317 | { |
| 318 | 318 | global $globalDBdriver, $globalLiveInterval; |
| 319 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 319 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 320 | 320 | |
| 321 | 321 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 322 | 322 | if ($globalDBdriver == 'mysql') { |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | try { |
| 330 | 330 | $sth = $this->db->prepare($query); |
| 331 | 331 | $sth->execute(); |
| 332 | - } catch(PDOException $e) { |
|
| 332 | + } catch (PDOException $e) { |
|
| 333 | 333 | echo $e->getMessage(); |
| 334 | 334 | die; |
| 335 | 335 | } |
@@ -352,10 +352,10 @@ discard block |
||
| 352 | 352 | $filter_query = $this->getFilter($filter); |
| 353 | 353 | |
| 354 | 354 | if (is_array($coord)) { |
| 355 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 356 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 357 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 358 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 355 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 356 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 357 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 358 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 359 | 359 | } else return array(); |
| 360 | 360 | if ($globalDBdriver == 'mysql') { |
| 361 | 361 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query; |
@@ -378,23 +378,23 @@ discard block |
||
| 378 | 378 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
| 379 | 379 | $Spotter = new Spotter($this->db); |
| 380 | 380 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 381 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 381 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 382 | 382 | |
| 383 | 383 | if (is_array($coord)) { |
| 384 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 385 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 386 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 387 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 384 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 385 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 386 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 387 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 388 | 388 | } else return array(); |
| 389 | 389 | if ($globalDBdriver == 'mysql') { |
| 390 | 390 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 391 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 391 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 392 | 392 | FROM spotter_live |
| 393 | 393 | '.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= spotter_live.date |
| 394 | 394 | AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' |
| 395 | 395 | AND spotter_live.latitude <> 0 AND spotter_live.longitude <> 0'; |
| 396 | 396 | } else { |
| 397 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 397 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 398 | 398 | FROM spotter_live |
| 399 | 399 | INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate |
| 400 | 400 | FROM spotter_live l |
@@ -406,14 +406,14 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } else { |
| 408 | 408 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 409 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 409 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 410 | 410 | FROM spotter_live |
| 411 | 411 | ".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date |
| 412 | 412 | AND spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." |
| 413 | 413 | AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong." |
| 414 | 414 | AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0'"; |
| 415 | 415 | } else { |
| 416 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 416 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
|
| 417 | 417 | FROM spotter_live |
| 418 | 418 | INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate |
| 419 | 419 | FROM spotter_live l |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | try { |
| 429 | 429 | $sth = $this->db->prepare($query); |
| 430 | 430 | $sth->execute(); |
| 431 | - } catch(PDOException $e) { |
|
| 431 | + } catch (PDOException $e) { |
|
| 432 | 432 | echo $e->getMessage(); |
| 433 | 433 | die; |
| 434 | 434 | } |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | if ($interval == '1m') |
| 478 | 478 | { |
| 479 | 479 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
| 480 | - } else if ($interval == '15m'){ |
|
| 480 | + } else if ($interval == '15m') { |
|
| 481 | 481 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
| 482 | 482 | } |
| 483 | 483 | } |
@@ -485,14 +485,14 @@ discard block |
||
| 485 | 485 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | - $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
| 488 | + $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
| 489 | 489 | WHERE spotter_live.latitude <> '' |
| 490 | 490 | AND spotter_live.longitude <> '' |
| 491 | 491 | ".$additional_query." |
| 492 | 492 | HAVING distance < :radius |
| 493 | 493 | ORDER BY distance"; |
| 494 | 494 | |
| 495 | - $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
| 495 | + $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng, ':radius' => $radius)); |
|
| 496 | 496 | |
| 497 | 497 | return $spotter_array; |
| 498 | 498 | } |
@@ -510,9 +510,9 @@ discard block |
||
| 510 | 510 | date_default_timezone_set('UTC'); |
| 511 | 511 | |
| 512 | 512 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 513 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 513 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 514 | 514 | |
| 515 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident),'',true); |
|
| 515 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident), '', true); |
|
| 516 | 516 | |
| 517 | 517 | return $spotter_array; |
| 518 | 518 | } |
@@ -523,16 +523,16 @@ discard block |
||
| 523 | 523 | * @return Array the spotter information |
| 524 | 524 | * |
| 525 | 525 | */ |
| 526 | - public function getDateLiveSpotterDataByIdent($ident,$date) |
|
| 526 | + public function getDateLiveSpotterDataByIdent($ident, $date) |
|
| 527 | 527 | { |
| 528 | 528 | $Spotter = new Spotter($this->db); |
| 529 | 529 | date_default_timezone_set('UTC'); |
| 530 | 530 | |
| 531 | 531 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 532 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 532 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 533 | 533 | |
| 534 | - $date = date('c',$date); |
|
| 535 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
| 534 | + $date = date('c', $date); |
|
| 535 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
| 536 | 536 | |
| 537 | 537 | return $spotter_array; |
| 538 | 538 | } |
@@ -548,8 +548,8 @@ discard block |
||
| 548 | 548 | $Spotter = new Spotter($this->db); |
| 549 | 549 | date_default_timezone_set('UTC'); |
| 550 | 550 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 551 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 552 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id),'',true); |
|
| 551 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 552 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id), '', true); |
|
| 553 | 553 | return $spotter_array; |
| 554 | 554 | } |
| 555 | 555 | |
@@ -559,15 +559,15 @@ discard block |
||
| 559 | 559 | * @return Array the spotter information |
| 560 | 560 | * |
| 561 | 561 | */ |
| 562 | - public function getDateLiveSpotterDataById($id,$date) |
|
| 562 | + public function getDateLiveSpotterDataById($id, $date) |
|
| 563 | 563 | { |
| 564 | 564 | $Spotter = new Spotter($this->db); |
| 565 | 565 | date_default_timezone_set('UTC'); |
| 566 | 566 | |
| 567 | 567 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 568 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 569 | - $date = date('c',$date); |
|
| 570 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date),'',true); |
|
| 568 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
| 569 | + $date = date('c', $date); |
|
| 570 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id, ':date' => $date), '', true); |
|
| 571 | 571 | return $spotter_array; |
| 572 | 572 | } |
| 573 | 573 | |
@@ -583,13 +583,13 @@ discard block |
||
| 583 | 583 | date_default_timezone_set('UTC'); |
| 584 | 584 | |
| 585 | 585 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 586 | - $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
| 586 | + $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
| 587 | 587 | |
| 588 | 588 | try { |
| 589 | 589 | |
| 590 | 590 | $sth = $this->db->prepare($query); |
| 591 | 591 | $sth->execute(array(':ident' => $ident)); |
| 592 | - } catch(PDOException $e) { |
|
| 592 | + } catch (PDOException $e) { |
|
| 593 | 593 | echo $e->getMessage(); |
| 594 | 594 | die; |
| 595 | 595 | } |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | * @return Array the spotter information |
| 605 | 605 | * |
| 606 | 606 | */ |
| 607 | - public function getAllLiveSpotterDataById($id,$liveinterval = false) |
|
| 607 | + public function getAllLiveSpotterDataById($id, $liveinterval = false) |
|
| 608 | 608 | { |
| 609 | 609 | global $globalDBdriver, $globalLiveInterval; |
| 610 | 610 | date_default_timezone_set('UTC'); |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | try { |
| 624 | 624 | $sth = $this->db->prepare($query); |
| 625 | 625 | $sth->execute(array(':id' => $id)); |
| 626 | - } catch(PDOException $e) { |
|
| 626 | + } catch (PDOException $e) { |
|
| 627 | 627 | echo $e->getMessage(); |
| 628 | 628 | die; |
| 629 | 629 | } |
@@ -641,12 +641,12 @@ discard block |
||
| 641 | 641 | { |
| 642 | 642 | date_default_timezone_set('UTC'); |
| 643 | 643 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 644 | - $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
|
| 644 | + $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
|
| 645 | 645 | try { |
| 646 | 646 | |
| 647 | 647 | $sth = $this->db->prepare($query); |
| 648 | 648 | $sth->execute(array(':ident' => $ident)); |
| 649 | - } catch(PDOException $e) { |
|
| 649 | + } catch (PDOException $e) { |
|
| 650 | 650 | echo $e->getMessage(); |
| 651 | 651 | die; |
| 652 | 652 | } |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | $sth = $this->db->prepare($query); |
| 678 | 678 | $sth->execute(); |
| 679 | - } catch(PDOException $e) { |
|
| 679 | + } catch (PDOException $e) { |
|
| 680 | 680 | return "error"; |
| 681 | 681 | } |
| 682 | 682 | |
@@ -699,14 +699,14 @@ discard block |
||
| 699 | 699 | |
| 700 | 700 | $sth = $this->db->prepare($query); |
| 701 | 701 | $sth->execute(); |
| 702 | - } catch(PDOException $e) { |
|
| 702 | + } catch (PDOException $e) { |
|
| 703 | 703 | return "error"; |
| 704 | 704 | } |
| 705 | 705 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
| 706 | 706 | $i = 0; |
| 707 | - $j =0; |
|
| 707 | + $j = 0; |
|
| 708 | 708 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 709 | - foreach($all as $row) |
|
| 709 | + foreach ($all as $row) |
|
| 710 | 710 | { |
| 711 | 711 | $i++; |
| 712 | 712 | $j++; |
@@ -714,9 +714,9 @@ discard block |
||
| 714 | 714 | if ($globalDebug) echo "."; |
| 715 | 715 | try { |
| 716 | 716 | |
| 717 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 717 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 718 | 718 | $sth->execute(); |
| 719 | - } catch(PDOException $e) { |
|
| 719 | + } catch (PDOException $e) { |
|
| 720 | 720 | return "error"; |
| 721 | 721 | } |
| 722 | 722 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
@@ -727,9 +727,9 @@ discard block |
||
| 727 | 727 | if ($i > 0) { |
| 728 | 728 | try { |
| 729 | 729 | |
| 730 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 730 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 731 | 731 | $sth->execute(); |
| 732 | - } catch(PDOException $e) { |
|
| 732 | + } catch (PDOException $e) { |
|
| 733 | 733 | return "error"; |
| 734 | 734 | } |
| 735 | 735 | } |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | |
| 743 | 743 | $sth = $this->db->prepare($query); |
| 744 | 744 | $sth->execute(); |
| 745 | - } catch(PDOException $e) { |
|
| 745 | + } catch (PDOException $e) { |
|
| 746 | 746 | return "error"; |
| 747 | 747 | } |
| 748 | 748 | /* $query_delete = "DELETE FROM spotter_live WHERE flightaware_id IN ("; |
@@ -790,13 +790,13 @@ discard block |
||
| 790 | 790 | public function deleteLiveSpotterDataByIdent($ident) |
| 791 | 791 | { |
| 792 | 792 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 793 | - $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
|
| 793 | + $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
|
| 794 | 794 | |
| 795 | 795 | try { |
| 796 | 796 | |
| 797 | 797 | $sth = $this->db->prepare($query); |
| 798 | 798 | $sth->execute(array(':ident' => $ident)); |
| 799 | - } catch(PDOException $e) { |
|
| 799 | + } catch (PDOException $e) { |
|
| 800 | 800 | return "error"; |
| 801 | 801 | } |
| 802 | 802 | |
@@ -812,13 +812,13 @@ discard block |
||
| 812 | 812 | public function deleteLiveSpotterDataById($id) |
| 813 | 813 | { |
| 814 | 814 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 815 | - $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
|
| 815 | + $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
|
| 816 | 816 | |
| 817 | 817 | try { |
| 818 | 818 | |
| 819 | 819 | $sth = $this->db->prepare($query); |
| 820 | 820 | $sth->execute(array(':id' => $id)); |
| 821 | - } catch(PDOException $e) { |
|
| 821 | + } catch (PDOException $e) { |
|
| 822 | 822 | return "error"; |
| 823 | 823 | } |
| 824 | 824 | |
@@ -836,13 +836,13 @@ discard block |
||
| 836 | 836 | { |
| 837 | 837 | global $globalDBdriver, $globalTimezone; |
| 838 | 838 | if ($globalDBdriver == 'mysql') { |
| 839 | - $query = 'SELECT spotter_live.ident FROM spotter_live |
|
| 839 | + $query = 'SELECT spotter_live.ident FROM spotter_live |
|
| 840 | 840 | WHERE spotter_live.ident = :ident |
| 841 | 841 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
| 842 | 842 | AND spotter_live.date < UTC_TIMESTAMP()'; |
| 843 | 843 | $query_data = array(':ident' => $ident); |
| 844 | 844 | } else { |
| 845 | - $query = "SELECT spotter_live.ident FROM spotter_live |
|
| 845 | + $query = "SELECT spotter_live.ident FROM spotter_live |
|
| 846 | 846 | WHERE spotter_live.ident = :ident |
| 847 | 847 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 848 | 848 | AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -851,8 +851,8 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | $sth = $this->db->prepare($query); |
| 853 | 853 | $sth->execute($query_data); |
| 854 | - $ident_result=''; |
|
| 855 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 854 | + $ident_result = ''; |
|
| 855 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 856 | 856 | { |
| 857 | 857 | $ident_result = $row['ident']; |
| 858 | 858 | } |
@@ -869,13 +869,13 @@ discard block |
||
| 869 | 869 | { |
| 870 | 870 | global $globalDBdriver, $globalTimezone; |
| 871 | 871 | if ($globalDBdriver == 'mysql') { |
| 872 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 872 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 873 | 873 | WHERE spotter_live.ident = :ident |
| 874 | 874 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE)'; |
| 875 | 875 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
| 876 | 876 | $query_data = array(':ident' => $ident); |
| 877 | 877 | } else { |
| 878 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 878 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 879 | 879 | WHERE spotter_live.ident = :ident |
| 880 | 880 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '30 MINUTES'"; |
| 881 | 881 | // AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -884,8 +884,8 @@ discard block |
||
| 884 | 884 | |
| 885 | 885 | $sth = $this->db->prepare($query); |
| 886 | 886 | $sth->execute($query_data); |
| 887 | - $ident_result=''; |
|
| 888 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 887 | + $ident_result = ''; |
|
| 888 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 889 | 889 | { |
| 890 | 890 | $ident_result = $row['flightaware_id']; |
| 891 | 891 | } |
@@ -902,13 +902,13 @@ discard block |
||
| 902 | 902 | { |
| 903 | 903 | global $globalDBdriver, $globalTimezone; |
| 904 | 904 | if ($globalDBdriver == 'mysql') { |
| 905 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 905 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 906 | 906 | WHERE spotter_live.flightaware_id = :id |
| 907 | 907 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 HOUR)'; |
| 908 | 908 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
| 909 | 909 | $query_data = array(':id' => $id); |
| 910 | 910 | } else { |
| 911 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 911 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
| 912 | 912 | WHERE spotter_live.flightaware_id = :id |
| 913 | 913 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '10 HOUR'"; |
| 914 | 914 | // AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -917,8 +917,8 @@ discard block |
||
| 917 | 917 | |
| 918 | 918 | $sth = $this->db->prepare($query); |
| 919 | 919 | $sth->execute($query_data); |
| 920 | - $ident_result=''; |
|
| 921 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 920 | + $ident_result = ''; |
|
| 921 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 922 | 922 | { |
| 923 | 923 | $ident_result = $row['flightaware_id']; |
| 924 | 924 | } |
@@ -935,13 +935,13 @@ discard block |
||
| 935 | 935 | { |
| 936 | 936 | global $globalDBdriver, $globalTimezone; |
| 937 | 937 | if ($globalDBdriver == 'mysql') { |
| 938 | - $query = 'SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
| 938 | + $query = 'SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
| 939 | 939 | WHERE spotter_live.ModeS = :modes |
| 940 | 940 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE)'; |
| 941 | 941 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
| 942 | 942 | $query_data = array(':modes' => $modes); |
| 943 | 943 | } else { |
| 944 | - $query = "SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
| 944 | + $query = "SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
| 945 | 945 | WHERE spotter_live.ModeS = :modes |
| 946 | 946 | AND spotter_live.date >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '30 MINUTE'"; |
| 947 | 947 | // // AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
@@ -950,8 +950,8 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | $sth = $this->db->prepare($query); |
| 952 | 952 | $sth->execute($query_data); |
| 953 | - $ident_result=''; |
|
| 954 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 953 | + $ident_result = ''; |
|
| 954 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 955 | 955 | { |
| 956 | 956 | //$ident_result = $row['spotter_live_id']; |
| 957 | 957 | $ident_result = $row['flightaware_id']; |
@@ -976,8 +976,8 @@ discard block |
||
| 976 | 976 | return array(); |
| 977 | 977 | } else { |
| 978 | 978 | $q_array = explode(" ", $q); |
| 979 | - foreach ($q_array as $q_item){ |
|
| 980 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
| 979 | + foreach ($q_array as $q_item) { |
|
| 980 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
| 981 | 981 | $additional_query .= " AND ("; |
| 982 | 982 | $additional_query .= "(spotter_live.aircraft_icao like '%".$q_item."%') OR "; |
| 983 | 983 | $additional_query .= "(spotter_live.aircraft_name like '%".$q_item."%') OR "; |
@@ -992,11 +992,11 @@ discard block |
||
| 992 | 992 | } |
| 993 | 993 | } |
| 994 | 994 | if ($globalDBdriver == 'mysql') { |
| 995 | - $query = "SELECT spotter_live.* FROM spotter_live |
|
| 995 | + $query = "SELECT spotter_live.* FROM spotter_live |
|
| 996 | 996 | WHERE spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
| 997 | 997 | AND spotter_live.date < UTC_TIMESTAMP()"; |
| 998 | 998 | } else { |
| 999 | - $query = "SELECT spotter_live.* FROM spotter_live |
|
| 999 | + $query = "SELECT spotter_live.* FROM spotter_live |
|
| 1000 | 1000 | WHERE spotter_live.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
| 1001 | 1001 | AND spotter_live.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
| 1002 | 1002 | } |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | * @return String success or false |
| 1017 | 1017 | * |
| 1018 | 1018 | */ |
| 1019 | - public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '') |
|
| 1019 | + public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false, $registration = '', $pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false, $format_source = '', $source_name = '', $over_country = '') |
|
| 1020 | 1020 | { |
| 1021 | 1021 | global $globalURL, $globalArchive, $globalDebug; |
| 1022 | 1022 | $Common = new Common(); |
@@ -1116,27 +1116,27 @@ discard block |
||
| 1116 | 1116 | if ($date == '') $date = date("Y-m-d H:i:s", time()); |
| 1117 | 1117 | |
| 1118 | 1118 | |
| 1119 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
| 1120 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 1121 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 1122 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1123 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1124 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1125 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1126 | - $waypoints = filter_var($waypoints,FILTER_SANITIZE_STRING); |
|
| 1127 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1128 | - $altitude_real = filter_var($altitude_real,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1129 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
| 1130 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1131 | - $squawk = filter_var($squawk,FILTER_SANITIZE_NUMBER_INT); |
|
| 1132 | - $route_stop = filter_var($route_stop,FILTER_SANITIZE_STRING); |
|
| 1133 | - $ModeS = filter_var($ModeS,FILTER_SANITIZE_STRING); |
|
| 1134 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_STRING); |
|
| 1135 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 1136 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
| 1137 | - $source_name = filter_var($source_name,FILTER_SANITIZE_STRING); |
|
| 1138 | - $over_country = filter_var($over_country,FILTER_SANITIZE_STRING); |
|
| 1139 | - $verticalrate = filter_var($verticalrate,FILTER_SANITIZE_NUMBER_INT); |
|
| 1119 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
| 1120 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 1121 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 1122 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1123 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1124 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1125 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1126 | + $waypoints = filter_var($waypoints, FILTER_SANITIZE_STRING); |
|
| 1127 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1128 | + $altitude_real = filter_var($altitude_real, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1129 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
| 1130 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1131 | + $squawk = filter_var($squawk, FILTER_SANITIZE_NUMBER_INT); |
|
| 1132 | + $route_stop = filter_var($route_stop, FILTER_SANITIZE_STRING); |
|
| 1133 | + $ModeS = filter_var($ModeS, FILTER_SANITIZE_STRING); |
|
| 1134 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_STRING); |
|
| 1135 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 1136 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
| 1137 | + $source_name = filter_var($source_name, FILTER_SANITIZE_STRING); |
|
| 1138 | + $over_country = filter_var($over_country, FILTER_SANITIZE_STRING); |
|
| 1139 | + $verticalrate = filter_var($verticalrate, FILTER_SANITIZE_NUMBER_INT); |
|
| 1140 | 1140 | |
| 1141 | 1141 | $airline_name = ''; |
| 1142 | 1142 | $airline_icao = ''; |
@@ -1158,10 +1158,10 @@ discard block |
||
| 1158 | 1158 | $arrival_airport_country = ''; |
| 1159 | 1159 | |
| 1160 | 1160 | |
| 1161 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
| 1162 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
| 1163 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 1164 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 1161 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 1162 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 1163 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 1164 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 1165 | 1165 | |
| 1166 | 1166 | $query = ''; |
| 1167 | 1167 | if ($globalArchive) { |
@@ -1172,19 +1172,19 @@ discard block |
||
| 1172 | 1172 | $query .= 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country, real_altitude) |
| 1173 | 1173 | VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name, :departure_airport_city, :departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date,:departure_airport_time,:arrival_airport_time,:squawk,:route_stop,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country, :real_altitude)'; |
| 1174 | 1174 | |
| 1175 | - $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_shadow' => $aircraft_shadow,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date, ':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk,':route_stop' => $route_stop,':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source,':ground' => $ground, ':source_name' => $source_name, ':over_country' => $over_country,':real_altitude' => $altitude_real); |
|
| 1175 | + $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':registration' => $registration, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type, ':aircraft_icao' => $aircraft_icao, ':aircraft_shadow' => $aircraft_shadow, ':aircraft_type' => $aircraft_type, ':aircraft_manufacturer' => $aircraft_manufacturer, ':departure_airport_icao' => $departure_airport_icao, ':departure_airport_name' => $departure_airport_name, ':departure_airport_city' => $departure_airport_city, ':departure_airport_country' => $departure_airport_country, ':arrival_airport_icao' => $arrival_airport_icao, ':arrival_airport_name' => $arrival_airport_name, ':arrival_airport_city' => $arrival_airport_city, ':arrival_airport_country' => $arrival_airport_country, ':latitude' => $latitude, ':longitude' => $longitude, ':waypoints' => $waypoints, ':altitude' => $altitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':departure_airport_time' => $departure_airport_time, ':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name, ':over_country' => $over_country, ':real_altitude' => $altitude_real); |
|
| 1176 | 1176 | try { |
| 1177 | 1177 | |
| 1178 | 1178 | $sth = $this->db->prepare($query); |
| 1179 | 1179 | $sth->execute($query_values); |
| 1180 | 1180 | $sth->closeCursor(); |
| 1181 | - } catch(PDOException $e) { |
|
| 1181 | + } catch (PDOException $e) { |
|
| 1182 | 1182 | return "error : ".$e->getMessage(); |
| 1183 | 1183 | } |
| 1184 | 1184 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
| 1185 | 1185 | if ($globalDebug) echo '(Add to SBS archive : '; |
| 1186 | 1186 | $SpotterArchive = new SpotterArchive($this->db); |
| 1187 | - $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
| 1187 | + $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time, $arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date, $latitude, $longitude, $waypoints, $altitude, $altitude_real, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name, $verticalrate, $format_source, $source_name, $over_country); |
|
| 1188 | 1188 | if ($globalDebug) echo $result.')'; |
| 1189 | 1189 | } elseif ($globalDebug && $putinarchive !== true) { |
| 1190 | 1190 | echo '(Not adding to archive)'; |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | |
| 1198 | 1198 | public function getOrderBy() |
| 1199 | 1199 | { |
| 1200 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_live.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_live.date DESC")); |
|
| 1200 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_live.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_live.date DESC")); |
|
| 1201 | 1201 | return $orderby; |
| 1202 | 1202 | } |
| 1203 | 1203 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | require_once(dirname(__FILE__).'/class.create_db.php'); |
| 23 | 23 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
| 24 | 24 | require_once(dirname(__FILE__).'/class.settings.php'); |
| 25 | -$title="Install"; |
|
| 25 | +$title = "Install"; |
|
| 26 | 26 | require(dirname(__FILE__).'/../require/settings.php'); |
| 27 | 27 | require_once(dirname(__FILE__).'/../require/class.Common.php'); |
| 28 | 28 | require(dirname(__FILE__).'/header.php'); |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | if (!extension_loaded('curl')) { |
| 96 | 96 | $error[] = "Curl is not loaded."; |
| 97 | 97 | } |
| 98 | - if(function_exists('apache_get_modules') ){ |
|
| 99 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
| 98 | + if (function_exists('apache_get_modules')) { |
|
| 99 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
| 100 | 100 | $error[] = "mod_rewrite is not available."; |
| 101 | 101 | } |
| 102 | 102 | /* |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
| 113 | 113 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
| 114 | 114 | if (function_exists('get_headers')) { |
| 115 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
| 116 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
| 115 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
| 116 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
| 117 | 117 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -484,13 +484,13 @@ discard block |
||
| 484 | 484 | ?> |
| 485 | 485 | <tr> |
| 486 | 486 | <?php |
| 487 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
| 487 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
| 488 | 488 | ?> |
| 489 | 489 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 490 | 490 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
| 491 | 491 | <?php |
| 492 | 492 | } else { |
| 493 | - $hostport = explode(':',$source['host']); |
|
| 493 | + $hostport = explode(':', $source['host']); |
|
| 494 | 494 | if (isset($hostport[1])) { |
| 495 | 495 | $host = $hostport[0]; |
| 496 | 496 | $port = $hostport[1]; |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | <select name="timezones[]" id="timezones"> |
| 539 | 539 | <?php |
| 540 | 540 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
| 541 | - foreach($timezonelist as $timezones){ |
|
| 541 | + foreach ($timezonelist as $timezones) { |
|
| 542 | 542 | if (isset($source['timezone']) && $source['timezone'] == $timezones) { |
| 543 | 543 | print '<option selected>'.$timezones.'</option>'; |
| 544 | 544 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | <select name="timezones[]" id="timezones"> |
| 592 | 592 | <?php |
| 593 | 593 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
| 594 | - foreach($timezonelist as $timezones){ |
|
| 594 | + foreach ($timezonelist as $timezones) { |
|
| 595 | 595 | if ($timezones == 'UTC') { |
| 596 | 596 | print '<option selected>'.$timezones.'</option>'; |
| 597 | 597 | } else print '<option>'.$timezones.'</option>'; |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | <br /> |
| 1000 | 1000 | <p> |
| 1001 | 1001 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 1002 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 1002 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
| 1003 | 1003 | </p> |
| 1004 | 1004 | <br /> |
| 1005 | 1005 | <p> |
@@ -1055,14 +1055,14 @@ discard block |
||
| 1055 | 1055 | $error = ''; |
| 1056 | 1056 | |
| 1057 | 1057 | if (isset($_POST['dbtype'])) { |
| 1058 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
| 1059 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
| 1060 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
| 1061 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
| 1062 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
| 1063 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
| 1064 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
| 1065 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
| 1058 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
| 1059 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
| 1060 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
| 1061 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
| 1062 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
| 1063 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
| 1064 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
| 1065 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
| 1066 | 1066 | |
| 1067 | 1067 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
| 1068 | 1068 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -1082,49 +1082,49 @@ discard block |
||
| 1082 | 1082 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
| 1083 | 1083 | */ |
| 1084 | 1084 | |
| 1085 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
| 1085 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
| 1086 | 1086 | |
| 1087 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
| 1088 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
| 1089 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
| 1090 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
| 1091 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
| 1087 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
| 1088 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
| 1089 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
| 1090 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
| 1091 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
| 1092 | 1092 | |
| 1093 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
| 1094 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
| 1095 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
| 1096 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
| 1097 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
| 1098 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING); |
|
| 1099 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
| 1100 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
| 1101 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
| 1102 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
| 1093 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
| 1094 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
| 1095 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
| 1096 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
| 1097 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
| 1098 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING); |
|
| 1099 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
| 1100 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
| 1101 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
| 1102 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
| 1103 | 1103 | |
| 1104 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
| 1105 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
| 1106 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
| 1107 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
| 1108 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 1109 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
| 1104 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
| 1105 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
| 1106 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
| 1107 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
| 1108 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 1109 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
| 1110 | 1110 | |
| 1111 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
| 1112 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
| 1111 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
| 1112 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
| 1113 | 1113 | |
| 1114 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
| 1115 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
| 1116 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
| 1114 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
| 1115 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
| 1116 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
| 1117 | 1117 | |
| 1118 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
| 1118 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
| 1119 | 1119 | if ($acars == 'acars') { |
| 1120 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
| 1120 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
| 1121 | 1121 | } else { |
| 1122 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
| 1122 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
| 1126 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
| 1127 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 1125 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
| 1126 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
| 1127 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 1128 | 1128 | |
| 1129 | 1129 | $source_name = $_POST['source_name']; |
| 1130 | 1130 | $source_latitude = $_POST['source_latitude']; |
@@ -1138,8 +1138,8 @@ discard block |
||
| 1138 | 1138 | |
| 1139 | 1139 | $sources = array(); |
| 1140 | 1140 | foreach ($source_name as $keys => $name) { |
| 1141 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
| 1142 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
| 1141 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]); |
|
| 1142 | + else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]); |
|
| 1143 | 1143 | } |
| 1144 | 1144 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
| 1145 | 1145 | |
@@ -1148,16 +1148,16 @@ discard block |
||
| 1148 | 1148 | $newstype = $_POST['newstype']; |
| 1149 | 1149 | |
| 1150 | 1150 | $newsfeeds = array(); |
| 1151 | - foreach($newsurl as $newskey => $url) { |
|
| 1151 | + foreach ($newsurl as $newskey => $url) { |
|
| 1152 | 1152 | if ($url != '') { |
| 1153 | 1153 | $type = $newstype[$newskey]; |
| 1154 | 1154 | $lng = $newslng[$newskey]; |
| 1155 | 1155 | if (isset($newsfeeds[$type][$lng])) { |
| 1156 | - $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
|
| 1156 | + $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url)); |
|
| 1157 | 1157 | } else $newsfeeds[$type][$lng] = array($url); |
| 1158 | 1158 | } |
| 1159 | 1159 | } |
| 1160 | - $settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); |
|
| 1160 | + $settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds)); |
|
| 1161 | 1161 | |
| 1162 | 1162 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
| 1163 | 1163 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -1168,27 +1168,27 @@ discard block |
||
| 1168 | 1168 | $sbsurl = $_POST['sbsurl']; |
| 1169 | 1169 | */ |
| 1170 | 1170 | |
| 1171 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
| 1172 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING); |
|
| 1173 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
| 1174 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
| 1175 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
| 1176 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
| 1177 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
| 1178 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
| 1171 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
| 1172 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING); |
|
| 1173 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
| 1174 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
| 1175 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
| 1176 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
| 1177 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
| 1178 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
| 1179 | 1179 | |
| 1180 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
| 1181 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1182 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1183 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
| 1184 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1185 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1186 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
| 1187 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1188 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1189 | - $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
|
| 1190 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
| 1191 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
| 1180 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
| 1181 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
| 1182 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
| 1183 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
| 1184 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
| 1185 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
| 1186 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
| 1187 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
| 1188 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
| 1189 | + $globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING); |
|
| 1190 | + if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE')); |
|
| 1191 | + else $settings = array_merge($settings, array('globalSatellite' => 'FALSE')); |
|
| 1192 | 1192 | |
| 1193 | 1193 | /* |
| 1194 | 1194 | $globalSBS1Hosts = array(); |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | } |
| 1205 | 1205 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
| 1206 | 1206 | */ |
| 1207 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
| 1207 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
| 1208 | 1208 | $host = $_POST['host']; |
| 1209 | 1209 | $port = $_POST['port']; |
| 1210 | 1210 | $name = $_POST['name']; |
@@ -1221,113 +1221,113 @@ discard block |
||
| 1221 | 1221 | else $cov = 'FALSE'; |
| 1222 | 1222 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
| 1223 | 1223 | else $arch = 'FALSE'; |
| 1224 | - if (strpos($format[$key],'_callback')) { |
|
| 1225 | - $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
|
| 1224 | + if (strpos($format[$key], '_callback')) { |
|
| 1225 | + $gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE'); |
|
| 1226 | 1226 | } elseif ($h != '' || $name[$key] != '') { |
| 1227 | - $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
|
| 1227 | + $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE'); |
|
| 1228 | 1228 | } |
| 1229 | 1229 | if ($format[$key] == 'airwhere') $forcepilots = true; |
| 1230 | 1230 | } |
| 1231 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
| 1231 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
| 1232 | 1232 | |
| 1233 | 1233 | /* |
| 1234 | 1234 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
| 1235 | 1235 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
| 1236 | 1236 | */ |
| 1237 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
| 1238 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
| 1239 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
| 1237 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
| 1238 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
| 1239 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
| 1240 | 1240 | |
| 1241 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
| 1242 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
| 1241 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
| 1242 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
| 1243 | 1243 | |
| 1244 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING); |
|
| 1245 | - $settings = array_merge($settings,array('globalCustomCSS' => $customcss)); |
|
| 1244 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING); |
|
| 1245 | + $settings = array_merge($settings, array('globalCustomCSS' => $customcss)); |
|
| 1246 | 1246 | |
| 1247 | - $map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING); |
|
| 1248 | - $settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile)); |
|
| 1247 | + $map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING); |
|
| 1248 | + $settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile)); |
|
| 1249 | 1249 | |
| 1250 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
| 1251 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
| 1252 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
| 1253 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
| 1250 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
| 1251 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
| 1252 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
| 1253 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
| 1254 | 1254 | |
| 1255 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
| 1256 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
| 1257 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
| 1255 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
| 1256 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
| 1257 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
| 1258 | 1258 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 1259 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
| 1260 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1259 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
| 1260 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
| 1261 | 1261 | |
| 1262 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 1263 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
| 1264 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 1265 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
| 1266 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
| 1267 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
| 1268 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
| 1269 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
| 1262 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 1263 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
| 1264 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 1265 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
| 1266 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
| 1267 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
| 1268 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
| 1269 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
| 1270 | 1270 | |
| 1271 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
| 1272 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
| 1271 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
| 1272 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
| 1273 | 1273 | |
| 1274 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1275 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
| 1274 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1275 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
| 1276 | 1276 | |
| 1277 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
| 1277 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
| 1278 | 1278 | if ($archiveyear == "archiveyear") { |
| 1279 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
| 1279 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
| 1280 | 1280 | } else { |
| 1281 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
| 1281 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
| 1282 | 1282 | } |
| 1283 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1284 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1285 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1286 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1283 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1284 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1285 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1286 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1287 | 1287 | |
| 1288 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
| 1289 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1290 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
| 1291 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
| 1288 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
| 1289 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1290 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
| 1291 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
| 1292 | 1292 | |
| 1293 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
| 1294 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
| 1295 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
| 1293 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
| 1294 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
| 1295 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
| 1296 | 1296 | |
| 1297 | 1297 | // Create in settings.php keys not yet configurable if not already here |
| 1298 | 1298 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1299 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1299 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
| 1300 | 1300 | |
| 1301 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
| 1301 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
| 1302 | 1302 | if ($resetyearstats == 'resetyearstats') { |
| 1303 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1303 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1304 | 1304 | } else { |
| 1305 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1305 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
| 1308 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
| 1309 | 1309 | if ($archive == 'archive') { |
| 1310 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
| 1310 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
| 1311 | 1311 | } else { |
| 1312 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
| 1312 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
| 1313 | 1313 | } |
| 1314 | - $archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING); |
|
| 1314 | + $archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING); |
|
| 1315 | 1315 | if ($archiveresults == 'archiveresults') { |
| 1316 | - $settings = array_merge($settings,array('globalArchiveResults' => 'TRUE')); |
|
| 1316 | + $settings = array_merge($settings, array('globalArchiveResults' => 'TRUE')); |
|
| 1317 | 1317 | } else { |
| 1318 | - $settings = array_merge($settings,array('globalArchiveResults' => 'FALSE')); |
|
| 1318 | + $settings = array_merge($settings, array('globalArchiveResults' => 'FALSE')); |
|
| 1319 | 1319 | } |
| 1320 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
| 1320 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
| 1321 | 1321 | if ($daemon == 'daemon') { |
| 1322 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
| 1322 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
| 1323 | 1323 | } else { |
| 1324 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
| 1324 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
| 1325 | 1325 | } |
| 1326 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
| 1326 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
| 1327 | 1327 | if ($schedules == 'schedules') { |
| 1328 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
| 1328 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
| 1329 | 1329 | } else { |
| 1330 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
| 1330 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | /* |
@@ -1338,245 +1338,245 @@ discard block |
||
| 1338 | 1338 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
| 1339 | 1339 | } |
| 1340 | 1340 | */ |
| 1341 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
| 1342 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1343 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1344 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1345 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1341 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
| 1342 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
| 1343 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
| 1344 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
| 1345 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
| 1346 | 1346 | $va = false; |
| 1347 | 1347 | if ($globalivao == 'ivao') { |
| 1348 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
| 1348 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
| 1349 | 1349 | $va = true; |
| 1350 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1350 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
| 1351 | 1351 | if ($globalvatsim == 'vatsim') { |
| 1352 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
| 1352 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
| 1353 | 1353 | $va = true; |
| 1354 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1354 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
| 1355 | 1355 | if ($globalphpvms == 'phpvms') { |
| 1356 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
| 1356 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
| 1357 | 1357 | $va = true; |
| 1358 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1358 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
| 1359 | 1359 | if ($globalvam == 'vam') { |
| 1360 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
| 1360 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
| 1361 | 1361 | $va = true; |
| 1362 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1362 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
| 1363 | 1363 | if ($va) { |
| 1364 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
| 1365 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1364 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
| 1365 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
| 1366 | 1366 | if ($globalva == 'va' || $va) { |
| 1367 | - $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
|
| 1368 | - $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1367 | + $settings = array_merge($settings, array('globalVA' => 'TRUE')); |
|
| 1368 | + $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
| 1369 | 1369 | } else { |
| 1370 | - $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
|
| 1371 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1372 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1370 | + $settings = array_merge($settings, array('globalVA' => 'FALSE')); |
|
| 1371 | + if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
| 1372 | + else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE')); |
|
| 1373 | 1373 | } |
| 1374 | 1374 | |
| 1375 | 1375 | |
| 1376 | 1376 | |
| 1377 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
| 1377 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
| 1378 | 1378 | if ($notam == 'notam') { |
| 1379 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
| 1379 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
| 1380 | 1380 | } else { |
| 1381 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
| 1381 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
| 1382 | 1382 | } |
| 1383 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
| 1383 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
| 1384 | 1384 | if ($owner == 'owner') { |
| 1385 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
| 1385 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
| 1386 | 1386 | } else { |
| 1387 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
| 1387 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
| 1388 | 1388 | } |
| 1389 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
| 1389 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
| 1390 | 1390 | if ($map3d == 'map3d') { |
| 1391 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
| 1391 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
| 1392 | 1392 | } else { |
| 1393 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
| 1393 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
| 1394 | 1394 | } |
| 1395 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
| 1395 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
| 1396 | 1396 | if ($crash == 'crash') { |
| 1397 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
| 1397 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
| 1398 | 1398 | } else { |
| 1399 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
| 1399 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
| 1400 | 1400 | } |
| 1401 | - $fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING); |
|
| 1401 | + $fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING); |
|
| 1402 | 1402 | if ($fires == 'fires') { |
| 1403 | - $settings = array_merge($settings,array('globalMapFires' => 'TRUE')); |
|
| 1403 | + $settings = array_merge($settings, array('globalMapFires' => 'TRUE')); |
|
| 1404 | 1404 | } else { |
| 1405 | - $settings = array_merge($settings,array('globalMapFires' => 'FALSE')); |
|
| 1405 | + $settings = array_merge($settings, array('globalMapFires' => 'FALSE')); |
|
| 1406 | 1406 | } |
| 1407 | - $firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING); |
|
| 1407 | + $firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING); |
|
| 1408 | 1408 | if ($firessupport == 'firessupport') { |
| 1409 | - $settings = array_merge($settings,array('globalFires' => 'TRUE')); |
|
| 1409 | + $settings = array_merge($settings, array('globalFires' => 'TRUE')); |
|
| 1410 | 1410 | } else { |
| 1411 | - $settings = array_merge($settings,array('globalFires' => 'FALSE')); |
|
| 1411 | + $settings = array_merge($settings, array('globalFires' => 'FALSE')); |
|
| 1412 | 1412 | } |
| 1413 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
| 1413 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
| 1414 | 1414 | if ($mapsatellites == 'mapsatellites') { |
| 1415 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
| 1415 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
| 1416 | 1416 | } else { |
| 1417 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
| 1417 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
| 1418 | 1418 | } |
| 1419 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
| 1419 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
| 1420 | 1420 | if ($map3ddefault == 'map3ddefault') { |
| 1421 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
| 1421 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
| 1422 | 1422 | } else { |
| 1423 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
| 1423 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
| 1424 | 1424 | } |
| 1425 | - $map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING); |
|
| 1425 | + $map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING); |
|
| 1426 | 1426 | if ($map3dliveries == 'map3dliveries') { |
| 1427 | - $settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE')); |
|
| 1427 | + $settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE')); |
|
| 1428 | 1428 | } else { |
| 1429 | - $settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE')); |
|
| 1429 | + $settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE')); |
|
| 1430 | 1430 | } |
| 1431 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
| 1431 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
| 1432 | 1432 | if ($translate == 'translate') { |
| 1433 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
| 1433 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
| 1434 | 1434 | } else { |
| 1435 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
| 1435 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
| 1436 | 1436 | } |
| 1437 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
| 1437 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
| 1438 | 1438 | if ($realairlines == 'realairlines') { |
| 1439 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
| 1439 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
| 1440 | 1440 | } else { |
| 1441 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
| 1441 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
| 1442 | 1442 | } |
| 1443 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
| 1443 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
| 1444 | 1444 | if ($estimation == 'estimation') { |
| 1445 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
| 1445 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
| 1446 | 1446 | } else { |
| 1447 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
| 1447 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
| 1448 | 1448 | } |
| 1449 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
| 1449 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
| 1450 | 1450 | if ($metar == 'metar') { |
| 1451 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
| 1451 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
| 1452 | 1452 | } else { |
| 1453 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
| 1453 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
| 1454 | 1454 | } |
| 1455 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
| 1455 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
| 1456 | 1456 | if ($metarcycle == 'metarcycle') { |
| 1457 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
| 1457 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
| 1458 | 1458 | } else { |
| 1459 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
| 1459 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
| 1460 | 1460 | } |
| 1461 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
| 1461 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
| 1462 | 1462 | if ($fork == 'fork') { |
| 1463 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
| 1463 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
| 1464 | 1464 | } else { |
| 1465 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
| 1465 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
| 1468 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
| 1469 | 1469 | if ($colormap == 'colormap') { |
| 1470 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1470 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1471 | 1471 | } else { |
| 1472 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1472 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | if (isset($_POST['aircrafticoncolor'])) { |
| 1476 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
| 1477 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
| 1476 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
| 1477 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 1481 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
| 1480 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 1481 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
| 1482 | 1482 | |
| 1483 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
| 1484 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
| 1485 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
| 1486 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
| 1487 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
| 1488 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
| 1483 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
| 1484 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
| 1485 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
| 1486 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
| 1487 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
| 1488 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
| 1489 | 1489 | |
| 1490 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
| 1490 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
| 1491 | 1491 | if ($mappopup == 'mappopup') { |
| 1492 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
| 1492 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
| 1493 | 1493 | } else { |
| 1494 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
| 1494 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
| 1495 | 1495 | } |
| 1496 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
| 1496 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
| 1497 | 1497 | if ($airportpopup == 'airportpopup') { |
| 1498 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
| 1498 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
| 1499 | 1499 | } else { |
| 1500 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
| 1500 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
| 1501 | 1501 | } |
| 1502 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
| 1502 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
| 1503 | 1503 | if ($maphistory == 'maphistory') { |
| 1504 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
| 1504 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
| 1505 | 1505 | } else { |
| 1506 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
| 1506 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
| 1507 | 1507 | } |
| 1508 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING); |
|
| 1508 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING); |
|
| 1509 | 1509 | if ($maptooltip == 'maptooltip') { |
| 1510 | - $settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); |
|
| 1510 | + $settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); |
|
| 1511 | 1511 | } else { |
| 1512 | - $settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); |
|
| 1512 | + $settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); |
|
| 1513 | 1513 | } |
| 1514 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
| 1514 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
| 1515 | 1515 | if ($flightroute == 'flightroute') { |
| 1516 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
| 1516 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
| 1517 | 1517 | } else { |
| 1518 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
| 1518 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
| 1519 | 1519 | } |
| 1520 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING); |
|
| 1520 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING); |
|
| 1521 | 1521 | if ($flightremainingroute == 'flightremainingroute') { |
| 1522 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); |
|
| 1522 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); |
|
| 1523 | 1523 | } else { |
| 1524 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); |
|
| 1524 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); |
|
| 1525 | 1525 | } |
| 1526 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
| 1526 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
| 1527 | 1527 | if ($allflights == 'allflights') { |
| 1528 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
| 1528 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
| 1529 | 1529 | } else { |
| 1530 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
| 1530 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
| 1531 | 1531 | } |
| 1532 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
| 1532 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
| 1533 | 1533 | if ($bbox == 'bbox') { |
| 1534 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
| 1534 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
| 1535 | 1535 | } else { |
| 1536 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
| 1536 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
| 1537 | 1537 | } |
| 1538 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING); |
|
| 1538 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING); |
|
| 1539 | 1539 | if ($groundaltitude == 'groundaltitude') { |
| 1540 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); |
|
| 1540 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); |
|
| 1541 | 1541 | } else { |
| 1542 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); |
|
| 1542 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); |
|
| 1543 | 1543 | } |
| 1544 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
| 1544 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
| 1545 | 1545 | if ($waypoints == 'waypoints') { |
| 1546 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
| 1546 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
| 1547 | 1547 | } else { |
| 1548 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
| 1548 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
| 1549 | 1549 | } |
| 1550 | - $geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING); |
|
| 1550 | + $geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING); |
|
| 1551 | 1551 | if ($geoid == 'geoid') { |
| 1552 | - $settings = array_merge($settings,array('globalGeoid' => 'TRUE')); |
|
| 1552 | + $settings = array_merge($settings, array('globalGeoid' => 'TRUE')); |
|
| 1553 | 1553 | } else { |
| 1554 | - $settings = array_merge($settings,array('globalGeoid' => 'FALSE')); |
|
| 1554 | + $settings = array_merge($settings, array('globalGeoid' => 'FALSE')); |
|
| 1555 | 1555 | } |
| 1556 | - $geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING); |
|
| 1557 | - $settings = array_merge($settings,array('globalGeoidSource' => $geoid_source)); |
|
| 1556 | + $geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING); |
|
| 1557 | + $settings = array_merge($settings, array('globalGeoidSource' => $geoid_source)); |
|
| 1558 | 1558 | |
| 1559 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING); |
|
| 1559 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING); |
|
| 1560 | 1560 | if ($noairlines == 'noairlines') { |
| 1561 | - $settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); |
|
| 1561 | + $settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); |
|
| 1562 | 1562 | } else { |
| 1563 | - $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
|
| 1563 | + $settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); |
|
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1566 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
| 1567 | 1567 | |
| 1568 | 1568 | // Set some defaults values... |
| 1569 | 1569 | if (!isset($globalAircraftImageSources)) { |
| 1570 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
| 1571 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1570 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
| 1571 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1572 | 1572 | } |
| 1573 | 1573 | |
| 1574 | 1574 | if (!isset($globalSchedulesSources)) { |
| 1575 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1576 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1575 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
| 1576 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1577 | 1577 | } |
| 1578 | 1578 | |
| 1579 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
| 1579 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
| 1580 | 1580 | |
| 1581 | 1581 | if ($error == '') settings::modify_settings($settings); |
| 1582 | 1582 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -5,16 +5,16 @@ discard block |
||
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | $Marine = new Marine(); |
| 7 | 7 | $type = 'marine'; |
| 8 | -if (!isset($_GET['type'])){ |
|
| 8 | +if (!isset($_GET['type'])) { |
|
| 9 | 9 | header('Location: '.$globalURL.'/'); |
| 10 | 10 | } else { |
| 11 | 11 | //calculuation for the pagination |
| 12 | - if(!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
| 12 | + if (!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
| 13 | 13 | { |
| 14 | 14 | $limit_start = 0; |
| 15 | 15 | $limit_end = 25; |
| 16 | 16 | $absolute_difference = 25; |
| 17 | - } else { |
|
| 17 | + } else { |
|
| 18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
| 19 | 19 | $limit_start = $limit_explode[0]; |
| 20 | 20 | $limit_end = $limit_explode[1]; |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 29 | 29 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 30 | 30 | |
| 31 | - $marine_type = filter_input(INPUT_GET,'type',FILTER_SANITIZE_STRING); |
|
| 31 | + $marine_type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING); |
|
| 32 | 32 | $page_url = $globalURL.'/marine/type/'.$marine_type; |
| 33 | - $sort = htmlspecialchars(filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING)); |
|
| 34 | - $spotter_array = $Marine->getMarineDataByType($marine_type,$limit_start.",".$absolute_difference, $sort); |
|
| 33 | + $sort = htmlspecialchars(filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING)); |
|
| 34 | + $spotter_array = $Marine->getMarineDataByType($marine_type, $limit_start.",".$absolute_difference, $sort); |
|
| 35 | 35 | |
| 36 | 36 | if (!empty($spotter_array)) |
| 37 | 37 | { |
| 38 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['type']); |
|
| 38 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['type']); |
|
| 39 | 39 | require_once('header.php'); |
| 40 | 40 | |
| 41 | 41 | print '<div class="info column">'; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | //include('aircraft-sub-menu.php'); |
| 46 | 46 | print '<div class="table column">'; |
| 47 | - print '<p>'.sprintf(_("The table below shows the detailed information of all marine of type <strong>%s</strong>."),$spotter_array[0]['type']).'</p>'; |
|
| 47 | + print '<p>'.sprintf(_("The table below shows the detailed information of all marine of type <strong>%s</strong>."), $spotter_array[0]['type']).'</p>'; |
|
| 48 | 48 | |
| 49 | 49 | include('table-output.php'); |
| 50 | 50 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | if (isset($_POST['category'])) |
| 8 | 8 | { |
| 9 | - $category = filter_input(INPUT_POST,'category',FILTER_SANITIZE_STRING); |
|
| 9 | + $category = filter_input(INPUT_POST, 'category', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | header('Location: '.$globalURL.'/newest/'.$category); |
| 11 | 11 | } |
| 12 | 12 | |
@@ -14,18 +14,18 @@ discard block |
||
| 14 | 14 | require_once('header.php'); |
| 15 | 15 | |
| 16 | 16 | //calculuation for the pagination |
| 17 | -if(!isset($_GET['limit'])) |
|
| 17 | +if (!isset($_GET['limit'])) |
|
| 18 | 18 | { |
| 19 | 19 | $limit_start = 0; |
| 20 | 20 | $limit_end = 25; |
| 21 | 21 | $absolute_difference = 25; |
| 22 | -} else { |
|
| 22 | +} else { |
|
| 23 | 23 | $limit_explode = explode(",", $_GET['limit']); |
| 24 | 24 | $limit_start = $limit_explode[0]; |
| 25 | 25 | $limit_end = $limit_explode[1]; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 28 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 29 | 29 | |
| 30 | 30 | $absolute_difference = abs($limit_start - $limit_end); |
| 31 | 31 | $limit_next = $limit_end + $absolute_difference; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $category = "aircraft"; |
| 38 | 38 | } else { |
| 39 | - $category = filter_input(INPUT_GET,'category',FILTER_SANITIZE_STRING); |
|
| 39 | + $category = filter_input(INPUT_GET, 'category', FILTER_SANITIZE_STRING); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $page_url = $globalURL.'/newest/'.$category; |
@@ -14,18 +14,18 @@ discard block |
||
| 14 | 14 | else $type = 'global'; |
| 15 | 15 | |
| 16 | 16 | //calculuation for the pagination |
| 17 | -if(!isset($_GET['limit'])) |
|
| 17 | +if (!isset($_GET['limit'])) |
|
| 18 | 18 | { |
| 19 | 19 | $limit_start = 0; |
| 20 | 20 | $limit_end = 25; |
| 21 | 21 | $absolute_difference = 25; |
| 22 | -} else { |
|
| 22 | +} else { |
|
| 23 | 23 | $limit_explode = explode(",", $_GET['limit']); |
| 24 | 24 | $limit_start = $limit_explode[0]; |
| 25 | 25 | $limit_end = $limit_explode[1]; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 28 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 29 | 29 | |
| 30 | 30 | $absolute_difference = abs($limit_start - $limit_end); |
| 31 | 31 | $limit_next = $limit_end + $absolute_difference; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (!empty($anews)) |
| 60 | 60 | { |
| 61 | 61 | $j = 0; |
| 62 | - foreach($anews as $news) { |
|
| 62 | + foreach ($anews as $news) { |
|
| 63 | 63 | if ($j > 10) break; |
| 64 | 64 | $j++; |
| 65 | 65 | print '<div class="news">'; |