fix null strpos param (#48476)

* fix null strpos param

check whether $plugin_page is set prior to passing it to strpos

* Add changefile(s) from automation for the following project(s): woocommerce

* Update plugins/woocommerce/src/Internal/Admin/Orders/PageController.php

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Update PageController.php

fix eslint error

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
This commit is contained in:
olsonpm 2024-06-18 21:23:34 -05:00 committed by GitHub
parent 1dd10f6269
commit 972ed9eee7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix a null parameter being passed into strpos in Admin/Orders/PageController.php

View File

@ -143,7 +143,7 @@ class PageController {
}
// Not on an Orders page.
if ( 'admin.php' !== $pagenow || 0 !== strpos( $plugin_page, 'wc-orders' ) ) {
if ( empty( $plugin_page ) || 'admin.php' !== $pagenow || 0 !== strpos( $plugin_page, 'wc-orders' ) ) {
return;
}