Skip to content

Commit 35b1319

Browse files
committed
Small code fixes
1 parent c01006d commit 35b1319

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

event/listener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function getSubscribedEvents()
6161
{
6262
return [
6363
'core.page_header' => 'load_google_analytics',
64-
'core.acp_board_config_edit_add' => 'add_googleanalytics_configs',
64+
'core.acp_board_config_edit_add'=> 'add_googleanalytics_configs',
6565
'core.validate_config_variable' => 'validate_googleanalytics_id',
6666
'core.page_footer_after' => 'append_agreement',
6767
];
@@ -77,9 +77,9 @@ public function load_google_analytics()
7777
{
7878
$this->template->assign_vars([
7979
'GOOGLEANALYTICS_ID' => $this->config['googleanalytics_id'],
80-
'GOOGLEANALYTICS_USER_ID' => $this->user->data['user_id'],
81-
'S_ANONYMIZE_IP' => $this->config['ga_anonymize_ip'],
82-
'S_COOKIE_SECURE' => $this->config['cookie_secure'],
80+
'GOOGLEANALYTICS_USER_ID' => (int) $this->user->data['user_id'],
81+
'S_ANONYMIZE_IP' => (bool) $this->config['ga_anonymize_ip'],
82+
'S_COOKIE_SECURE' => (bool) $this->config['cookie_secure'],
8383
]);
8484
}
8585

@@ -136,7 +136,7 @@ public function add_googleanalytics_configs($event)
136136
*/
137137
public function validate_googleanalytics_id($event)
138138
{
139-
// Check if the validate test is for google_analytics
139+
// Check if the validation test is for googleanalytics_id
140140
if ($event['config_definition']['validate'] !== 'googleanalytics_id' || empty($event['cfg_array']['googleanalytics_id']))
141141
{
142142
return;

migrations/v10x/m4_remove_legacy_tag_option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace phpbb\googleanalytics\migrations\v10x;
1212

1313
/**
14-
* Migration stage 4: Remove legacy Google Analytics tag config option
14+
* Migration stage 4: Remove the legacy Google Analytics tag config option
1515
*/
1616
class m4_remove_legacy_tag_option extends \phpbb\db\migration\migration
1717
{

migrations/v10x/m5_clear_legacy_googleanalytics_id.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function depends_on()
2828
*/
2929
public function effectively_installed()
3030
{
31-
return !preg_match('/^UA-\d{4,9}-\d{1,4}$/', (string) $this->config['googleanalytics_id']);
31+
return !preg_match('/^UA-\d{4,9}-\d{1,4}$/', $this->config['googleanalytics_id']);
3232
}
3333

3434
/**

0 commit comments

Comments
 (0)