Skip to content

Commit 6cdd560

Browse files
committed
Some fixes for $input
1 parent 962eb22 commit 6cdd560

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

event/listener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ public function add_googleanalytics_configs($event)
121121
*/
122122
public function validate_googleanalytics_id($event)
123123
{
124+
$input = $event['cfg_array']['googleanalytics_id'];
125+
124126
// Check if the validate test is for google_analytics
125-
if ($event['config_definition']['validate'] == 'googleanalytics_id')
127+
if (($event['config_definition']['validate'] == 'googleanalytics_id') && ($input is !== ''))
126128
{
127129
// Store the error and input event data
128130
$error = $event['error'];
129-
$input = $event['cfg_array'][$event['config_name']];
130131

131132
// Add error message if the input is not a valid Google Analytics ID
132133
if (!preg_match('/^ua-\d{4,9}-\d{1,4}$/i', $input))

0 commit comments

Comments
 (0)