Make WordPress Core

Changeset 8376


Ignore:
Timestamp:
07/19/2008 05:56:35 PM (17 years ago)
Author:
ryan
Message:

IXR 0.71. Props jacobsantos. fixes #7227

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-IXR.php

    r8084 r8376  
    2323    var $data;
    2424    var $type;
     25
    2526    function IXR_Value ($data, $type = false) {
    2627        $this->data = $data;
     
    4142        }
    4243    }
     44
    4345    function calculateType() {
    4446        if ($this->data === true || $this->data === false) {
     
    7476        }
    7577    }
     78
    7679    function getXml() {
    7780        /* Return XML for this value */
     
    114117        return false;
    115118    }
     119
    116120    function isStruct($array) {
    117121        /* Nasty function to check if an array is a struct or not */
     
    181185    }
    182186    function tag_open($parser, $tag, $attr) {
    183         $this->_currentTagContents = '';
     187        $this->_currentTagContents = '';
    184188        $this->currentTag = $tag;
    185189        switch($tag) {
     
    271275            }
    272276        }
    273         $this->_currentTagContents = '';
     277        $this->_currentTagContents = '';
    274278    }
    275279}
     
    335339    function call($methodname, $args) {
    336340        if (!$this->hasMethod($methodname)) {
    337             return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
     341            return new IXR_Error(-32601, 'server error. requested method '.
     342                $methodname.' does not exist.');
    338343        }
    339344        $method = $this->callbacks[$methodname];
     
    348353            $method = substr($method, 5);
    349354            if (!method_exists($this, $method)) {
    350                 return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
     355                return new IXR_Error(-32601, 'server error. requested class method "'.
     356                    $method.'" does not exist.');
    351357            }
    352358            // Call the method
     
    355361            // It's a function - does it exist?
    356362            if (is_array($method)) {
    357                 if (!method_exists($method[0], $method[1])) {
    358                 return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
    359                 }
     363                if (!method_exists($method[0], $method[1])) {
     364                    return new IXR_Error(-32601, 'server error. requested object method "'.
     365                        $method[1].'" does not exist.');
     366                }
    360367            } else if (!function_exists($method)) {
    361                 return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
     368                return new IXR_Error(-32601, 'server error. requested function "'.
     369                    $method.'" does not exist.');
    362370            }
    363371            // Call the function
     
    491499    var $message = false;
    492500    var $debug = false;
    493     var $timeout;
     501    var $timeout;
    494502    // Storage place for an error message
    495503    var $error = false;
     
    510518            $this->port = $port;
    511519        }
    512         $this->useragent = 'Incutio XML-RPC';
    513         $this->timeout = $timeout;
     520        $this->useragent = 'The Incutio XML-RPC PHP Library';
     521        $this->timeout = $timeout;
    514522    }
    515523    function query() {
     
    557565            }
    558566            if (!$gettingHeaders) {
    559                 $contents .= trim($line)."\n";
     567                $contents .= trim($line);
    560568            }
    561569        }
     
    604612    function IXR_Error($code, $message) {
    605613        $this->code = $code;
    606         $this->message = htmlspecialchars($message);
     614        $this->message = $message;
    607615    }
    608616    function getXml() {
     
    666674        $this->minute = substr($iso, 12, 2);
    667675        $this->second = substr($iso, 15, 2);
    668         $this->timezone = substr($iso, 17);
    669676    }
    670677    function getIso() {
    671         return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
     678        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second;
    672679    }
    673680    function getXml() {
  • trunk/wp-includes/taxonomy.php

    r8363 r8376  
    762762    global $wpdb;
    763763
     764    $select = "SELECT term_id FROM $wpdb->terms as t WHERE ";
     765    $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE ";
     766
    764767    if ( is_int($term) ) {
    765768        if ( 0 == $term )
    766769            return 0;
    767770        $where = 't.term_id = %d';
    768     } else {
    769         if ( '' === $term = sanitize_title($term) )
    770             return 0;
    771         $where = 't.slug = %s';
    772     }
    773 
    774     if ( !empty($taxonomy) )
    775         return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A);
    776 
    777     return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $term) );
     771        if ( !empty($taxonomy) )
     772            return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A );
     773        else
     774            return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
     775    }
     776
     777    if ( '' === $slug = sanitize_title($term) )
     778        return 0;
     779
     780    $where = 't.slug = %s';
     781    $else_where = 't.name = %s';
     782
     783    if ( !empty($taxonomy) ) {
     784        if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $slug, $taxonomy), ARRAY_A) )
     785            return $result;
     786           
     787        return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A);
     788    }
     789
     790    if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $slug) ) )
     791        return $result;
     792
     793    return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where", $term) );
    778794}
    779795
  • trunk/wp-includes/version.php

    r8365 r8376  
    1616 * @global int $wp_db_version
    1717 */
    18 $wp_db_version = 8202;
     18$wp_db_version = 8370;
    1919
    2020?>
Note: See TracChangeset for help on using the changeset viewer.