Make WordPress Core

Ticket #11605: 11605.3.patch

File 11605.3.patch, 779 bytes (added by hakre, 14 years ago)

And the next iteration. I do not see much more this function can benefit from....

  • wp-includes/wp-db.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    503503         * @param string|array $data
    504504         * @return string query safe string
    505505         */
    506         function escape($data) {
    507                 if ( is_array($data) ) {
    508                         foreach ( (array) $data as $k => $v ) {
    509                                 if ( is_array($v) )
    510                                         $data[$k] = $this->escape( $v );
    511                                 else
    512                                         $data[$k] = $this->_weak_escape( $v );
    513                         }
    514                 } else {
    515                         $data = $this->_weak_escape( $data );
    516                 }
    517 
    518                 return $data;
     506        function escape( $data ) {
     507                return is_array( $data ) ? array_map( array( &$this, 'escape' ), $data ) : addslashes( $data ); 
    519508        }
    520509
    521510        /**