Skip to content

Commit

Permalink
Use in_array() in strict mode wherever applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Mar 24, 2024
1 parent 08e73be commit e43f99a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Configurator/JavaScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ protected function getSource()
$src = '';

// If getLogger() is not exported we use a dummy Logger that can be optimized away
$logger = (in_array('getLogger', $this->exports)) ? 'Logger.js' : 'NullLogger.js';
$logger = (in_array('getLogger', $this->exports, true)) ? 'Logger.js' : 'NullLogger.js';

// Prepare the list of files
$files = glob($rootDir . '/Parser/AttributeFilters/*.js');
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/HTMLElements/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function allowElementWithSafety($elName, $allowUnsafe)
$elName = $this->normalizeElementName($elName);
$tagName = $this->prefix . ':' . $elName;

if (!$allowUnsafe && in_array($elName, $this->unsafeElements))
if (!$allowUnsafe && in_array($elName, $this->unsafeElements, true))
{
throw new RuntimeException("'" . $elName . "' elements are unsafe and are disabled by default. Please use " . __CLASS__ . '::allowUnsafeElement() to bypass this security measure');
}
Expand Down Expand Up @@ -221,7 +221,7 @@ protected function allowAttributeWithSafety($elName, $attrName, $allowUnsafe)
if (!$allowUnsafe)
{
if (substr($attrName, 0, 2) === 'on'
|| in_array($attrName, $this->unsafeAttributes))
|| in_array($attrName, $this->unsafeAttributes, true))
{
throw new RuntimeException("'" . $attrName . "' attributes are unsafe and are disabled by default. Please use " . __CLASS__ . '::allowUnsafeAttribute() to bypass this security measure');
}
Expand Down

0 comments on commit e43f99a

Please sign in to comment.