diff --git a/src/api/url.php b/src/api/url.php index 50ce7856..7e78cab7 100644 --- a/src/api/url.php +++ b/src/api/url.php @@ -21,8 +21,9 @@ switch ($_SERVER['REQUEST_METHOD']) { $url = new URL(base64_decode($_GET['url'])); $response['data'] = array( - 'url' => $url->getPretty(), - 'wasPretty' => $url->isPretty(), + 'url' => $url->getPretty(), + 'url_old' => $url->url, + 'url_old_pretty' => $url->isPretty(), ); } break; diff --git a/src/classes/url.php b/src/classes/url.php index bb0b7490..23f9e1c7 100644 --- a/src/classes/url.php +++ b/src/classes/url.php @@ -172,7 +172,7 @@ class URL $queryString = parse_url($this->getPermalink(), PHP_URL_QUERY); $GET = array(); - if ($this->isPretty()) { + if ($this->isPretty() && $queryString) { parse_str($queryString, $GET); } else { $GET = $_GET;