Changeset 13426
- Timestamp:
- 02/26/2010 06:14:26 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/wp-db.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r13387 r13426 21 21 22 22 /** 23 * @since {@internal Version Unknown}}23 * @since 2.5.0 24 24 */ 25 25 define( 'OBJECT_K', 'OBJECT_K', false ); … … 120 120 * Results of the last query made 121 121 * 122 * @since {@internal Version Unknown}}122 * @since 1.0.0 123 123 * @access private 124 124 * @var array|null … … 187 187 * List of WordPress per-blog tables 188 188 * 189 * @since {@internal Version Unknown}}189 * @since 2.5.0 190 190 * @access private 191 191 * @see wpdb::tables() … … 267 267 * WordPress Post Metadata table 268 268 * 269 * @since {@internal Version Unknown}}269 * @since 1.5.0 270 270 * @access public 271 271 * @var string … … 471 471 * to the database. 472 472 * 473 * @link http://core.trac.wordpress.org/ticket/3354 473 474 * @since 2.0.8 474 475 * … … 534 535 * PHP5 style destructor and will run when database object is destroyed. 535 536 * 537 * @see wpdb::__construct() 536 538 * @since 2.0.8 537 539 * @return bool true … … 635 637 * 636 638 * 'all' - returns 'all' and 'global' tables. No old tables are returned. 639 * 'blog' - returns the blog-level tables for the queried blog. 637 640 * 'global' - returns the global tables for the installation, returning multisite tables only if running multisite. 638 641 * 'ms_global' - returns the multisite global tables, regardless if current installation is multisite. 639 * 'blog' - returns the blog-level tables for the queried blog.640 642 * 'old' - returns tables which are deprecated. 641 643 * … … 650 652 * @param bool $prefix Optional. Whether to include table prefixes. Default true. If blog 651 653 * prefix is requested, then the custom users and usermeta tables will be mapped. 652 * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb:: blogid. Used only when prefix is requested.654 * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::$blogid. Used only when prefix is requested. 653 655 * @return array Table names. When a prefix is requested, the key is the unprefixed table name. 654 656 */ … … 659 661 if ( is_multisite() ) 660 662 $tables = array_merge( $tables, $this->ms_global_tables ); 663 break; 664 case 'blog' : 665 $tables = $this->tables; 661 666 break; 662 667 case 'global' : … … 667 672 case 'ms_global' : 668 673 $tables = $this->ms_global_tables; 669 break;670 case 'blog' :671 $tables = $this->tables;672 674 break; 673 675 case 'old' : … … 734 736 * 735 737 * @see addslashes() 736 * @since {@internal Version Unknown}}737 * @access private 738 * 739 * @param string $string738 * @since 2.8.0 739 * @access private 740 * 741 * @param string $string 740 742 * @return string 741 743 */ … … 872 874 $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it 873 875 $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting 874 $query = preg_replace( '|(?<!%)%s|', "'%s'", $query); // quote the strings, avoiding escaped strings like %%s876 $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s 875 877 array_walk( $args, array( &$this, 'escape_by_ref' ) ); 876 878 return @vsprintf( $query, $args ); … … 897 899 898 900 if ( $caller = $this->get_caller() ) 899 $error_str = sprintf( /*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller);901 $error_str = sprintf( /*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller ); 900 902 else 901 $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query); 902 903 if ( function_exists('error_log') && $log_file = @ini_get('error_log') && ( 'syslog' == $log_file || is_writable( $log_file ) ) ) 904 @error_log( $error_str, 0 ); 905 906 // Is error output turned on or not.. 903 $error_str = sprintf( /*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query ); 904 905 if ( function_exists( 'error_log' ) 906 && $log_file = @ini_get( 'error_log' ) 907 && ( 'syslog' == $log_file || @is_writable( $log_file ) ) 908 ) 909 @error_log( $error_str ); 910 911 // Are we showing errors? 907 912 if ( ! $this->show_errors ) 908 913 return false;
Note: See TracChangeset
for help on using the changeset viewer.