Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
google_analytics
Commits
5ba7aaba
Commit
5ba7aaba
authored
Apr 02, 2012
by
hass
Browse files
#1509610: Invalid dashes in UA–xxxxxxxx–y cannot copied & pasted from
Google Analytics website
parent
47809f7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
googleanalytics.admin.inc
View file @
5ba7aaba
...
...
@@ -430,6 +430,9 @@ function googleanalytics_admin_settings_form_validate($form, &$form_state) {
$form_state
[
'values'
][
'googleanalytics_codesnippet_before'
]
=
trim
(
$form_state
[
'values'
][
'googleanalytics_codesnippet_before'
]);
$form_state
[
'values'
][
'googleanalytics_codesnippet_after'
]
=
trim
(
$form_state
[
'values'
][
'googleanalytics_codesnippet_after'
]);
// Replace all type of dashes (n-dash, m-dash, minus) with the normal dashes.
$form_state
[
'values'
][
'googleanalytics_account'
]
=
str_replace
(
array
(
'–'
,
'—'
,
'−'
),
'-'
,
$form_state
[
'values'
][
'googleanalytics_account'
]);
if
(
!
preg_match
(
'/^UA-\d{4,}-\d+$/'
,
$form_state
[
'values'
][
'googleanalytics_account'
]))
{
form_set_error
(
'googleanalytics_account'
,
t
(
'A valid Google Analytics Web Property ID is case sensitive and formatted like UA-xxxxxxx-yy.'
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment