控制器类的success和error方法url参数支持传入空字符串,则不做任何处理

This commit is contained in:
thinkphp
2016-07-24 22:06:48 +08:00
parent 760b1d971d
commit 646ce83ece

View File

@@ -42,7 +42,7 @@ trait Jump
}
if (is_null($url) && isset($_SERVER["HTTP_REFERER"])) {
$url = $_SERVER["HTTP_REFERER"];
} else {
} elseif ('' !== $url) {
$url = preg_match('/^(https?:|\/)/', $url) ? $url : Url::build($url);
}
$result = [
@@ -80,7 +80,7 @@ trait Jump
}
if (is_null($url)) {
$url = 'javascript:history.back(-1);';
} else {
} elseif ('' !== $url) {
$url = preg_match('/^(https?:|\/)/', $url) ? $url : Url::build($url);
}
$result = [