Skip to content

Commit 2472b10

Browse files
committed
Use safer string comparisons and better conditional ordering
1 parent d8bfc32 commit 2472b10

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

event/listener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function add_googleanalytics_configs($event)
8181
$this->user->add_lang_ext('phpbb/googleanalytics', 'googleanalytics_acp');
8282

8383
// Add a config to the settings mode, after board_timezone
84-
if ($event['mode'] == 'settings' && isset($event['display_vars']['vars']['board_timezone']))
84+
if ($event['mode'] === 'settings' && isset($event['display_vars']['vars']['board_timezone']))
8585
{
8686
// Store display_vars event in a local variable
8787
$display_vars = $event['display_vars'];
@@ -117,7 +117,7 @@ public function validate_googleanalytics_id($event)
117117
$input = $event['cfg_array']['googleanalytics_id'];
118118

119119
// Check if the validate test is for google_analytics
120-
if (($event['config_definition']['validate'] == 'googleanalytics_id') && ($input !== ''))
120+
if ($input !== '' && $event['config_definition']['validate'] === 'googleanalytics_id')
121121
{
122122
// Store the error and input event data
123123
$error = $event['error'];

0 commit comments

Comments
 (0)