From c08bbfc05aba1ff456d4ae084cfe209e951ba006 Mon Sep 17 00:00:00 2001 From: Axiangel Date: Wed, 22 Oct 2025 12:30:50 +0200 Subject: [PATCH 1/2] Sync --- actions/set_location.php | 14 +++++++++----- include/nav.php | 2 +- index.php | 5 +++-- locales/se.json | 37 +++++++++++++++++++++++++++---------- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/actions/set_location.php b/actions/set_location.php index 9b8cd47a..a11b5666 100644 --- a/actions/set_location.php +++ b/actions/set_location.php @@ -28,15 +28,19 @@ } else { - $street = str_replace(" ", "%20", $_POST['street']); - $city = str_replace(" ", "%20", $_POST['city']); +$address = urlencode($_POST['street'] . ' ' . $_POST['city']); +//$filepath = rtrim($_SESSION['providerURL'], '/') . "/search?addressdetails=1&q=$address&format=json&limit=1"; +$filepath=$_SESSION['providerURL']."/search?addressdetails=1&q=$address&format=json&limit=1"; - $filepath=$_SESSION['providerURL']."/?addressdetails=1&q=".$street."%20".$city."&format=json&limit=1"; - if ( strlen($_SESSION['staticKey']) == 32 ) { + if ( strlen($_SESSION['staticKey']) == 32 ) { $filepath.="&key=".$_SESSION['staticKey']; } - $request = file_get_contents($filepath); + //$request = file_get_contents($filepath); +$request = file_get_contents($filepath); +$request = mb_convert_encoding($request, 'UTF-8', 'auto'); // Ensures proper encoding +$json = json_decode($request, true); + if ( $request == "[]" ) { header("Location: $redirect_url?type=display&page=area&return=error_update_location"); diff --git a/include/nav.php b/include/nav.php index eda83594..98332f48 100644 --- a/include/nav.php +++ b/include/nav.php @@ -102,13 +102,13 @@ - +