Skip to content

Commit e43f99a

Browse files
committed
Use in_array() in strict mode wherever applicable
1 parent 08e73be commit e43f99a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Configurator/JavaScript.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ protected function getSource()
378378
$src = '';
379379

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

383383
// Prepare the list of files
384384
$files = glob($rootDir . '/Parser/AttributeFilters/*.js');

src/Plugins/HTMLElements/Configurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ protected function allowElementWithSafety($elName, $allowUnsafe)
156156
$elName = $this->normalizeElementName($elName);
157157
$tagName = $this->prefix . ':' . $elName;
158158

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

0 commit comments

Comments
 (0)