Skip to content

Commit

Permalink
Merge pull request #117 from ryo88c/approve-bracket-on-sanitize
Browse files Browse the repository at this point in the history
I added brackets ([]) to exclusion list of replacement by regex, it's be... - thank you!
  • Loading branch information
johnclause committed Apr 6, 2015
2 parents 6974439 + 4054a60 commit 7506527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qtranslate_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function qtranxf_del_query_arg(&$query, $key){
*/
function qtranxf_sanitize_url($url)
{
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
$strip = array('%0d', '%0a', '%0D', '%0A');
$count;
do{ $url = str_replace( $strip, '', $url, $count ); } while($count);
Expand Down

0 comments on commit 7506527

Please sign in to comment.