Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany authored and dennisameling committed Oct 17, 2020
1 parent 4596aad commit caf75f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/bundles/CoreBundle/Helper/UrlHelper.php
Expand Up @@ -326,15 +326,17 @@ private static function removeTrailingNonAlphaNumeric($string)
}

/**
* FILTER_VALIDATE_URL allow only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed]. This validation passed also special characters in URL.
*
* @param string $url
*
* @return bool
*/
public static function isValidateUrl($url)
{
$path = parse_url($url, PHP_URL_PATH);
$encoded_path = array_map('urlencode', explode('/', $path));
$url = str_replace($path, implode('/', $encoded_path), $url);
$encodedPath = array_map('urlencode', explode('/', $path));
$url = str_replace($path, implode('/', $encodedPath), $url);

return filter_var($url, FILTER_VALIDATE_URL);
}
Expand Down

0 comments on commit caf75f3

Please sign in to comment.