Skip to content

Commit

Permalink
fixed routing
Browse files Browse the repository at this point in the history
  • Loading branch information
127 committed Nov 4, 2019
1 parent 8bccc68 commit 6b129c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/shpala/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public function __construct(array &$config) {
static::set_root_action($_l_[1]);

//set up defaults by url
$request = $_SERVER['REQUEST_URI'];
$_params_pos = strpos($_SERVER['REQUEST_URI'], '?');
$request = !$_params_pos ? $_SERVER['REQUEST_URI'] : substr($_SERVER['REQUEST_URI'], 0, $_params_pos);
$url = explode('/', $request);
$this->params['controller'] = ($url[1]!=false) ? $url[1] : static::get_root_controller();
$this->params['action'] = (isset($url[2]) && $url[2]!=false) ? $url[2] : static::get_default_action();
Expand Down
2 changes: 1 addition & 1 deletion lib/shpala/shpala.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
//TODO
class Shpala {
public $version = '1.1.3';
public $version = '1.1.4';
protected $_config = [];
protected $_i18n = [];
protected $_router;
Expand Down

0 comments on commit 6b129c7

Please sign in to comment.