Skip to content

Commit

Permalink
Fixed route bug in path detection
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwen committed Apr 10, 2013
1 parent 53cbe83 commit 133c652
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Pi/Log/Writer/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function systemInfo()
$system['Cache Storage'] = $class;
}
if (Pi::service()->hasService('module')) {
$system['Module'] = Pi::service('module')->current();
$system['Module'] = Pi::service('module')->current() ?: 'N/A';
}
if (Pi::service()->hasService('theme')) {
$system['Theme'] = Pi::service('theme')->current();
Expand Down
6 changes: 4 additions & 2 deletions lib/Pi/Mvc/Router/Http/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ protected function canonizePath(Request $request, $pathOffset = null)
$pathLength = strlen($path);

if ($this->prefix) {
$prefixLength = strlen($this->prefix);
if ($this->prefix != substr($path, 0, $prefixLength)) {
$prefix = rtrim($this->prefix, $this->paramDelimiter) . $this->paramDelimiter;
$path = rtrim($path, $this->paramDelimiter) . $this->paramDelimiter;
$prefixLength = strlen($prefix);
if ($prefix != substr($path, 0, $prefixLength)) {
return null;
}
$path = substr($path, $prefixLength);
Expand Down
2 changes: 1 addition & 1 deletion usr/theme/default/template/error-404.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
&& $this->controller_class
&& $this->controller_class != $this->controller
) {
echo ' (resolves to' . $this->escape($this->controller_class) . ')';
echo ' (resolves to ' . $this->escape($this->controller_class) . ')';
}
?>
</dd>
Expand Down

0 comments on commit 133c652

Please sign in to comment.