Make WordPress Core


Ignore:
Timestamp:
08/01/2007 07:24:51 PM (19 years ago)
Author:
markjaquith
Message:

Sanitize option names in option.php, use current escaping functions. for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r5700 r5832  
    5757foreach ( (array) $options as $option) :
    5858        $disabled = '';
     59        $option->option_name = attribute_escape($option->option_name);
    5960        if ( is_serialized($option->option_value) ) {
    6061                if ( is_serialized_string($option->option_value) ) {
    6162                        // this is a serialized string, so we should display it
    62                         $value = wp_specialchars(maybe_unserialize($option->option_value), 'single');
     63                        $value = maybe_unserialize($option->option_value);
    6364                        $options_to_update[] = $option->option_name;
    6465                        $class = 'all-options';
     
    6970                }
    7071        } else {
    71                 $value = wp_specialchars($option->option_value, 'single');
     72                $value = $option->option_value;
    7273                $options_to_update[] = $option->option_name;
    7374                $class = 'all-options';
     
    7879<td>";
    7980
    80         if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>";
    81         else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'$disabled />";
     81        if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>" . wp_specialchars($value) . "</textarea>";
     82        else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . attribute_escape($value) . "'$disabled />";
    8283
    8384        echo "</td>
     
    8889  </table>
    8990<?php $options_to_update = implode(',', $options_to_update); ?>
    90 <p class="submit"><input type="hidden" name="page_options" value="<?php echo attribute_escape($options_to_update); ?>" /><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p>
     91<p class="submit"><input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" /><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p>
    9192  </form>
    9293</div>
Note: See TracChangeset for help on using the changeset viewer.