Make WordPress Core

Changeset 4874


Ignore:
Timestamp:
02/12/2007 07:20:31 PM (19 years ago)
Author:
ryan
Message:

editPage and newPage escaping fixes from Joseph.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r4870 r4874  
    149149                global $wpdb;
    150150
    151                 foreach ( (array) $array as $k => $v ) {
    152                         if (is_array($v)) {
    153                                 $this->escape($array[$k]);
    154                         } else if (is_object($v)) {
    155                                 //skip
    156                         } else {
    157                                 $array[$k] = $wpdb->escape($v);
     151                if(is_string($array)) {
     152                        return($wpdb->escape($array));
     153                }
     154                else {
     155                        foreach ( (array) $array as $k => $v ) {
     156                                if (is_array($v)) {
     157                                        $this->escape($array[$k]);
     158                                } else if (is_object($v)) {
     159                                        //skip
     160                                } else {
     161                                        $array[$k] = $wpdb->escape($v);
     162                                }
    158163                        }
    159164                }
     
    284289         */
    285290        function wp_newPage($args) {
    286                 $this->escape($args);
    287 
    288                 $blog_id        = $args[0];
    289                 $username       = $args[1];
    290                 $password       = $args[2];
     291                // Items not escaped here will be escaped in newPost.
     292                $username       = $this->escape($args[1]);
     293                $password       = $this->escape($args[2]);
    291294                $page           = $args[3];
    292295                $publish        = $args[4];
     
    356359         */
    357360        function wp_editPage($args) {
    358                 $this->escape($args);
    359 
     361                // Items not escaped here will be escaped in editPost.
    360362                $blog_id        = $args[0];
    361                 $page_id        = $args[1];
    362                 $username       = $args[2];
    363                 $password       = $args[3];
     363                $page_id        = $this->escape($args[1]);
     364                $username       = $this->escape($args[2]);
     365                $password       = $this->escape($args[3]);
    364366                $content        = $args[4];
    365367                $publish        = $args[5];
Note: See TracChangeset for help on using the changeset viewer.