Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#43040 closed defect (bug) (fixed)

capital_P_dangit regression

Reported by: superdav42's profile superdav42 Owned by: pento's profile pento
Milestone: 5.1 Priority: normal
Severity: normal Version: 5.1
Component: Formatting Keywords: has-patch commit has-unit-tests
Focuses: Cc:

Description

Recent code standards fixes in #41057 broke the function capital_P_dangit for some cases. The problem is kinda obvious if you look at wp-includes/formatting.php:5096.

<?php
  return str_replace( 'WordPress', 'WordPress', $text );

Attachments (1)

43040.diff (2.1 KB) - added by superdav42 6 years ago.
Patch with fix and unit tests

Download all attachments as: .zip

Change History (6)

@superdav42
6 years ago

Patch with fix and unit tests

#1 @superdav42
6 years ago

  • Keywords has-patch added

#2 @netweb
6 years ago

  • Keywords commit has-unit-tests added
  • Milestone changed from Awaiting Review to 5.0

Hi and welcome to Wordpress Trac @superdav42 ;)

Great catch, thanks for the ticket, patch, and unit tests, everything is spot on :)

FYI: The change can be seen at line ~5080 in https://core.trac.wordpress.org/changeset/42343/trunk/src/wp-includes/formatting.php

#3 @pento
6 years ago

  • Owner set to pento
  • Status changed from new to assigned

#4 @pento
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42429:

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.

#5 @johnbillion
5 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.