[wp-trac] [WordPress Trac] #63353: Invalid type false for permalink_structure property

WordPress Trac noreply at wordpress.org
Fri Apr 25 22:52:53 UTC 2025


#63353: Invalid type false for permalink_structure property
---------------------------+------------------------------
 Reporter:  kkmuffme       |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:
 Severity:  trivial        |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------------------
Description changed by sabernhardt:

Old description:

> https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes
> /class-wp-rewrite.php#L1923
>
> If the option is not set (e.g. when installing WP), get_option returns
> false, which will subsequently pass false to substr/str_ends_with which
> is invalid
> (if strict_types were used, would be a fatal TypeError)

New description:

 [https://github.com/WordPress/wordpress-
 develop/blob/c38f581f03f44e7f4bea7824973e1669a77226ab/src/wp-includes
 /class-wp-rewrite.php#L1923 class-wp-rewrite.php, line 1923]

 If the option is not set (e.g. when installing WP), `get_option` returns
 false, which will subsequently pass false to `substr`/`str_ends_with`
 which is invalid
 (if `strict_type` were used, would be a fatal `TypeError`)

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63353#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list