From fbb1f9162bc6299a97ab8e3aafe30661b27ff241 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 8 Jan 2018 10:36:51 +0000 Subject: [PATCH] Formatting: Fix capital_P_dangit() not capital P-ing, dangit. Unfortunately, in my overzealous desire to fix all the un-capitalised Ps, [42343] capitalled some Ps that intentionally should not be capitals. This commit fixes the incorrectly capitalling of Ps, as well as including unit tests and PHPCS instructions to ensure we never capitulate to capitalisationing them again. Props superdav42. Fixes #43040. Fixes #43041. Built from https://develop.svn.wordpress.org/trunk@42429 git-svn-id: http://core.svn.wordpress.org/trunk@42259 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index b0312d462c..8c2daae1f5 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -5077,8 +5077,9 @@ function wp_basename( $path, $suffix = '' ) { return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) ); } +// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled, WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid -- 8-) /** - * Forever eliminate "WordPress" from the planet (or at least the little bit we can influence). + * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence). * * Violating our coding standards for a good function name. * @@ -5093,7 +5094,7 @@ function capital_P_dangit( $text ) { // Simple replacement for titles $current_filter = current_filter(); if ( 'the_title' === $current_filter || 'wp_title' === $current_filter ) { - return str_replace( 'WordPress', 'WordPress', $text ); + return str_replace( 'Wordpress', 'WordPress', $text ); } // Still here? Use the more judicious replacement static $dblq = false; @@ -5106,6 +5107,7 @@ function capital_P_dangit( $text ) { $text ); } +// phpcs:enable /** * Sanitize a mime type diff --git a/wp-includes/version.php b/wp-includes/version.php index 9d44462115..856037a1cc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42426'; +$wp_version = '5.0-alpha-42429'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.