[wp-trac] [WordPress Trac] #52642: Site Health resets htpasswd authorization on scroll

WordPress Trac noreply at wordpress.org
Wed Jun 2 14:13:31 UTC 2021


#52642: Site Health resets htpasswd authorization on scroll
--------------------------------------+-----------------------
 Reporter:  WebDragon                 |       Owner:  Clorith
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  5.8
Component:  Site Health               |     Version:  5.6
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  rest-api
--------------------------------------+-----------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 `wp_is_site_protected_by_basic_auth()` is defined in `wp-
 includes/load.php` and is used without a `function_exists()` check in:

 * [source:tags/5.7.2/src/wp-admin/authorize-application.php?marks=91#L84
 wp-admin/authorize-application.php]
 * [source:tags/5.7.2/src/wp-admin/user-edit.php?marks=763#L762 wp-admin
 /user-edit.php]

 Why do we check if it exists here?

 Same goes for `rest_url()`, we use it without a `function_exists()` check
 [source:tags/5.7.2/src/wp-admin/includes/class-wp-site-
 health.php?marks=2314,2320,2326,2332,2338#L2311 right above in the same
 method], and then for some reason check if it exists :)

 It seems to me that these two checks are redundant, see
 [attachment:"52642.diff"].

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


More information about the wp-trac mailing list