X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=mw%2Fenv%2Fmodules%2Fmw_env_urls.php;h=0f745a708b2794024eaa1b9538eb47885d5b7622;hb=0df77b6e0e0eee4060e73ca0d6955bf232aa23cc;hp=d7194f80b93003a43d2697570d911ebdfa89a035;hpb=36ed114046cbe3d72a3589230e9f306a54fcc79d;p=mtweb diff --git a/mw/env/modules/mw_env_urls.php b/mw/env/modules/mw_env_urls.php index d7194f8..0f745a7 100644 --- a/mw/env/modules/mw_env_urls.php +++ b/mw/env/modules/mw_env_urls.php @@ -22,7 +22,8 @@ return false; } - function url($action = "", $_params = array(), $script_name = "index.php"){ + function url($action = "", $_params = array(), $script_name = null){ + $script_name = isset($script_name) ? $script_name : ($this->config("script_name") ? $this->config("script_name") : "index.php"); if($action) $_params["e"] = $action; $get_params = ""; if(isset($this->additional_get_params)) foreach($this->additional_get_params as $key => $value) $get_params .= ($get_params ? "&" : "?").$key."=".$value; @@ -40,6 +41,10 @@ "wait" => $wait ) ); + if(!headers_sent()){ + if($wait) header_remove("Location"); + else header("Location: ".str_replace("&", "&", $url)); + } } }