Fix minor typos

This commit is contained in:
Bartek Fabiszewski 2018-11-09 12:42:35 +01:00
parent ffa759ba2d
commit 9786e9d25b
6 changed files with 13 additions and 9 deletions

View File

@ -108,7 +108,7 @@
/**
* Mark as authenticated, set user
*
* @param [type] $user
* @param uUser $user
* @return void
*/
private function setAuthenticated($user) {

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);