Skip to content

Commit

Permalink
Improved helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
libern committed Aug 13, 2016
1 parent ee19cda commit be33048
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Someline/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function current_auth_user()

if (!function_exists('current_full_url')) {

function current_full_url()
function current_full_url($withQueryString = true)
{
$url = \Request::url();
$query = $_SERVER['QUERY_STRING'];
$query = $withQueryString ? $_SERVER['QUERY_STRING'] : null;

if ($query) {
$path = \Request::path();
Expand All @@ -33,6 +33,7 @@ function current_full_url()
$query = substr($query, strlen($path));
}
}

$url = $query ? $url . '?' . $query : $url;
return $url;
}
Expand Down

0 comments on commit be33048

Please sign in to comment.