From 24c1784ac235597f1265777367fbf34fa1737513 Mon Sep 17 00:00:00 2001 From: Sinan SALIH Date: Fri, 13 Sep 2019 23:52:09 +0300 Subject: [PATCH] Fix area redirection --- Ness/Url.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Ness/Url.php b/Ness/Url.php index c371f45..525b398 100644 --- a/Ness/Url.php +++ b/Ness/Url.php @@ -68,9 +68,10 @@ public static function RedirectToArea($Area = '', $controllerName = '', $action */ public static function getArea($willWork = true) { - $application_query_data = conf::getQuery(); - if (!empty($application_query_data['p'])) { - return $application_query_data['p'].'Area'.DIRECTORY_SEPARATOR; + + $application_query_data = Url::getData("p"); + if (!empty($application_query_data)) { + return $application_query_data.'Area'.DIRECTORY_SEPARATOR; } else { return ''; } @@ -111,22 +112,25 @@ public static function getUrl() } /** - * Returns posted values in your url with 'get' method. + * Get parameter values from your url. + * If parameter not found returns False.Please + * set $paramid for getting a specific value. Set $paramid to Null + * for getting an array with parameters. * * @param string $paramid Name of your entry - * - * @return string Application query data. */ public static function getData($paramid = null) { - $application_query_data = conf::getQuery(); - if (is_null($paramid)) { - return $application_query_data; - } else { - if (empty($application_query_data[$paramid])) { - return '-1'; - } else { - return $application_query_data[$paramid]; + if(isset(parse_url(Url::getUrl())['query'])){ + parse_str(parse_url(Url::getUrl())['query'], $query); + if(is_null($paramid)){ + return $query; + }else{ + if(!isset($query[$paramid])){ + return false; + }else{ + return $query[$paramid]; + } } } }