[wp-trac] [WordPress Trac] #59450: Initialize $url variable later in get_bloginfo()

WordPress Trac noreply at wordpress.org
Thu Dec 7 22:32:24 UTC 2023


#59450: Initialize $url variable later in get_bloginfo()
------------------------------+--------------------------
 Reporter:  Cybr              |       Owner:  flixos90
     Type:  enhancement       |      Status:  reviewing
 Priority:  normal            |   Milestone:  6.5
Component:  General           |     Version:  2.3
 Severity:  minor             |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  performance
------------------------------+--------------------------
Changes (by flixos90):

 * keywords:  has-patch => has-patch commit
 * owner:  (none) => flixos90
 * status:  new => reviewing
 * type:  defect (bug) => enhancement


Comment:

 Since the `str_contains()` vs `preg_match()` comparison doesn't show a
 clear winner in performance, it's likely insignificant regardless. So
 given the existing code uses `str_contains()`, we should probably just
 stick to that.

 So what I'm leaning towards is modifying [attachment:"general-
 template.php.patch"] to use the following in the `if` clause (instead of
 `preg_match()`):
 `str_contains( $show, 'url' ) || str_contains( $show, 'directory' ) ||
 str_contains( $show, 'home' )`

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


More information about the wp-trac mailing list