Skip to content

Commit

Permalink
Merge branch 'release/1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
kayalion committed Feb 15, 2018
2 parents 98e7726 + 8d91754 commit 449d2b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Changelog

## 1.4.1 - 2018-02-15
### Updated
- if an anchor comes through, ignore everything behind it

## 1.4.0 - 2017-04-21
###
### Added
- added $parse argument to getPath in Url class to replace the variables with their values

## 1.3.3 - 2017-02-08
Expand Down
6 changes: 6 additions & 0 deletions src/ride/library/router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ protected function setPath($path) {
throw new RouterException('Could not set the path of the route : path is empty or not a string.');
}

// if an anchor comes through, ignore everything behind it
$positionAnchor = strpos($path, '#');
if ($positionAnchor !== false) {
$path = substr($path, 0, $positionAnchor);
}

$regexHttpSegment = '(([a-zA-Z0-9]|[$+_.-]|%|[!*\'(),])|(%[0-9A-Fa-f][0-9A-Fa-f])|[;:@&=])*';
$regexHttpPath = '/^' . $regexHttpSegment . '(\\/' . $regexHttpSegment . ')*$/';

Expand Down
1 change: 1 addition & 0 deletions test/src/ride/library/router/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function providerConstruct() {
array('/path', 'path'),
array('///admin', '///admin'),
array('/', '/'),
array('/path/to', '/path/to#anchor'),
);
}

Expand Down

0 comments on commit 449d2b3

Please sign in to comment.