Skip to content

Commit 3ea38b0

Browse files
authored
Check is_string() and then use empty string for comparison
1 parent 682f534 commit 3ea38b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/wp-includes/general-template.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,12 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
14241424
$title = __( 'Page not found' );
14251425
}
14261426

1427+
if ( ! is_string( $title ) ) {
1428+
$title = '';
1429+
}
1430+
14271431
$prefix = '';
1428-
if ( ! empty( $title ) ) {
1432+
if ( '' !== $title ) {
14291433
$prefix = " $sep ";
14301434
}
14311435

@@ -1436,7 +1440,7 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
14361440
*
14371441
* @param string[] $title_array Array of parts of the page title.
14381442
*/
1439-
$title_array = apply_filters( 'wp_title_parts', ! empty( $title ) ? explode( $t_sep, $title ) : array() );
1443+
$title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) );
14401444

14411445
// Determines position of the separator and direction of the breadcrumb.
14421446
if ( 'right' === $seplocation ) { // Separator on right, so reverse the order.

0 commit comments

Comments
 (0)