Skip to content

Commit

Permalink
Slight optimization to clean path
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 4, 2017
1 parent 2fb77bb commit 15ec8fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions system/src/Grav/Common/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -1118,10 +1118,8 @@ public static function isValidUrl($url)
*/
public static function cleanPath($path)
{
$regex = '/([^:]\/)\/+/';

$path = str_replace('\\', '/', $path);
$path = str_replace('/ /', '/', $path);
$regex = '/(\/)\/+/';
$path = str_replace(['\\', '/ /'], '/', $path);
$path = preg_replace($regex,'$1',$path);

return $path;
Expand Down

0 comments on commit 15ec8fe

Please sign in to comment.