File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -808,20 +808,21 @@ function wp_set_wpdb_vars() {
808808 * @return bool The current 'using' setting.
809809 */
810810function wp_using_ext_object_cache ( $ using = null ) {
811- global $ _wp_using_ext_object_cache ;
811+ global $ _wp_using_ext_object_cache ;
812812
813- // Save the current state to return later.
814- $ current_using = $ _wp_using_ext_object_cache ;
813+ // Save the current state to return later.
814+ $ current_using = $ _wp_using_ext_object_cache ;
815815
816- if ( null !== $ using ) {
817- $ _wp_using_ext_object_cache = (bool ) $ using ;
818- }
816+ if ( null !== $ using ) {
817+ $ _wp_using_ext_object_cache = (bool ) $ using ;
818+ }
819+
820+ if ( null === $ _wp_using_ext_object_cache ) {
821+ // If the global is uninitialized, the value would be null, which violates the type signature.
822+ return false ;
823+ }
819824
820- /**
821- * Ensure the returned value is always a boolean.
822- * If the global is uninitialized, it could be null, which violates the type signature.
823- */
824- return (bool ) $ current_using ;
825+ return (bool ) $ current_using ;
825826}
826827
827828/**
You can’t perform that action at this time.
0 commit comments