WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 3 months ago

Last modified 3 months ago

#26171 closed defect (bug) (fixed)

Unit Tests :: formatting function get_url_in_content

Reported by: mdbitz Owned by:
Milestone: 3.9 Priority: normal
Severity: minor Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

Attached are unit tests of the get_url_in_content formatting function.

During review the function had different return values for cases when no links are found.

empty content => return ""
no links => return false;

I've attached a diff of the formatting.php file that normalizes this behavior to return false in all cases.

Attachments (2)

GetUrlInContent.php (1.2 KB) - added by mdbitz 5 months ago.
Unit Tests of get_url_in_content formatting function
26171.diff (635 bytes) - added by mdbitz 5 months ago.
modification to return false in all cases where no links exist, compliant with coding standards

Download all attachments as: .zip

Change History (4)

mdbitz5 months ago

Unit Tests of get_url_in_content formatting function

mdbitz5 months ago

modification to return false in all cases where no links exist, compliant with coding standards

comment:1 nacin3 months ago

  • Milestone changed from Awaiting Review to 3.9
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [26972]. Thanks for these, mdbitz. WordPress 3.9 has started up post-holidays and I'm looking forward to more of these. :-)

comment:2 SergeyBiryukov3 months ago

In 27019:

Remove byte order mark (BOM) from GetUrlInContent.php. see #26171.

Note: See TracTickets for help on using tickets.