@@ -186,24 +186,24 @@ public function addMultipleFavoritesToDB($userId, $favoriteList) {
186186 $ values = [];
187187 foreach ($ favoriteList as $ fav ) {
188188 if (
189- !isset ($ fav ['lat ' ]) or !is_numeric ($ fav ['lat ' ]) or
190- !isset ($ fav ['lng ' ]) or !is_numeric ($ fav ['lng ' ])
189+ !isset ($ fav ['lat ' ]) or !is_numeric ($ fav ['lat ' ])
190+ or !isset ($ fav ['lng ' ]) or !is_numeric ($ fav ['lng ' ])
191191 ) {
192192 continue ;
193193 } else {
194194 $ lat = floatval ($ fav ['lat ' ]);
195195 $ lng = floatval ($ fav ['lng ' ]);
196196 }
197- $ value = '( ' .
198- $ this ->db_quote_escape_string ($ userId ) . ', ' .
199- ((!isset ($ fav ['name ' ]) or !$ fav ['name ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['name ' ])) . ', ' .
200- ((!isset ($ fav ['date_created ' ]) or !is_numeric ($ fav ['date_created ' ])) ? $ this ->db_quote_escape_string ($ nowTimeStamp ) : $ this ->db_quote_escape_string ($ fav ['date_created ' ])) . ', ' .
201- $ this ->db_quote_escape_string ($ nowTimeStamp ) . ', ' .
202- $ this ->db_quote_escape_string ($ lat ) . ', ' .
203- $ this ->db_quote_escape_string ($ lng ) . ', ' .
204- ((!isset ($ fav ['category ' ]) or !$ fav ['category ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['category ' ])) . ', ' .
205- ((!isset ($ fav ['comment ' ]) or !$ fav ['comment ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['comment ' ])) . ', ' .
206- ((!isset ($ fav ['extensions ' ]) or !$ fav ['extensions ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['extensions ' ])) . ') ' ;
197+ $ value = '( '
198+ . $ this ->db_quote_escape_string ($ userId ) . ', '
199+ . ((!isset ($ fav ['name ' ]) or !$ fav ['name ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['name ' ])) . ', '
200+ . ((!isset ($ fav ['date_created ' ]) or !is_numeric ($ fav ['date_created ' ])) ? $ this ->db_quote_escape_string ($ nowTimeStamp ) : $ this ->db_quote_escape_string ($ fav ['date_created ' ])) . ', '
201+ . $ this ->db_quote_escape_string ($ nowTimeStamp ) . ', '
202+ . $ this ->db_quote_escape_string ($ lat ) . ', '
203+ . $ this ->db_quote_escape_string ($ lng ) . ', '
204+ . ((!isset ($ fav ['category ' ]) or !$ fav ['category ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['category ' ])) . ', '
205+ . ((!isset ($ fav ['comment ' ]) or !$ fav ['comment ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['comment ' ])) . ', '
206+ . ((!isset ($ fav ['extensions ' ]) or !$ fav ['extensions ' ]) ? 'NULL ' : $ this ->db_quote_escape_string ($ fav ['extensions ' ])) . ') ' ;
207207 array_push ($ values , $ value );
208208 }
209209 $ valuesStr = implode (', ' , $ values );
@@ -286,8 +286,8 @@ public function deleteFavoritesFromDB($ids, $userId) {
286286 }
287287
288288 public function countFavorites ($ userId , $ categoryList , $ begin , $ end ) {
289- if ($ categoryList === null or
290- (is_array ($ categoryList ) and count ($ categoryList ) === 0 )
289+ if ($ categoryList === null
290+ or (is_array ($ categoryList ) and count ($ categoryList ) === 0 )
291291 ) {
292292 return 0 ;
293293 }
@@ -308,9 +308,9 @@ public function countFavorites($userId, $categoryList, $begin, $end) {
308308 );
309309 }
310310 // apply category restrictions if it's a non-empty array
311- if (!is_string ($ categoryList ) and
312- is_array ($ categoryList ) and
313- count ($ categoryList ) > 0
311+ if (!is_string ($ categoryList )
312+ and is_array ($ categoryList )
313+ and count ($ categoryList ) > 0
314314 ) {
315315 $ or = $ qb ->expr ()->orx ();
316316 foreach ($ categoryList as $ cat ) {
@@ -392,8 +392,8 @@ public function getFavoritesFromJSON($file) {
392392 $ currentFavorite ['comment ' ] = '' ;
393393 }
394394 if (
395- array_key_exists ('Location ' , $ value ['properties ' ]) &&
396- array_key_exists ('Address ' , $ value ['properties ' ]['Location ' ])
395+ array_key_exists ('Location ' , $ value ['properties ' ])
396+ && array_key_exists ('Address ' , $ value ['properties ' ]['Location ' ])
397397 ) {
398398 $ currentFavorite ['comment ' ] = $ currentFavorite ['comment ' ] . "\n" . $ value ['properties ' ]['Location ' ]['Address ' ];
399399 }
@@ -566,9 +566,9 @@ public function exportFavorites($userId, $fileHandler, $categoryList, $begin, $e
566566 );
567567 }
568568 // apply category restrictions if it's a non-empty array
569- if (!is_string ($ categoryList ) and
570- is_array ($ categoryList ) and
571- count ($ categoryList ) > 0
569+ if (!is_string ($ categoryList )
570+ and is_array ($ categoryList )
571+ and count ($ categoryList ) > 0
572572 ) {
573573 $ or = $ qb ->expr ()->orx ();
574574 foreach ($ categoryList as $ cat ) {
@@ -676,9 +676,9 @@ public function importFavoritesFromKml($userId, $fp, $name) {
676676 while ($ data = fread ($ fp , 4096000 )) {
677677 if (!xml_parse ($ xml_parser , $ data , feof ($ fp ))) {
678678 $ this ->logger ->error (
679- 'Exception in ' . $ name . ' parsing at line ' .
680- xml_get_current_line_number ($ xml_parser ) . ' : ' .
681- xml_error_string (xml_get_error_code ($ xml_parser )),
679+ 'Exception in ' . $ name . ' parsing at line '
680+ . xml_get_current_line_number ($ xml_parser ) . ' : '
681+ . xml_error_string (xml_get_error_code ($ xml_parser )),
682682 ['app ' => 'maps ' ]
683683 );
684684 return 0 ;
@@ -781,9 +781,9 @@ public function importFavoritesFromGpx($userId, $file) {
781781 while ($ data = fread ($ fp , 4096000 )) {
782782 if (!xml_parse ($ xml_parser , $ data , feof ($ fp ))) {
783783 $ this ->logger ->error (
784- 'Exception in ' . $ file ->getName () . ' parsing at line ' .
785- xml_get_current_line_number ($ xml_parser ) . ' : ' .
786- xml_error_string (xml_get_error_code ($ xml_parser )),
784+ 'Exception in ' . $ file ->getName () . ' parsing at line '
785+ . xml_get_current_line_number ($ xml_parser ) . ' : '
786+ . xml_error_string (xml_get_error_code ($ xml_parser )),
787787 ['app ' => 'maps ' ]
788788 );
789789 return 0 ;
0 commit comments