preg_quote() the permalink structure so that regex special chars such as dots are correctly handled. Props SergeyBiryukov. fixes #21167

git-svn-id: http://core.svn.wordpress.org/trunk@22365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-11-05 14:13:29 +00:00
parent ad724f3b7b
commit c0274c4fa7
1 changed files with 2 additions and 0 deletions

View File

@ -1251,6 +1251,8 @@ class WP_Rewrite {
} }
} }
$permalink_structure = preg_quote( $permalink_structure );
//get everything up to the first rewrite tag //get everything up to the first rewrite tag
$front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
//build an array of the tags (note that said array ends up being in $tokens[0]) //build an array of the tags (note that said array ends up being in $tokens[0])