@@ -8,15 +8,15 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | } |
10 | 10 | |
11 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
11 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | $Spotter = new Spotter(); |
14 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
14 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
15 | 15 | |
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - $title = sprintf(_("Most Common Time of Day from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
19 | + $title = sprintf(_("Most Common Time of Day from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="select-item">'; |
22 | 22 | print '<form action="'.$globalURL.'/aircraft" method="get">'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $Stats = new Stats(); |
26 | 26 | $aircraft_types = $Stats->getAllAircraftTypes(); |
27 | 27 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
28 | - foreach($aircraft_types as $aircrafttype) |
|
28 | + foreach ($aircraft_types as $aircrafttype) |
|
29 | 29 | { |
30 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
30 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
33 | 33 | } else { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | include('aircraft-sub-menu.php'); |
54 | 54 | print '<div class="column">'; |
55 | 55 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
56 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
56 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
57 | 57 | |
58 | 58 | $hour_array = $Spotter->countAllHoursByAircraft($aircraft_type); |
59 | 59 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | $hour_data = ''; |
64 | 64 | $hour_cnt = ''; |
65 | 65 | $last = 0; |
66 | - foreach($hour_array as $hour_item) |
|
66 | + foreach ($hour_array as $hour_item) |
|
67 | 67 | { |
68 | - while($last != $hour_item['hour_name']) { |
|
68 | + while ($last != $hour_item['hour_name']) { |
|
69 | 69 | $hour_data .= '"'.$last.':00",'; |
70 | 70 | $hour_cnt .= '0,'; |
71 | 71 | $last++; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $hour_cnt .= $hour_item['hour_count'].','; |
76 | 76 | } |
77 | 77 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
78 | - $hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
78 | + $hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
79 | 79 | print 'c3.generate({ |
80 | 80 | bindto: "#chartHour", |
81 | 81 | data: { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | print '</thead>'; |
99 | 99 | print '<tbody>'; |
100 | 100 | $i = 1; |
101 | - foreach($hour_array as $hour_item) |
|
101 | + foreach ($hour_array as $hour_item) |
|
102 | 102 | { |
103 | 103 | print '<tr>'; |
104 | 104 | print '<td>'.$hour_item['hour_name'].':00</td>'; |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | die(); |
10 | 10 | } |
11 | 11 | |
12 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
12 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
13 | 13 | |
14 | 14 | $Spotter = new Spotter(); |
15 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
15 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
16 | 16 | |
17 | 17 | |
18 | 18 | if (!empty($spotter_array)) |
19 | 19 | { |
20 | - $title = sprintf(_("Most Common Arrival Airports for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
20 | + $title = sprintf(_("Most Common Arrival Airports for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
21 | 21 | require_once('header.php'); |
22 | 22 | print '<div class="select-item">'; |
23 | 23 | print '<form action="'.$globalURL.'/aircraft" method="get">'; |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | $Stats = new Stats(); |
27 | 27 | $aircraft_types = $Stats->getAllAircraftTypes(); |
28 | 28 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
29 | - foreach($aircraft_types as $aircrafttype) |
|
29 | + foreach ($aircraft_types as $aircrafttype) |
|
30 | 30 | { |
31 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
32 | 32 | { |
33 | 33 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
34 | 34 | } else { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | include('aircraft-sub-menu.php'); |
56 | 56 | print '<div class="column">'; |
57 | 57 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
58 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
58 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
59 | 59 | $airport_airport_array = $Spotter->countAllArrivalAirportsByAircraft($aircraft_type); |
60 | 60 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
61 | 61 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | print '<script>'; |
65 | 65 | print 'var series = ['; |
66 | 66 | $airport_data = ''; |
67 | - foreach($airport_airport_array as $airport_item) |
|
67 | + foreach ($airport_airport_array as $airport_item) |
|
68 | 68 | { |
69 | 69 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_name'].' ('.$airport_item['airport_arrival_icao'].')",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
70 | 70 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | print '</thead>'; |
120 | 120 | print '<tbody>'; |
121 | 121 | $i = 1; |
122 | - foreach($airport_airport_array as $airport_item) |
|
122 | + foreach ($airport_airport_array as $airport_item) |
|
123 | 123 | { |
124 | 124 | print '<tr>'; |
125 | 125 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Departure Airports by Country for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Departure Airports by Country for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="get">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('aircraft-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | 55 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByAircraft($aircraft_type); |
56 | 56 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
57 | 57 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
60 | 60 | print 'var series = ['; |
61 | 61 | $country_data = ''; |
62 | - foreach($airport_country_array as $airport_item) |
|
62 | + foreach ($airport_country_array as $airport_item) |
|
63 | 63 | { |
64 | 64 | $country_data .= '[ "'.$airport_item['departure_airport_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
65 | 65 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | print '</thead>'; |
108 | 108 | print '<tbody>'; |
109 | 109 | $i = 1; |
110 | - foreach($airport_country_array as $airport_item) |
|
110 | + foreach ($airport_country_array as $airport_item) |
|
111 | 111 | { |
112 | 112 | print '<tr>'; |
113 | 113 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if (isset($this->all_tracked[$key]['id'])) { |
60 | 60 | //echo $this->all_tracked[$key]['id'].' - '.$this->all_tracked[$key]['latitude'].' '.$this->all_tracked[$key]['longitude']."\n"; |
61 | 61 | $Marine = new Marine($this->db); |
62 | - $Marine->updateLatestMarineData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
62 | + $Marine->updateLatestMarineData($this->all_tracked[$key]['id'], $this->all_tracked[$key]['ident'], $this->all_tracked[$key]['latitude'], $this->all_tracked[$key]['longitude'], $this->all_tracked[$key]['speed'], $this->all_tracked[$key]['datetime']); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($globalDebug) echo 'Delete old values and update latest data...'."\n"; |
72 | 72 | foreach ($this->all_tracked as $key => $flight) { |
73 | 73 | if (isset($flight['lastupdate'])) { |
74 | - if ($flight['lastupdate'] < (time()-3000)) { |
|
74 | + if ($flight['lastupdate'] < (time() - 3000)) { |
|
75 | 75 | if ((!isset($globalNoImport) || $globalNoImport !== TRUE) && (!isset($globalNoDB) || $globalNoDB !== TRUE)) { |
76 | 76 | if (isset($this->all_tracked[$key]['id'])) { |
77 | 77 | if ($globalDebug) echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | //$real_arrival = $this->arrival($key); |
84 | 84 | $Marine = new Marine($this->db); |
85 | 85 | if ($this->all_tracked[$key]['latitude'] != '' && $this->all_tracked[$key]['longitude'] != '') { |
86 | - $result = $Marine->updateLatestMarineData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
86 | + $result = $Marine->updateLatestMarineData($this->all_tracked[$key]['id'], $this->all_tracked[$key]['ident'], $this->all_tracked[$key]['latitude'], $this->all_tracked[$key]['longitude'], $this->all_tracked[$key]['speed'], $this->all_tracked[$key]['datetime']); |
|
87 | 87 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
88 | 88 | } |
89 | 89 | // Put in archive |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | public function add($line) { |
100 | - global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChange, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked, $globalNoImport, $globalNoDB, $globalServerAPRS,$APRSMarine; |
|
100 | + global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChange, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked, $globalNoImport, $globalNoDB, $globalServerAPRS, $APRSMarine; |
|
101 | 101 | if (!isset($globalCoordMinChange) || $globalCoordMinChange == '') $globalCoordMinChange = '0.02'; |
102 | 102 | date_default_timezone_set('UTC'); |
103 | 103 | $dataFound = false; |
104 | 104 | $send = false; |
105 | 105 | |
106 | 106 | // SBS format is CSV format |
107 | - if(is_array($line) && isset($line['mmsi'])) { |
|
107 | + if (is_array($line) && isset($line['mmsi'])) { |
|
108 | 108 | //print_r($line); |
109 | 109 | if (isset($line['mmsi'])) { |
110 | 110 | |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | |
130 | 130 | if (!isset($this->all_tracked[$id])) { |
131 | 131 | $this->all_tracked[$id] = array(); |
132 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('addedMarine' => 0)); |
|
133 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => '','latitude' => '', 'longitude' => '', 'speed' => '0', 'heading' => '', 'format_source' => '','source_name' => '','comment'=> '','type' => '','typeid' => '','noarchive' => false,'putinarchive' => true,'over_country' => '','mmsi' => '','status' => '','status_id' => '','imo' => '','callsign' => '','arrival_code' => '','arrival_date' => '','mmsi_type' => '')); |
|
134 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('lastupdate' => time())); |
|
132 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('addedMarine' => 0)); |
|
133 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('ident' => '', 'latitude' => '', 'longitude' => '', 'speed' => '0', 'heading' => '', 'format_source' => '', 'source_name' => '', 'comment'=> '', 'type' => '', 'typeid' => '', 'noarchive' => false, 'putinarchive' => true, 'over_country' => '', 'mmsi' => '', 'status' => '', 'status_id' => '', 'imo' => '', 'callsign' => '', 'arrival_code' => '', 'arrival_date' => '', 'mmsi_type' => '')); |
|
134 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('lastupdate' => time())); |
|
135 | 135 | if (!isset($line['id'])) { |
136 | 136 | if (!isset($globalDaemon)) $globalDaemon = TRUE; |
137 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
138 | - } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
137 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
138 | + } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $line['id'])); |
|
139 | 139 | if ($globalAllTracked !== FALSE) $dataFound = true; |
140 | 140 | } |
141 | 141 | |
142 | 142 | if (isset($line['mmsi']) && $line['mmsi'] != '' && $line['mmsi'] != $this->all_tracked[$id]['mmsi']) { |
143 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('mmsi' => $line['mmsi'])); |
|
143 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('mmsi' => $line['mmsi'])); |
|
144 | 144 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
145 | 145 | $Marine = new Marine($this->db); |
146 | 146 | $identity = $Marine->getIdentity($line['mmsi']); |
147 | 147 | if (!empty($identity)) { |
148 | 148 | $this->all_tracked[$id]['ident'] = $identity['ship_name']; |
149 | 149 | $this->all_tracked[$id]['type'] = $identity['type']; |
150 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('typeid' => $AIS->getShipTypeID($identity['type']))); |
|
150 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('typeid' => $AIS->getShipTypeID($identity['type']))); |
|
151 | 151 | } |
152 | 152 | //print_r($identity); |
153 | 153 | unset($Marine); |
@@ -155,23 +155,23 @@ discard block |
||
155 | 155 | } |
156 | 156 | } |
157 | 157 | if (isset($line['type_id'])) { |
158 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $AIS->getShipType($line['type_id']))); |
|
159 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('typeid' => $line['type_id'])); |
|
158 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('type' => $AIS->getShipType($line['type_id']))); |
|
159 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('typeid' => $line['type_id'])); |
|
160 | 160 | } |
161 | 161 | if (isset($line['type']) && $line['type'] != '' && $this->all_tracked[$id]['type'] == '') { |
162 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $line['type'])); |
|
163 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('typeid' => $AIS->getShipTypeID($line['type']))); |
|
162 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('type' => $line['type'])); |
|
163 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('typeid' => $AIS->getShipTypeID($line['type']))); |
|
164 | 164 | } |
165 | 165 | if (isset($line['status']) && $line['status'] != '') { |
166 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('status' => $line['status'])); |
|
166 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('status' => $line['status'])); |
|
167 | 167 | } |
168 | 168 | if (isset($line['status_id']) && (!isset($this->all_tracked[$id]['status_id']) || $this->all_tracked[$id]['status_id'] != $line['status_id'])) { |
169 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('status_id' => $line['status_id'])); |
|
169 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('status_id' => $line['status_id'])); |
|
170 | 170 | if ($this->all_tracked[$id]['addedMarine'] == 1) { |
171 | 171 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
172 | 172 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
173 | 173 | $Marine = new Marine($this->db); |
174 | - $Marine->updateStatusMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['status']); |
|
174 | + $Marine->updateStatusMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['status']); |
|
175 | 175 | unset($Marine); |
176 | 176 | } |
177 | 177 | } |
@@ -180,24 +180,24 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | if (isset($line['mmsi_type']) && $line['mmsi_type'] != '') { |
183 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('mmsi_type' => $line['mmsi_type'])); |
|
183 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('mmsi_type' => $line['mmsi_type'])); |
|
184 | 184 | } |
185 | 185 | if (isset($line['imo']) && $line['imo'] != '') { |
186 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('imo' => $line['imo'])); |
|
186 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('imo' => $line['imo'])); |
|
187 | 187 | } |
188 | 188 | if (isset($line['callsign']) && $line['callsign'] != '') { |
189 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('callsign' => $line['callsign'])); |
|
189 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('callsign' => $line['callsign'])); |
|
190 | 190 | } |
191 | 191 | if (isset($line['arrival_code']) && $line['arrival_code'] != '') { |
192 | 192 | if (!isset($this->all_tracked[$id]['arrival_code'])) { |
193 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('arrival_code' => $line['arrival_code'])); |
|
193 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('arrival_code' => $line['arrival_code'])); |
|
194 | 194 | if ($globalDebug) echo $this->all_tracked[$id]['id'].' => New arrival: '.$line['arrival_code']."\n"; |
195 | 195 | if ($this->all_tracked[$id]['addedMarine'] != 0) { |
196 | 196 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
197 | 197 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
198 | 198 | $Marine = new Marine($this->db); |
199 | 199 | $fromsource = NULL; |
200 | - $Marine->updateArrivalPortNameMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['arrival_code'],$fromsource); |
|
200 | + $Marine->updateArrivalPortNameMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['arrival_code'], $fromsource); |
|
201 | 201 | $Marine->db = null; |
202 | 202 | } |
203 | 203 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | } |
215 | 215 | if (isset($line['arrival_date']) && $line['arrival_date'] != '') { |
216 | - if (strtotime($line['arrival_date']) > time()) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('arrival_date' => $line['arrival_date'])); |
|
216 | + if (strtotime($line['arrival_date']) > time()) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('arrival_date' => $line['arrival_date'])); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | //if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_tracked[$id]['ident'] != trim($line['ident'])) && preg_match('/^[a-zA-Z0-9-]+$/', $line['ident'])) { |
@@ -222,44 +222,44 @@ discard block |
||
222 | 222 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
223 | 223 | $timeelapsed = microtime(true); |
224 | 224 | $Marine = new Marine($this->db); |
225 | - $Marine->addIdentity($this->all_tracked[$id]['mmsi'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['ident'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['type']); |
|
225 | + $Marine->addIdentity($this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['type']); |
|
226 | 226 | $Marine->db = null; |
227 | 227 | } |
228 | 228 | } |
229 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => trim($line['ident']))); |
|
229 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('ident' => trim($line['ident']))); |
|
230 | 230 | if ($this->all_tracked[$id]['addedMarine'] == 1) { |
231 | 231 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
232 | 232 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
233 | 233 | $timeelapsed = microtime(true); |
234 | 234 | $Marine = new Marine($this->db); |
235 | 235 | $fromsource = NULL; |
236 | - $result = $Marine->updateIdentMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$fromsource); |
|
236 | + $result = $Marine->updateIdentMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $fromsource); |
|
237 | 237 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
238 | 238 | $Marine->db = null; |
239 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
239 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | } |
243 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
243 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $this->all_tracked[$id]['ident'])); |
|
244 | 244 | } |
245 | 245 | |
246 | - if (isset($line['datetime']) && strtotime($line['datetime']) > time()-30*60 && strtotime($line['datetime']) < time()+20*60) { |
|
246 | + if (isset($line['datetime']) && strtotime($line['datetime']) > time() - 30*60 && strtotime($line['datetime']) < time() + 20*60) { |
|
247 | 247 | if (!isset($this->all_tracked[$id]['datetime']) || strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime'])) { |
248 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => $line['datetime'])); |
|
248 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('datetime' => $line['datetime'])); |
|
249 | 249 | } else { |
250 | 250 | if (strtotime($line['datetime']) == strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date is the same as previous data for ".$this->all_tracked[$id]['mmsi']."\n"; |
251 | 251 | elseif (strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date previous latest data (".$line['datetime']." > ".$this->all_tracked[$id]['datetime'].") !!! for ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."\n"; |
252 | 252 | return ''; |
253 | 253 | } |
254 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) <= time()-30*60) { |
|
254 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) <= time() - 30*60) { |
|
255 | 255 | if ($globalDebug) echo "!!! Date is too old ".$this->all_tracked[$id]['mmsi']." - format : ".$line['format_source']."!!!\n"; |
256 | 256 | return ''; |
257 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) >= time()+20*60) { |
|
257 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) >= time() + 20*60) { |
|
258 | 258 | if ($globalDebug) echo "!!! Date is in the future ".$this->all_tracked[$id]['mmsi']." - format : ".$line['format_source']."!!!\n"; |
259 | 259 | return ''; |
260 | 260 | } elseif (!isset($line['datetime'])) { |
261 | 261 | date_default_timezone_set('UTC'); |
262 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => date('Y-m-d H:i:s'))); |
|
262 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('datetime' => date('Y-m-d H:i:s'))); |
|
263 | 263 | } else { |
264 | 264 | if ($globalDebug) echo "!!! Unknow date error ".$this->all_tracked[$id]['mmsi']." date: ".$line['datetime']." - format : ".$line['format_source']."!!!\n"; |
265 | 265 | return ''; |
@@ -267,24 +267,24 @@ discard block |
||
267 | 267 | |
268 | 268 | |
269 | 269 | if (isset($line['speed'])) { |
270 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($line['speed']))); |
|
271 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed_fromsrc' => true)); |
|
270 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed' => round($line['speed']))); |
|
271 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed_fromsrc' => true)); |
|
272 | 272 | } else if (!isset($this->all_tracked[$id]['speed_fromsrc']) && isset($this->all_tracked[$id]['time_last_coord']) && $this->all_tracked[$id]['time_last_coord'] != time() && isset($line['latitude']) && isset($line['longitude'])) { |
273 | - $distance = $Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m'); |
|
273 | + $distance = $Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm'); |
|
274 | 274 | if ($distance > 1000 && $distance < 10000) { |
275 | 275 | $speed = $distance/(time() - $this->all_tracked[$id]['time_last_coord']); |
276 | 276 | $speed = $speed*3.6; |
277 | - if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($speed))); |
|
277 | + if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed' => round($speed))); |
|
278 | 278 | if ($globalDebug) echo "ø Calculated Speed for ".$this->all_tracked[$id]['hex']." : ".$speed." - distance : ".$distance."\n"; |
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
282 | 282 | if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '' && is_numeric($line['latitude']) && is_numeric($line['longitude'])) { |
283 | - if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
283 | + if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time() - $this->all_tracked[$id]['time_last_coord']); |
|
284 | 284 | else unset($timediff); |
285 | - if ($this->tmd > 5 || !isset($timediff) || $timediff > 2000 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff,$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')))) { |
|
285 | + if ($this->tmd > 5 || !isset($timediff) || $timediff > 2000 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff, $Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')))) { |
|
286 | 286 | if (isset($this->all_tracked[$id]['archive_latitude']) && isset($this->all_tracked[$id]['archive_longitude']) && isset($this->all_tracked[$id]['livedb_latitude']) && isset($this->all_tracked[$id]['livedb_longitude'])) { |
287 | - if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['livedb_latitude'],$this->all_tracked[$id]['livedb_longitude'],$line['latitude'],$line['longitude'])) { |
|
287 | + if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'], $this->all_tracked[$id]['archive_longitude'], $this->all_tracked[$id]['livedb_latitude'], $this->all_tracked[$id]['livedb_longitude'], $line['latitude'], $line['longitude'])) { |
|
288 | 288 | $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
289 | 289 | $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
290 | 290 | $this->all_tracked[$id]['putinarchive'] = true; |
@@ -293,10 +293,10 @@ discard block |
||
293 | 293 | $timeelapsed = microtime(true); |
294 | 294 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
295 | 295 | $Marine = new Marine($this->db); |
296 | - $all_country = $Marine->getCountryFromLatitudeLongitude($line['latitude'],$line['longitude']); |
|
296 | + $all_country = $Marine->getCountryFromLatitudeLongitude($line['latitude'], $line['longitude']); |
|
297 | 297 | if (!empty($all_country)) $this->all_tracked[$id]['over_country'] = $all_country['iso2']; |
298 | 298 | $Marine->db = null; |
299 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
299 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
300 | 300 | } |
301 | 301 | $this->tmd = 0; |
302 | 302 | if ($globalDebug) echo 'FOUND : '.$this->all_tracked[$id]['over_country'].' ---------------'."\n"; |
@@ -305,55 +305,55 @@ discard block |
||
305 | 305 | |
306 | 306 | if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) { |
307 | 307 | if (!isset($this->all_tracked[$id]['archive_latitude'])) $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
308 | - if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
308 | + if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude'] - $line['latitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
309 | 309 | $this->all_tracked[$id]['livedb_latitude'] = $line['latitude']; |
310 | 310 | $dataFound = true; |
311 | 311 | $this->all_tracked[$id]['time_last_coord'] = time(); |
312 | 312 | } |
313 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('latitude' => $line['latitude'])); |
|
313 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('latitude' => $line['latitude'])); |
|
314 | 314 | } |
315 | 315 | if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) { |
316 | 316 | if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
317 | 317 | if (!isset($this->all_tracked[$id]['archive_longitude'])) $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
318 | - if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
318 | + if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude'] - $line['longitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
319 | 319 | $this->all_tracked[$id]['livedb_longitude'] = $line['longitude']; |
320 | 320 | $dataFound = true; |
321 | 321 | $this->all_tracked[$id]['time_last_coord'] = time(); |
322 | 322 | } |
323 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('longitude' => $line['longitude'])); |
|
323 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('longitude' => $line['longitude'])); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | } else if ($globalDebug && $timediff > 20) { |
327 | 327 | $this->tmd = $this->tmd + 1; |
328 | 328 | echo '!!! Too much distance in short time... for '.$this->all_tracked[$id]['ident']."\n"; |
329 | - echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')."m -"; |
|
330 | - echo 'Speed : '.(($Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')/$timediff)*3.6)." km/h - "; |
|
329 | + echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')."m -"; |
|
330 | + echo 'Speed : '.(($Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')/$timediff)*3.6)." km/h - "; |
|
331 | 331 | echo 'Lat : '.$line['latitude'].' - long : '.$line['longitude'].' - prev lat : '.$this->all_tracked[$id]['latitude'].' - prev long : '.$this->all_tracked[$id]['longitude']." \n"; |
332 | 332 | } |
333 | 333 | } |
334 | 334 | if (isset($line['last_update']) && $line['last_update'] != '') { |
335 | 335 | if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) $dataFound = true; |
336 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('last_update' => $line['last_update'])); |
|
336 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('last_update' => $line['last_update'])); |
|
337 | 337 | } |
338 | 338 | if (isset($line['format_source']) && $line['format_source'] != '') { |
339 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('format_source' => $line['format_source'])); |
|
339 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('format_source' => $line['format_source'])); |
|
340 | 340 | } |
341 | 341 | if (isset($line['source_name']) && $line['source_name'] != '') { |
342 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('source_name' => $line['source_name'])); |
|
342 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('source_name' => $line['source_name'])); |
|
343 | 343 | } |
344 | 344 | if (isset($line['noarchive']) && $line['noarchive'] === true) { |
345 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('noarchive' => true)); |
|
345 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('noarchive' => true)); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | if (isset($line['heading']) && $line['heading'] != '') { |
349 | - if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
350 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($line['heading']))); |
|
351 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading_fromsrc' => true)); |
|
349 | + if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading'] - round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
350 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading' => round($line['heading']))); |
|
351 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading_fromsrc' => true)); |
|
352 | 352 | //$dataFound = true; |
353 | 353 | } elseif (!isset($this->all_tracked[$id]['heading_fromsrc']) && isset($this->all_tracked[$id]['archive_latitude']) && $this->all_tracked[$id]['archive_latitude'] != $this->all_tracked[$id]['latitude'] && isset($this->all_tracked[$id]['archive_longitude']) && $this->all_tracked[$id]['archive_longitude'] != $this->all_tracked[$id]['longitude']) { |
354 | - $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
355 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($heading))); |
|
356 | - if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
354 | + $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'], $this->all_tracked[$id]['archive_longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
355 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading' => round($heading))); |
|
356 | + if (abs($this->all_tracked[$id]['heading'] - round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
357 | 357 | if ($globalDebug) echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
358 | 358 | } |
359 | 359 | //if (isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_tracked[$id]['lastupdate']) && time()-$this->all_tracked[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if ($dataFound === true && isset($this->all_tracked[$id]['mmsi'])) { |
364 | 364 | $this->all_tracked[$id]['lastupdate'] = time(); |
365 | 365 | if ($this->all_tracked[$id]['addedMarine'] == 0) { |
366 | - if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
366 | + if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
367 | 367 | if (!isset($this->all_tracked[$id]['forcenew']) || $this->all_tracked[$id]['forcenew'] == 0) { |
368 | 368 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
369 | 369 | if ($globalDebug) echo "Check if vessel is already in DB..."; |
@@ -371,37 +371,37 @@ discard block |
||
371 | 371 | $MarineLive = new MarineLive($this->db); |
372 | 372 | if (isset($line['id'])) { |
373 | 373 | $recent_ident = $MarineLive->checkIdRecent($line['id']); |
374 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
374 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
375 | 375 | } elseif (isset($this->all_tracked[$id]['mmsi']) && $this->all_tracked[$id]['mmsi'] != '') { |
376 | 376 | $recent_ident = $MarineLive->checkMMSIRecent($this->all_tracked[$id]['mmsi']); |
377 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
377 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
378 | 378 | } elseif (isset($this->all_tracked[$id]['ident']) && $this->all_tracked[$id]['ident'] != '') { |
379 | 379 | $recent_ident = $MarineLive->checkIdentRecent($this->all_tracked[$id]['ident']); |
380 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
380 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
381 | 381 | } else $recent_ident = ''; |
382 | - $MarineLive->db=null; |
|
382 | + $MarineLive->db = null; |
|
383 | 383 | if ($globalDebug && $recent_ident == '') echo " Not in DB.\n"; |
384 | 384 | elseif ($globalDebug && $recent_ident != '') echo " Already in DB.\n"; |
385 | 385 | } else $recent_ident = ''; |
386 | 386 | } else { |
387 | 387 | $recent_ident = ''; |
388 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('forcenew' => 0)); |
|
388 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('forcenew' => 0)); |
|
389 | 389 | } |
390 | 390 | //if there was no vessel with the same callsign within the last hour and go post it into the archive |
391 | - if($recent_ident == "" && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') |
|
391 | + if ($recent_ident == "" && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') |
|
392 | 392 | { |
393 | 393 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['mmsi']." in archive DB : "; |
394 | 394 | //adds the spotter data for the archive |
395 | 395 | $highlight = ''; |
396 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['mmsi'].'-'.date('YmdHi'))); |
|
396 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $this->all_tracked[$id]['mmsi'].'-'.date('YmdHi'))); |
|
397 | 397 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
398 | 398 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
399 | 399 | $timeelapsed = microtime(true); |
400 | 400 | $Marine = new Marine($this->db); |
401 | - $result = $Marine->addMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name']); |
|
401 | + $result = $Marine->addMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name']); |
|
402 | 402 | $Marine->db = null; |
403 | 403 | if ($globalDebug && isset($result)) echo $result."\n"; |
404 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
404 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | if (isset($line['sourcestats']) && $line['sourcestats'] == TRUE && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') { |
@@ -409,15 +409,15 @@ discard block |
||
409 | 409 | $Stats = new Stats($this->db); |
410 | 410 | if (!empty($this->stats)) { |
411 | 411 | if ($globalDebug) echo 'Add source stats : '; |
412 | - foreach($this->stats as $date => $data) { |
|
413 | - foreach($data as $source => $sourced) { |
|
412 | + foreach ($this->stats as $date => $data) { |
|
413 | + foreach ($data as $source => $sourced) { |
|
414 | 414 | //print_r($sourced); |
415 | - if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']),$source,'polar_marine',$date); |
|
416 | - if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']),$source,'hist_marine',$date); |
|
415 | + if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']), $source, 'polar_marine', $date); |
|
416 | + if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']), $source, 'hist_marine', $date); |
|
417 | 417 | if (isset($sourced['msg'])) { |
418 | 418 | if (time() - $sourced['msg']['date'] > 10) { |
419 | 419 | $nbmsg = round($sourced['msg']['nb']/(time() - $sourced['msg']['date'])); |
420 | - echo $Stats->addStatSource($nbmsg,$source,'msg_marine',$date); |
|
420 | + echo $Stats->addStatSource($nbmsg, $source, 'msg_marine', $date); |
|
421 | 421 | unset($this->stats[$date][$source]['msg']); |
422 | 422 | } |
423 | 423 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
442 | 442 | $MarineLive = new MarineLive($this->db); |
443 | 443 | $MarineLive->deleteLiveMarineData(); |
444 | - $MarineLive->db=null; |
|
444 | + $MarineLive->db = null; |
|
445 | 445 | if ($globalDebug) echo " Done\n"; |
446 | 446 | } |
447 | 447 | $this->last_delete = time(); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
453 | 453 | if (isset($globalDaemon) && !$globalDaemon) { |
454 | 454 | $Marine = new Marine($this->db); |
455 | - $Marine->updateLatestMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime']); |
|
455 | + $Marine->updateLatestMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime']); |
|
456 | 456 | $Marine->db = null; |
457 | 457 | } |
458 | 458 | } |
@@ -467,20 +467,20 @@ discard block |
||
467 | 467 | $ignoreImport = false; |
468 | 468 | |
469 | 469 | if (!$ignoreImport) { |
470 | - if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
470 | + if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
471 | 471 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." from ".$this->all_tracked[$id]['format_source']." in Live DB : "; |
472 | 472 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
473 | 473 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
474 | 474 | $timeelapsed = microtime(true); |
475 | 475 | $MarineLive = new MarineLive($this->db); |
476 | - $result = $MarineLive->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'],$this->all_tracked[$id]['mmsi'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'],$this->all_tracked[$id]['status'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['noarchive'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name'],$this->all_tracked[$id]['over_country']); |
|
476 | + $result = $MarineLive->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['noarchive'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name'], $this->all_tracked[$id]['over_country']); |
|
477 | 477 | $MarineLive->db = null; |
478 | 478 | if ($globalDebug) echo $result."\n"; |
479 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
479 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | if (isset($globalServerAPRS) && $globalServerAPRS && $this->all_tracked[$id]['putinarchive']) { |
483 | - $APRSMarine->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'],$this->all_tracked[$id]['mmsi'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'],$this->all_tracked[$id]['status'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['noarchive'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name'],$this->all_tracked[$id]['over_country']); |
|
483 | + $APRSMarine->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['noarchive'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name'], $this->all_tracked[$id]['over_country']); |
|
484 | 484 | } |
485 | 485 | $this->all_tracked[$id]['putinarchive'] = false; |
486 | 486 | |
@@ -499,19 +499,19 @@ discard block |
||
499 | 499 | $latitude = $globalCenterLatitude; |
500 | 500 | $longitude = $globalCenterLongitude; |
501 | 501 | } |
502 | - $this->source_location[$source] = array('latitude' => $latitude,'longitude' => $longitude); |
|
502 | + $this->source_location[$source] = array('latitude' => $latitude, 'longitude' => $longitude); |
|
503 | 503 | } else { |
504 | 504 | $latitude = $this->source_location[$source]['latitude']; |
505 | 505 | $longitude = $this->source_location[$source]['longitude']; |
506 | 506 | } |
507 | - $stats_heading = $Common->getHeading($latitude,$longitude,$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
507 | + $stats_heading = $Common->getHeading($latitude, $longitude, $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
508 | 508 | //$stats_heading = $stats_heading%22.5; |
509 | 509 | $stats_heading = round($stats_heading/22.5); |
510 | - $stats_distance = $Common->distance($latitude,$longitude,$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
510 | + $stats_distance = $Common->distance($latitude, $longitude, $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
511 | 511 | $current_date = date('Y-m-d'); |
512 | 512 | if ($stats_heading == 16) $stats_heading = 0; |
513 | 513 | if (!isset($this->stats[$current_date][$source]['polar'][1])) { |
514 | - for ($i=0;$i<=15;$i++) { |
|
514 | + for ($i = 0; $i <= 15; $i++) { |
|
515 | 515 | $this->stats[$current_date][$source]['polar'][$i] = 0; |
516 | 516 | } |
517 | 517 | $this->stats[$current_date][$source]['polar'][$stats_heading] = $stats_distance; |
@@ -526,9 +526,9 @@ discard block |
||
526 | 526 | if (!isset($this->stats[$current_date][$source]['hist'][$distance])) { |
527 | 527 | if (isset($this->stats[$current_date][$source]['hist'][0])) { |
528 | 528 | end($this->stats[$current_date][$source]['hist']); |
529 | - $mini = key($this->stats[$current_date][$source]['hist'])+10; |
|
529 | + $mini = key($this->stats[$current_date][$source]['hist']) + 10; |
|
530 | 530 | } else $mini = 0; |
531 | - for ($i=$mini;$i<=$distance;$i+=10) { |
|
531 | + for ($i = $mini; $i <= $distance; $i += 10) { |
|
532 | 532 | $this->stats[$current_date][$source]['hist'][$i] = 0; |
533 | 533 | } |
534 | 534 | $this->stats[$current_date][$source]['hist'][$distance] = 1; |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | $this->all_tracked[$id]['lastupdate'] = time(); |
542 | 542 | if ($this->all_tracked[$id]['putinarchive']) $send = true; |
543 | - } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
|
543 | + } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude'])."\n"; |
|
544 | 544 | //$this->del(); |
545 | 545 | |
546 | 546 |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | if (isset($_POST['aircraft_manufacturer']) && $_POST['aircraft_manufacturer'] != '') |
7 | 7 | { |
8 | - $aircraft_manufacturer = filter_input(INPUT_POST,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
8 | + $aircraft_manufacturer = filter_input(INPUT_POST, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
9 | 9 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
10 | 10 | } elseif (isset($_GET['aircraft_manufacturer']) && $_GET['aircraft_manufacturer'] != '') |
11 | 11 | { |
12 | - $aircraft_manufacturer = filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
12 | + $aircraft_manufacturer = filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
13 | 13 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
14 | 14 | } else { |
15 | 15 | if ($globalURL == '') { |
@@ -5,14 +5,14 @@ |
||
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | |
7 | 7 | header('Content-Type: text/javascript'); |
8 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
8 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
9 | 9 | $SpotterLive = new SpotterLive(); |
10 | 10 | $spotter_array = $SpotterLive->getRealTimeData($q); |
11 | 11 | |
12 | 12 | $output = '{'; |
13 | 13 | $output .= '"flights": ['; |
14 | 14 | if (!empty($spotter_array)) { |
15 | - foreach($spotter_array as $spotter_item) |
|
15 | + foreach ($spotter_array as $spotter_item) |
|
16 | 16 | { |
17 | 17 | $output .= '{'; |
18 | 18 | $output .= '"flight_id": "'.$spotter_item['spotter_id'].'",'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <?php |
30 | 30 | if (isset($_GET['q'])) |
31 | 31 | { |
32 | - $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
32 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
33 | 33 | $spotter_array = $Spotter->searchSpotterData($q, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "0,10", "", ""); |
34 | 34 | } else { |
35 | 35 | $spotter_array = $Spotter->getLatestSpotterData("0,10", ""); |
@@ -148,18 +148,18 @@ discard block |
||
148 | 148 | |
149 | 149 | <?php |
150 | 150 | if (isset($_GET['image']) && isset($_GET['q'])) { |
151 | - $image = filter_input(INPUT_GET,'image',FILTER_SANITIZE_STRING); |
|
152 | - $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
151 | + $image = filter_input(INPUT_GET, 'image', FILTER_SANITIZE_STRING); |
|
152 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
153 | 153 | ?> |
154 | 154 | $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&image=<?php print $image; ?>&q=<?php print $q; ?>", function( data ) { |
155 | 155 | <?php |
156 | 156 | } elseif (isset($_GET['image'])) { |
157 | - $image = filter_input(INPUT_GET,'image',FILTER_SANITIZE_STRING); |
|
157 | + $image = filter_input(INPUT_GET, 'image', FILTER_SANITIZE_STRING); |
|
158 | 158 | ?> |
159 | 159 | $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&image=<?php print $image; ?>", function( data ) { |
160 | 160 | <?php |
161 | 161 | } elseif (isset($_GET['q'])) { |
162 | - $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
162 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
163 | 163 | ?> |
164 | 164 | $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&q=<?php print $q; ?>", function( data ) { |
165 | 165 | <?php |
@@ -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 |
@@ -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 | } |