Skip to content
Snippets Groups Projects
Unverified Commit f0daf3e1 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Fix wording; it did not describe what function does

parent 21e5b057
No related branches found
No related tags found
No related merge requests found
......@@ -638,16 +638,16 @@ class HTTP
/**
* Retrieve the first element of the URL path.
*
* @param boolean $trailingslash Whether to add a trailing slash to the element or not. Defaults to true.
* @param boolean $leadingSlash Whether to add a leading slash to the element or not. Defaults to true.
*
* @return string The first element of the URL path, with an optional, trailing slash.
* @return string The first element of the URL path, with an optional, leading slash.
*
* @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no>
*/
public static function getFirstPathElement($trailingslash = true)
public static function getFirstPathElement($leadingSlash = true)
{
if (preg_match('|^/(.*?)/|', $_SERVER['SCRIPT_NAME'], $matches)) {
return ($trailingslash ? '/' : '').$matches[1];
return ($leadingSlash ? '/' : '').$matches[1];
}
return '';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment