Skip to content

Commit

Permalink
check v2 in url
Browse files Browse the repository at this point in the history
  • Loading branch information
xh3n1 committed Apr 5, 2019
1 parent e2af864 commit c6e2cbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Core/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,15 @@ public function dispatch()

if(strpos($_SERVER['REQUEST_URI'], '/api.php') === false) {
$splittedUrl = explode('/', $_SERVER['REQUEST_URI']);

foreach($splittedUrl as $key => $urlFragment) {
if($urlFragment === 'api') {
if($urlFragment === 'api' && $splittedUrl[$key + 1] === 'v2') {
unset($splittedUrl[$key + 1]);
$splittedUrl[$key] = 'api.php';
break;
}
}

$_SERVER['REQUEST_URI'] = implode('/', $splittedUrl);
}

Expand Down

0 comments on commit c6e2cbd

Please sign in to comment.