Skip to content

Commit

Permalink
license md
Browse files Browse the repository at this point in the history
  • Loading branch information
buster95 committed Sep 5, 2017
1 parent 9cbe3cc commit 3203660
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2017 Walter Corrales

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 changes: 9 additions & 13 deletions confident/Utilities/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@ private static function bracketPreffix($string)

public static function getUrl()
{
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME'])) {
if (isset($_SERVER["PATH_INFO"])) {
return strtolower(explode('?', $_SERVER["PATH_INFO"])[0]);
} elseif (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME'])) {
$reqUri = $_SERVER['REQUEST_URI'];
$script = $_SERVER['SCRIPT_NAME'];

if (stripos($reqUri, '.php')>-1) {
if (isset($_SERVER["PATH_INFO"])) {
return strtolower(explode('?', $_SERVER["PATH_INFO"])[0]);
}
} else {
$scriptExplode = explode('/', $script);
$scriptName = strtolower($scriptExplode[sizeof($scriptExplode)-1]);
$scriptPath = str_replace('/'.$scriptName, '', $script);

$reqUri = str_replace($scriptPath, '', $reqUri);
return $reqUri;
}
$scriptExplode = explode('/', $script);
$scriptName = strtolower($scriptExplode[sizeof($scriptExplode)-1]);
$scriptPath = str_replace('/'.$scriptName, '', $script);

$reqUri = str_replace($scriptPath, '', $reqUri);
return $reqUri;
}
return '/';
}
Expand Down

0 comments on commit 3203660

Please sign in to comment.