Changeset 8376
- Timestamp:
- 07/19/2008 05:56:35 PM (17 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-IXR.php
r8084 r8376 23 23 var $data; 24 24 var $type; 25 25 26 function IXR_Value ($data, $type = false) { 26 27 $this->data = $data; … … 41 42 } 42 43 } 44 43 45 function calculateType() { 44 46 if ($this->data === true || $this->data === false) { … … 74 76 } 75 77 } 78 76 79 function getXml() { 77 80 /* Return XML for this value */ … … 114 117 return false; 115 118 } 119 116 120 function isStruct($array) { 117 121 /* Nasty function to check if an array is a struct or not */ … … 181 185 } 182 186 function tag_open($parser, $tag, $attr) { 183 187 $this->_currentTagContents = ''; 184 188 $this->currentTag = $tag; 185 189 switch($tag) { … … 271 275 } 272 276 } 273 277 $this->_currentTagContents = ''; 274 278 } 275 279 } … … 335 339 function call($methodname, $args) { 336 340 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.'); 338 343 } 339 344 $method = $this->callbacks[$methodname]; … … 348 353 $method = substr($method, 5); 349 354 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.'); 351 357 } 352 358 // Call the method … … 355 361 // It's a function - does it exist? 356 362 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 } 360 367 } 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.'); 362 370 } 363 371 // Call the function … … 491 499 var $message = false; 492 500 var $debug = false; 493 501 var $timeout; 494 502 // Storage place for an error message 495 503 var $error = false; … … 510 518 $this->port = $port; 511 519 } 512 $this->useragent = ' Incutio XML-RPC';513 520 $this->useragent = 'The Incutio XML-RPC PHP Library'; 521 $this->timeout = $timeout; 514 522 } 515 523 function query() { … … 557 565 } 558 566 if (!$gettingHeaders) { 559 $contents .= trim($line) ."\n";567 $contents .= trim($line); 560 568 } 561 569 } … … 604 612 function IXR_Error($code, $message) { 605 613 $this->code = $code; 606 $this->message = htmlspecialchars($message);614 $this->message = $message; 607 615 } 608 616 function getXml() { … … 666 674 $this->minute = substr($iso, 12, 2); 667 675 $this->second = substr($iso, 15, 2); 668 $this->timezone = substr($iso, 17);669 676 } 670 677 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; 672 679 } 673 680 function getXml() { -
trunk/wp-includes/taxonomy.php
r8363 r8376 762 762 global $wpdb; 763 763 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 764 767 if ( is_int($term) ) { 765 768 if ( 0 == $term ) 766 769 return 0; 767 770 $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) ); 778 794 } 779 795 -
trunk/wp-includes/version.php
r8365 r8376 16 16 * @global int $wp_db_version 17 17 */ 18 $wp_db_version = 8 202;18 $wp_db_version = 8370; 19 19 20 20 ?>
Note: See TracChangeset
for help on using the changeset viewer.