Skip to content

Commit

Permalink
Merge pull request #271 from atk4/fix/Callback-getUrl
Browse files Browse the repository at this point in the history
Fix/callback get url
  • Loading branch information
romaninsh authored Nov 19, 2017
2 parents 2ab3833 + 0f6451b commit 693fc27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 7 additions & 2 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,17 @@ protected function getRequestURI()
/**
* Build a URL that application can use for call-backs.
*
* @param array|string $page URL as string or array with page name as first element and other GET arguments
* @param array|string $page URL as string or array with page name as first element and other GET arguments
* @param bool $needRequestUri Simply return $_SERVER['REQUEST_URI'] if needed
*
* @return string
*/
public function url($page = [])
public function url($page = [], $needRequestUri = false)
{
if ($needRequestUri) {
return $_SERVER['REQUEST_URI'];
}

$sticky = $this->sticky_get_arguments;
$result = [];

Expand Down
6 changes: 1 addition & 5 deletions src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ public function triggered()
*/
public function getURL($mode = 'callback')
{
if ($this->POST_trigger) {
return $_SERVER['REQUEST_URI'];
}

return $this->app->url([$this->name => $mode]);
return $this->app->url([$this->name => $mode], $this->POST_trigger);
}
}

0 comments on commit 693fc27

Please sign in to comment.