Skip to content

Commit

Permalink
Closes #6993: Add a condition to bailout (#7251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miraeld authored and Khadreal committed Feb 11, 2025
1 parent 8d20596 commit 2082e97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/Engine/Optimization/RegexTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function replace_html_comment( $match ) { // phpcs:ignore Universal.Na
* @return string
*/
protected function restore_html_comments( $html ) {
if ( empty( $this->html_replace ) ) {
if ( ! is_string( $html ) || empty( $this->html_replace ) ) { // @phpstan-ignore-line For some reason, html could be null for some users, and we can't find a way to reproduce it.
return $html;
}

Expand Down

0 comments on commit 2082e97

Please sign in to comment.