Changeset 56180
- Timestamp:
- 07/09/2023 09:46:24 PM (17 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r55941 r56180 322 322 } else { 323 323 $this->headers = get_file_data( $this->theme_root . '/' . $theme_file, self::$file_headers, 'theme' ); 324 // Default themes always trump their pretenders. 325 // Properly identify default themes that are inside a directory within wp-content/themes. 324 /* 325 * Default themes always trump their pretenders. 326 * Properly identify default themes that are inside a directory within wp-content/themes. 327 */ 326 328 $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes, true ); 327 329 if ( $default_theme_slug ) { … … 390 392 // If we got our data from cache, we can assume that 'template' is pointing to the right place. 391 393 if ( ! is_array( $cache ) && $this->template != $this->stylesheet && ! file_exists( $this->theme_root . '/' . $this->template . '/index.php' ) ) { 392 // If we're in a directory of themes inside /themes, look for the parent nearby. 393 // wp-content/themes/directory-of-themes/* 394 /* 395 * If we're in a directory of themes inside /themes, look for the parent nearby. 396 * wp-content/themes/directory-of-themes/* 397 */ 394 398 $parent_dir = dirname( $this->stylesheet ); 395 399 $directories = search_theme_directories(); … … 398 402 $this->template = $parent_dir . '/' . $this->template; 399 403 } elseif ( $directories && isset( $directories[ $this->template ] ) ) { 400 // Look for the template in the search_theme_directories() results, in case it is in another theme root. 401 // We don't look into directories of themes, just the theme root. 404 /* 405 * Look for the template in the search_theme_directories() results, in case it is in another theme root. 406 * We don't look into directories of themes, just the theme root. 407 */ 402 408 $theme_root_template = $directories[ $this->template ]['theme_root']; 403 409 } else { … … 1666 1672 } 1667 1673 1668 // This is all super old MU back compat joy. 1669 // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name. 1674 /* 1675 * This is all super old MU back compat joy. 1676 * 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name. 1677 */ 1670 1678 if ( false === $allowed_themes[ $blog_id ] ) { 1671 1679 if ( $current ) { -
trunk/src/wp-includes/class-wp-user.php
r55732 r56180 200 200 201 201 if ( 'id' === $field ) { 202 // Make sure the value is numeric to avoid casting objects, for example, 203 // to int 1. 202 // Make sure the value is numeric to avoid casting objects, for example, to int 1. 204 203 if ( ! is_numeric( $value ) ) { 205 204 return false; -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r56167 r56180 138 138 'metaWeblog.newMediaObject' => 'this:mw_newMediaObject', 139 139 140 // MetaWeblog API aliases for Blogger API. 141 // See http://www.xmlrpc.com/stories/storyReader$2460 140 /* 141 * MetaWeblog API aliases for Blogger API. 142 * See http://www.xmlrpc.com/stories/storyReader$2460 143 */ 142 144 'metaWeblog.deletePost' => 'this:blogger_deletePost', 143 145 'metaWeblog.getUsersBlogs' => 'this:blogger_getUsersBlogs', … … 3122 3124 do_action( 'xmlrpc_call', 'wp.deletePage', $args, $this ); 3123 3125 3124 // Get the current page based on the 'page_id' and 3125 // make sure it is a page and not a post. 3126 /* 3127 * Get the current page based on the 'page_id' and 3128 * make sure it is a page and not a post. 3129 */ 3126 3130 $actual_page = get_post( $page_id, ARRAY_A ); 3127 3131 if ( ! $actual_page || ( 'page' !== $actual_page['post_type'] ) ) { … … 3412 3416 } 3413 3417 3414 // If no slug was provided, make it empty 3415 // so that WordPress will generate one. 3418 /* 3419 * If no slug was provided, make it empty 3420 * so that WordPress will generate one. 3421 */ 3416 3422 if ( empty( $category['slug'] ) ) { 3417 3423 $category['slug'] = ''; 3418 3424 } 3419 3425 3420 // If no parent_id was provided, make it empty 3421 // so that it will be a top-level page (no parent). 3426 /* 3427 * If no parent_id was provided, make it empty 3428 * so that it will be a top-level page (no parent). 3429 */ 3422 3430 if ( ! isset( $category['parent_id'] ) ) { 3423 3431 $category['parent_id'] = ''; … … 5619 5627 $this->attach_uploads( $post_id, $post_content ); 5620 5628 5621 // Handle post formats if assigned, value is validated earlier 5622 // in this function. 5629 /* 5630 * Handle post formats if assigned, value is validated earlier 5631 * in this function. 5632 */ 5623 5633 if ( isset( $content_struct['wp_post_format'] ) ) { 5624 5634 set_post_format( $post_id, $content_struct['wp_post_format'] ); … … 6999 7009 } 7000 7010 7001 // We're going to use this fake tag to mark the context in a bit. 7002 // The marker is needed in case the link text appears more than once in the paragraph. 7011 /* 7012 * We're going to use this fake tag to mark the context in a bit. 7013 * The marker is needed in case the link text appears more than once in the paragraph. 7014 */ 7003 7015 $excerpt = preg_replace( '|\</?wpcontext\>|', '', $para ); 7004 7016 -
trunk/src/wp-includes/class-wp.php
r55988 r56180 201 201 } 202 202 203 // The requested permalink is in $pathinfo for path info requests and 204 // $req_uri for other requests. 203 // The requested permalink is in $pathinfo for path info requests and $req_uri for other requests. 205 204 if ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) { 206 205 $requested_path = $pathinfo; -
trunk/src/wp-includes/class-wpdb.php
r56066 r56180 2156 2156 } 2157 2157 2158 // We need to check for an IPv6 address first. 2159 // An IPv6 address will always contain at least two colons. 2158 /* 2159 * We need to check for an IPv6 address first. 2160 * An IPv6 address will always contain at least two colons. 2161 */ 2160 2162 if ( substr_count( $host, ':' ) > 1 ) { 2161 2163 $pattern = '#^(?:\[)?(?P<host>[0-9a-fA-F:]+)(?:\]:(?P<port>[\d]+))?#'; … … 2214 2216 2215 2217 for ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) { 2216 // On the last try, re-enable warnings. We want to see a single instance 2217 // of the "unable to connect" message on the bail() screen, if it appears. 2218 /* 2219 * On the last try, re-enable warnings. We want to see a single instance 2220 * of the "unable to connect" message on the bail() screen, if it appears. 2221 */ 2218 2222 if ( $this->reconnect_retries === $tries && WP_DEBUG ) { 2219 2223 error_reporting( $error_reporting ); … … 2231 2235 } 2232 2236 2233 // If template_redirect has already happened, it's too late for wp_die()/dead_db(). 2234 // Let's just return and hope for the best. 2237 /* 2238 * If template_redirect has already happened, it's too late for wp_die()/dead_db(). 2239 * Let's just return and hope for the best. 2240 */ 2235 2241 if ( did_action( 'template_redirect' ) ) { 2236 2242 return false; … … 2265 2271 $this->bail( $message, 'db_connect_fail' ); 2266 2272 2267 // Call dead_db() if bail didn't die, because this database is no more. 2268 // It has ceased to be (at least temporarily). 2273 /* 2274 * Call dead_db() if bail didn't die, because this database is no more. 2275 * It has ceased to be (at least temporarily). 2276 */ 2269 2277 dead_db(); 2270 2278 } … … 2314 2322 if ( $this->check_current_query && ! $this->check_ascii( $query ) ) { 2315 2323 $stripped_query = $this->strip_invalid_text_from_query( $query ); 2316 // strip_invalid_text_from_query() can perform queries, so we need 2317 // to flush again, just to make sure everything is clear. 2324 /* 2325 * strip_invalid_text_from_query() can perform queries, so we need 2326 * to flush again, just to make sure everything is clear. 2327 */ 2318 2328 $this->flush(); 2319 2329 if ( $stripped_query !== $query ) { … … 2343 2353 $mysql_errno = mysqli_errno( $this->dbh ); 2344 2354 } else { 2345 // $dbh is defined, but isn't a real connection. 2346 // Something has gone horribly wrong, let's try a reconnect. 2355 /* 2356 * $dbh is defined, but isn't a real connection. 2357 * Something has gone horribly wrong, let's try a reconnect. 2358 */ 2347 2359 $mysql_errno = 2006; 2348 2360 } … … 3123 3135 return $this->last_result; 3124 3136 } elseif ( OBJECT_K === $output ) { 3125 // Return an array of row objects with keys from column 1. 3126 // (Duplicates are discarded.) 3137 /* 3138 * Return an array of row objects with keys from column 1. 3139 * (Duplicates are discarded.) 3140 */ 3127 3141 if ( $this->last_result ) { 3128 3142 foreach ( $this->last_result as $row ) { … … 3530 3544 } else { 3531 3545 $length = false; 3532 // Since we have no length, we'll never truncate. Initialize the variable to false. 3533 // True would take us through an unnecessary (for this case) codepath below. 3546 /* 3547 * Since we have no length, we'll never truncate. Initialize the variable to false. 3548 * True would take us through an unnecessary (for this case) codepath below. 3549 */ 3534 3550 $truncate_by_byte_length = false; 3535 3551 } -
trunk/src/wp-includes/comment.php
r55988 r56180 652 652 global $wpdb; 653 653 654 // Simple duplicate check. 655 // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) 654 /* 655 * Simple duplicate check. 656 * expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) 657 */ 656 658 $dupe = $wpdb->prepare( 657 659 "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s ", … … 1353 1355 continue; } 1354 1356 1355 // Do some escaping magic so that '#' chars 1356 // in the spam words don't break things: 1357 // Do some escaping magic so that '#' chars in the spam words don't break things: 1357 1358 $word = preg_quote( $word, '#' ); 1358 1359 -
trunk/src/wp-includes/cron.php
r55988 r56180 542 542 */ 543 543 function wp_clear_scheduled_hook( $hook, $args = array(), $wp_error = false ) { 544 // Backward compatibility. 545 // Previously, this function took the arguments as discrete vars rather than an array like the rest of the API. 544 /* 545 * Backward compatibility. 546 * Previously, this function took the arguments as discrete vars rather than an array like the rest of the API. 547 */ 546 548 if ( ! is_array( $args ) ) { 547 549 _deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) ); -
trunk/src/wp-includes/default-constants.php
r56042 r56180 96 96 } 97 97 98 // Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting 99 // for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off. 98 /* 99 * Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting 100 * for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off. 101 */ 100 102 if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { 101 103 define( 'WP_DEBUG_DISPLAY', true ); … … 111 113 } 112 114 113 // Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified, 114 // non-concatenated scripts and stylesheets. 115 /* 116 * Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified, 117 * non-concatenated scripts and stylesheets. 118 */ 115 119 if ( ! defined( 'SCRIPT_DEBUG' ) ) { 116 120 if ( ! empty( $wp_version ) ) { -
trunk/src/wp-includes/embed.php
r53912 r56180 511 511 ); 512 512 513 // Note that the script must be placed after the <blockquote> and <iframe> due to a regexp parsing issue in 514 // `wp_filter_oembed_result()`. Because of the regex pattern starts with `|(<blockquote>.*?</blockquote>)?.*|` 515 // wherein the <blockquote> is marked as being optional, if it is not at the beginning of the string then the group 516 // will fail to match and everything will be matched by `.*` and not included in the group. This regex issue goes 517 // back to WordPress 4.4, so in order to not break older installs this script must come at the end. 513 /* 514 * Note that the script must be placed after the <blockquote> and <iframe> due to a regexp parsing issue in 515 * `wp_filter_oembed_result()`. Because of the regex pattern starts with `|(<blockquote>.*?</blockquote>)?.*|` 516 * wherein the <blockquote> is marked as being optional, if it is not at the beginning of the string then the group 517 * will fail to match and everything will be matched by `.*` and not included in the group. This regex issue goes 518 * back to WordPress 4.4, so in order to not break older installs this script must come at the end. 519 */ 518 520 $output .= wp_get_inline_script_tag( 519 521 file_get_contents( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' ) -
trunk/src/wp-includes/feed.php
r55988 r56180 798 798 799 799 $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); 800 // We must manually overwrite $feed->sanitize because SimplePie's constructor 801 // sets it before we have a chance to set the sanitization class. 800 /* 801 * We must manually overwrite $feed->sanitize because SimplePie's constructor 802 * sets it before we have a chance to set the sanitization class. 803 */ 802 804 $feed->sanitize = new WP_SimplePie_Sanitize_KSES(); 803 805
Note: See TracChangeset
for help on using the changeset viewer.