Skip to content

Commit dc0187b

Browse files
committed
Fixes
1 parent 34534c4 commit dc0187b

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tests/bootstrap.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ function register_activation_hook( string $file, callable|string|array $callback
121121
$es_optimizer_test_activation_hooks = array();
122122
}
123123

124-
$es_optimizer_test_activation_hooks[ $file ] = $callback;
124+
if ( ! isset( $es_optimizer_test_activation_hooks[ $file ] ) || ! is_array( $es_optimizer_test_activation_hooks[ $file ] ) ) {
125+
$es_optimizer_test_activation_hooks[ $file ] = array();
126+
}
127+
128+
$es_optimizer_test_activation_hooks[ $file ][] = $callback;
125129
}
126130
}
127131

@@ -139,7 +143,11 @@ function register_deactivation_hook( string $file, callable|string|array $callba
139143
$es_optimizer_test_deactivation_hooks = array();
140144
}
141145

142-
$es_optimizer_test_deactivation_hooks[ $file ] = $callback;
146+
if ( ! isset( $es_optimizer_test_deactivation_hooks[ $file ] ) || ! is_array( $es_optimizer_test_deactivation_hooks[ $file ] ) ) {
147+
$es_optimizer_test_deactivation_hooks[ $file ] = array();
148+
}
149+
150+
$es_optimizer_test_deactivation_hooks[ $file ][] = $callback;
143151
}
144152
}
145153

@@ -283,7 +291,7 @@ function wp_strip_all_tags( string $value, bool $remove_breaks = false ): string
283291
$normalized_value = preg_replace( '/[\r\n\t ]+/', ' ', $value );
284292

285293
if ( null === $normalized_value ) {
286-
throw new RuntimeException( 'Failed to normalize stripped tag whitespace.' );
294+
throw new RuntimeException( 'Failed to normalize stripped tag whitespace: ' . preg_last_error_msg() );
287295
}
288296

289297
$value = $normalized_value;

0 commit comments

Comments
 (0)