Make WordPress Core

Opened 21 years ago

Closed 21 years ago

Last modified 7 weeks ago

#1 closed defect (bug) (fixed)

Handle https:// when manipulating 'home'

Reported by: ryan's profile ryan Owned by: ryan's profile ryan
Milestone: Priority: normal
Severity: minor Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

This:

preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' )

Instead of this:

preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' )

Change History (10)

#2 @ryan
21 years ago

  • Version set to 1.3

#3 @ryan
21 years ago

  • Owner changed from anonymous to rboren
  • Status changed from new to assigned

#4 @ryan
21 years ago

  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

#6 @techboyg5
5 years ago

First Trac ticket?

#7 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#8 @underwer
3 years ago

#55323 was marked as a duplicate.

This ticket was mentioned in PR #8764 on WordPress/wordpress-develop by @shanemac10.


7 weeks ago
#9

  • Keywords has-patch added

The untrailingslashit function in formatting.php passes the $value param directly into the PHP rtrim function, which only takes Strings. Anything else trows a "Deprecated" warning (example below).

In my personal case, Yoast SEO was the culprit in the stacktrace, but this untrailingslashit should at least validate and/or cast the $value param to String with strval before calling rtrim.

Incoming updated version:

function untrailingslashit( $value ) {
        return rtrim( strval( $value ), '/\\' ); // <-- Cast $value to String with strval()
}

Previous unvalidated version:

function untrailingslashit( $value ) {
        return rtrim( $value, '/\\' );
}

Fixes these types of errors:
Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-includes/formatting.php on line 2819

Trac ticket: 63379 Fix for deprecated rtrim passing null to parameter

This ticket was mentioned in PR #8765 on WordPress/wordpress-develop by @shanemac10.


7 weeks ago
#10

Fixes errors like the following:
Deprecated: rtrim(): Passing null to parameter 1 ($string) of type string is deprecated in /wp-includes/formatting.php on line 2819

The untrailingslashit function in formatting.php passes the $value param directly into the PHP rtrim function, which only takes Strings. Anything else trows a "Deprecated" warning (example below).

In my personal case, Yoast SEO was the culprit in the stacktrace, but this untrailingslashit should at least validate and/or cast the $value param to String with strval before calling rtrim.

Incoming updated version:

function untrailingslashit( $value ) {
        return rtrim( strval( $value ), '/\\' ); // <-- Cast $value to String with strval()
}

Previous unvalidated version:

function untrailingslashit( $value ) {
        return rtrim( $value, '/\\' );
}

Fixes these types of errors:
Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-includes/formatting.php on line 2819

Trac ticket: 63379 Fix for deprecated rtrim passing null to parameter

Note: See TracTickets for help on using tickets.