summaryrefslogtreecommitdiffstats
path: root/googleanalytics.admin.inc
diff options
context:
space:
mode:
authorhass2008-05-03 13:32:01 (GMT)
committerhass2008-05-03 13:32:01 (GMT)
commit720bcf03611cb4c217fdc6bc02ce29e7ebe14fb7 (patch)
tree6ad93bb0a0bf2c5fa62300b322d8e946c21ceb38 /googleanalytics.admin.inc
parent6425d1653a10608e2af26441fc6d8a2b894b6ed5 (diff)
#231937: Validate "Custom JavaScript Code" not having <script> tags added
Diffstat (limited to 'googleanalytics.admin.inc')
-rw-r--r--googleanalytics.admin.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/googleanalytics.admin.inc b/googleanalytics.admin.inc
index 6150ccc..5a69283 100644
--- a/googleanalytics.admin.inc
+++ b/googleanalytics.admin.inc
@@ -224,6 +224,12 @@ function googleanalytics_admin_settings_form_validate($form, &$form_state) {
form_set_error('googleanalytics_account', t('A valid Google Analytics account number is case sensitive and formated like UA-xxxxxx-x.'));
}
- // Trim pages variable.
+ // This is for the Newbie's who cannot read a text area description.
+ if (preg_match('/^(.*)<\/?script(.*)>(.*)/', $form_state['values']['googleanalytics_codesnippet'])) {
+ form_set_error('googleanalytics_codesnippet', t('Do not include the &lt;script&gt; tags in this field.'));
+ }
+
+ // Trim some text area values.
$form_state['values']['googleanalytics_pages'] = trim($form_state['values']['googleanalytics_pages']);
+ $form_state['values']['googleanalytics_codesnippet'] = trim($form_state['values']['googleanalytics_codesnippet']);
}