Skip to content

Commit c4915b5

Browse files
committed
Update the escaping functions trait
Add a way to identify static methods in the is_escaping_function, used for setting the customEscapingFunctions.
1 parent f9f0bdc commit c4915b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

WordPress/Helpers/EscapingFunctionsTrait.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ final public function is_escaping_function( $functionName ) {
226226
$this->addedCustomEscapingFunctions['escape'] = $this->customEscapingFunctions;
227227
}
228228

229-
return isset( $this->allEscapingFunctions[ strtolower( $functionName ) ] );
229+
// Check if the $functionName is a static method or not.
230+
if ( strpos( $functionName, '::' ) === false ) {
231+
$functionName = strtolower( $functionName );
232+
}
233+
234+
return isset( $this->allEscapingFunctions[ $functionName ] );
230235
}
231236

232237
/**

0 commit comments

Comments
 (0)