From 9786e9d25b1ef0d8acbd9447e68a5a2f2c893d62 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 9 Nov 2018 12:42:35 +0100 Subject: [PATCH] Fix minor typos --- helpers/auth.php | 2 +- helpers/track.php | 2 +- scripts/migrate_from_phptrackme.php | 8 ++++---- utils/export.php | 2 ++ utils/getpositions.php | 1 + utils/import.php | 7 ++++--- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/helpers/auth.php b/helpers/auth.php index efed4cc..fc017d7 100644 --- a/helpers/auth.php +++ b/helpers/auth.php @@ -108,7 +108,7 @@ /** * Mark as authenticated, set user * - * @param [type] $user + * @param uUser $user * @return void */ private function setAuthenticated($user) { diff --git a/helpers/track.php b/helpers/track.php index d48b35a..3cc4fdf 100644 --- a/helpers/track.php +++ b/helpers/track.php @@ -108,7 +108,7 @@ public function addPosition($userId, $timestamp, $lat, $lon, $altitude = NULL, $speed = NULL, $bearing = NULL, $accuracy = NULL, $provider = NULL, $comment = NULL, $imageId = NULL) { - return $ret = uPosition::add($userId, $this->id, $timestamp, $lat, $lon, + return uPosition::add($userId, $this->id, $timestamp, $lat, $lon, $altitude, $speed, $bearing, $accuracy, $provider, $comment, $imageId); } diff --git a/scripts/migrate_from_phptrackme.php b/scripts/migrate_from_phptrackme.php index abf2282..9d07df3 100644 --- a/scripts/migrate_from_phptrackme.php +++ b/scripts/migrate_from_phptrackme.php @@ -124,7 +124,7 @@ exit(0); /* Helper functions */ /** Import tracks metadata for given user - * @param $user_id User id + * @param int $user_id User id */ function process_user_tracks($user_id) { global $pt_mysqli, $mysqli; @@ -170,9 +170,9 @@ function process_user_tracks($user_id) { } /** Import positions for given track - * @param $user_id User id - * @param $old_id Old database track id - * @param $new_id New database track id + * @param int $user_id User id + * @param int $old_id Old database track id + * @param int $new_id New database track id */ function process_track($user_id, $old_id, $new_id) { global $pt_mysqli, $mysqli; diff --git a/utils/export.php b/utils/export.php index 43cda9f..990a1e7 100755 --- a/utils/export.php +++ b/utils/export.php @@ -120,7 +120,9 @@ if ($trackId && $userId) { $i = 0; $totalMeters = 0; $totalSeconds = 0; + $coordinate = []; foreach ($positionsArr as $position) { + /** @var uPosition $prevPosition */ $distance = isset($prevPosition) ? $position->distanceTo($prevPosition) : 0; $seconds = isset($prevPosition) ? $position->secondsTo($prevPosition) : 0; $prevPosition = $position; diff --git a/utils/getpositions.php b/utils/getpositions.php index 2df35ba..5822483 100755 --- a/utils/getpositions.php +++ b/utils/getpositions.php @@ -51,6 +51,7 @@ $xml->setIndent(true); $xml->startElement('root'); foreach ($positionsArr as $position) { + /** @var uPosition $prevPosition */ $xml->startElement("position"); $xml->writeAttribute("id", $position->id); $xml->writeElement("latitude", $position->latitude); diff --git a/utils/import.php b/utils/import.php index c0891c1..15cbda0 100755 --- a/utils/import.php +++ b/utils/import.php @@ -25,6 +25,7 @@ require_once(ROOT_DIR . "/lang.php"); $auth = new uAuth(); +$uploadErrors = []; $uploadErrors[UPLOAD_ERR_INI_SIZE] = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; $uploadErrors[UPLOAD_ERR_FORM_SIZE] = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"; $uploadErrors[UPLOAD_ERR_PARTIAL] = "The uploaded file was only partially uploaded"; @@ -56,9 +57,9 @@ if ($uploadErr == UPLOAD_ERR_OK) { $gpxFile = $gpxUpload["tmp_name"]; $gpxName = basename($gpxUpload["name"]); } else { - $message = $lang("iuploadfailure"); - if (isset($errorMessage[$uploadErr])) { - $message .= ": " . $errorMessage[$uploadErr]; + $message = $lang["iuploadfailure"]; + if (isset($uploadErrors[$uploadErr])) { + $message .= ": " . $uploadErrors[$uploadErr]; } $message .= " ($uploadErr)"; uUtils::exitWithError($message);