WordPress.org

Make WordPress Core

Ticket #21167: 21167.patch

File 21167.patch, 667 bytes (added by SergeyBiryukov, 6 years ago)
  • wp-includes/rewrite.php

     
    12511251                        }
    12521252                }
    12531253
     1254                //escape regex special characters in permalink structure
     1255                foreach ( array( '.', '+', '$', '(', ')' ) as $special_char )
     1256                        $permalink_structure = str_replace( $special_char, '\\' . $special_char, $permalink_structure );
     1257
    12541258                //get everything up to the first rewrite tag
    12551259                $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
    12561260                //build an array of the tags (note that said array ends up being in $tokens[0])