Skip to content
Browse files

Check for empty base_path in `PageData::is_current`

  • Loading branch information...
1 parent 414fe56 commit 49f58cb93af6d6ff489a1aa9a22a262b26628e66 @Sija Sija committed with Feb 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/page-data.inc.php
View
2 app/page-data.inc.php
@@ -74,7 +74,7 @@ static function is_current($base_url, $permalink) {
return ('/' == $_SERVER['REQUEST_URI']);
} else {
$base_path = preg_replace('/^[^\/]+/', '', $base_url);
- if (0 === strpos($_SERVER['REQUEST_URI'], $base_path)) {
+ if (empty($base_path) || 0 === strpos($_SERVER['REQUEST_URI'], $base_path)) {
return preg_match('#(/' . $permalink . '|' . $permalink . '/)#', $_SERVER['REQUEST_URI']);
}
}

0 comments on commit 49f58cb

Please sign in to comment.
Something went wrong with that request. Please try again.