X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=mw%2Fenv%2Fmodules%2Fmw_env_urls.php;h=9a6b014204c58b5b93ea21910d280f2317a64257;hb=ed558d720ebf6985290c99297f5b1d2c86d1f60a;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..9a6b014 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,12 @@ "wait" => $wait ) ); + if(!headers_sent()){ + if($wait){ + if(function_exists("header_remove")) header_remove("Location"); + } + else header("Location: ".str_replace("&", "&", $url)); + } } }