Skip to content

Commit

Permalink
修正Url生成
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Apr 26, 2018
1 parent 20edc5c commit f879603
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/think/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ public function build($url = '', $vars = '', $suffix = true, $domain = false)

// 检测URL绑定
if (!$this->bindCheck) {
$bind = $this->app['route']->getBind($domain ?: null);
$bind = $this->app['route']->getBind($domain && is_string($domain) ? $domain : null);

if ($bind && 0 === strpos($url, $bind)) {
$url = substr($url, strlen($bind) + 1);
} else {
$binds = $this->app['route']->getBind(true);

foreach ($binds as $key => $val) {
if (is_string($val) && 0 === strpos($url, $val) && substr_count($val, '/') > 1) {
$url = substr($url, strlen($val) + 1);
Expand Down

0 comments on commit f879603

Please sign in to comment.