Skip to content

Commit

Permalink
Merge pull request #2326 from WordPress/feature/escapeoutput-review-p…
Browse files Browse the repository at this point in the history
…hpcsutils-modern-php

Security/EscapeOutput: use PHPCSUtils, allow for modern PHP and slew of bug fixes
  • Loading branch information
dingo-d authored Jul 28, 2023
2 parents 7cb6224 + bb0b7d6 commit efbaa1d
Show file tree
Hide file tree
Showing 24 changed files with 1,551 additions and 535 deletions.
23 changes: 17 additions & 6 deletions WordPress/Helpers/PrintingFunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,13 @@ trait PrintingFunctionsTrait {
private $allPrintingFunctions = array();

/**
* Check if a particular function is regarded as a printing function.
* Retrieve a list of all known printing functions.
*
* @since 3.0.0
*
* @param string $functionName The name of the function to check.
*
* @return bool
* @return array<string, bool>
*/
public function is_printing_function( $functionName ) {
public function get_printing_functions() {
if ( array() === $this->allPrintingFunctions
|| $this->customPrintingFunctions !== $this->addedCustomPrintingFunctions
) {
Expand All @@ -107,6 +105,19 @@ public function is_printing_function( $functionName ) {
$this->addedCustomPrintingFunctions = $this->customPrintingFunctions;
}

return isset( $this->allPrintingFunctions[ strtolower( $functionName ) ] );
return $this->allPrintingFunctions;
}

/**
* Check if a particular function is regarded as a printing function.
*
* @since 3.0.0
*
* @param string $functionName The name of the function to check.
*
* @return bool
*/
public function is_printing_function( $functionName ) {
return isset( $this->get_printing_functions()[ strtolower( $functionName ) ] );
}
}
Loading

0 comments on commit efbaa1d

Please sign in to comment.