Ticket #914: search-slashes.diff

File search-slashes.diff, 2.2 KB (added by nbachiyski, 7 years ago)
  • wp-includes/classes.php

     
    334334 
    335335                // If a search pattern is specified, load the posts that match 
    336336                if (!empty($q['s'])) { 
    337                         $q['s'] = addslashes_gpc($q['s']); 
    338337                        $search = ' AND ('; 
    339338                        $q['s'] = preg_replace('/, +/', ' ', $q['s']); 
    340339                        $q['s'] = str_replace(',', ' ', $q['s']); 
     
    12681267    $wp_rewrite = new WP_Rewrite(); 
    12691268} 
    12701269 
    1271 ?> 
    1272  No newline at end of file 
     1270?> 
  • wp-content/themes/default/searchform.php

     
    11<form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 
    2 <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" /> 
     2<div><input type="text" value="<?php echo stripslashes($s); ?>" name="s" id="s" /> 
    33<input type="submit" id="searchsubmit" value="Search" /> 
    44</div> 
    5 </form> 
    6  No newline at end of file 
     5</form> 
  • wp-content/themes/default/sidebar.php

     
    2929                         
    3030                 <?php /* If this is a monthly archive */ } elseif (is_search()) { ?> 
    3131                        <p>You have searched the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives 
    32                         for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p> 
     32                        for <strong>'<?php echo wp_specialchars(stripslashes($s)); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p> 
    3333 
    3434                        <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> 
    3535                        <p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives.</p>