Skip to content

Commit f20684e

Browse files
bump version to 1.0.1, more relaxed measurement ID validation
1 parent b1946d9 commit f20684e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oc3_google_analytics",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Playful Sparkle - Google Analytics for OpenCart 3",
55
"main": "index.js",
66
"scripts": {

src/install.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ code package and also available on the project page: https://github.com/playfuls
77
<modification>
88
<name>Playful Sparkle - Google Analytics (GA4)</name>
99
<code>ps_google_analytics</code>
10-
<version>1.0.0</version>
10+
<version>1.0.1</version>
1111
<author>Playful Sparkle</author>
1212
<link>https://github.com/playfulsparkle/oc3_google_analytics.git</link>
1313
</modification>

src/upload/admin/controller/extension/analytics/ps_google_analytics.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public function index()
2222
$this->load->model('setting/setting');
2323

2424
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
25+
$this->request->post['analytics_ps_google_analytics_google_tag_id'] = strtoupper($this->request->post['analytics_ps_google_analytics_google_tag_id']);
26+
2527
$this->model_setting_setting->editSetting('analytics_ps_google_analytics', $this->request->post, $this->request->get['store_id']);
2628

2729
$this->session->data['success'] = $this->language->get('text_success');
@@ -98,7 +100,7 @@ protected function validate()
98100
if (!$this->error) {
99101
if (empty($this->request->post['analytics_ps_google_analytics_google_tag_id'])) {
100102
$this->error['google_tag_id'] = $this->language->get('error_google_tag_id');
101-
} elseif (preg_match('/^G-[A-Z0-9]{10}$/', $this->request->post['analytics_ps_google_analytics_google_tag_id']) !== 1) {
103+
} elseif (preg_match('/^G-[A-Z0-9]{10}$/', strtoupper($this->request->post['analytics_ps_google_analytics_google_tag_id'])) !== 1) {
102104
$this->error['google_tag_id'] = $this->language->get('error_google_tag_id_invalid');
103105
}
104106
}

0 commit comments

Comments
 (0)