summaryrefslogtreecommitdiffstats
path: root/googleanalytics.admin.inc
diff options
context:
space:
mode:
authorhass2008-05-31 08:02:57 (GMT)
committerhass2008-05-31 08:02:57 (GMT)
commit131abcd75d282bdb59e38c7b7095ecb94dc317e7 (patch)
tree044f7402de7250b9029a57995464e42adb33eb52 /googleanalytics.admin.inc
parent0c2020fb0ef38dd15c8491eb92de1cc6a4be5271 (diff)
#264417: Hopefully, final validation try to detect tracker code in custom javascript code field
Diffstat (limited to 'googleanalytics.admin.inc')
-rw-r--r--googleanalytics.admin.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/googleanalytics.admin.inc b/googleanalytics.admin.inc
index 77b13e8..7555abc 100644
--- a/googleanalytics.admin.inc
+++ b/googleanalytics.admin.inc
@@ -237,7 +237,10 @@ function googleanalytics_admin_settings_form_validate($form, &$form_state) {
}
// This is for the Newbie's who cannot read a text area description.
- if (preg_match('/^(.*)<\/?script(.*)>(.*)/', $form_state['values']['googleanalytics_codesnippet'])) {
+ if (stristr($form_state['values']['googleanalytics_codesnippet'], 'http://www.google-analytics.com/urchin.js') || stristr($form_state['values']['googleanalytics_codesnippet'], 'google-analytics.com/ga.js')) {
+ form_set_error('googleanalytics_codesnippet', t('Do not add your websites original Google tracker code into this field! This module already builds the tracker code based on your Google Analytics account number and settings.'));
+ }
+ if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state['values']['googleanalytics_codesnippet'])) {
form_set_error('googleanalytics_codesnippet', t('Do not include the &lt;script&gt; tags in this field.'));
}