Closed (won't fix)
Project:
Drupal core
Version:
x.y.z
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2006 at 21:45 UTC
Updated:
7 May 2006 at 03:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
apatel commentedIn function drupal_add_js()
Consider following scenario
base_path() returns "/"
$file contains "http://www.google...";
call: drupal_add_js("http://www.googleanalytics....");
Instead of producing
GTscript type="text/javascript" src="http://www.googleanalystics.com/urchin.js"LTGTscriptLT
The above call in that particular scenario will produce:
GTscript type="text/javascript" src="//www.googleanalystics.com/urchin.js"LTGT/scriptLT
(pardon the GT LT's apparently i can't pick format as plain text).
Reason: because of base_path prefix(). Please consider fixing this. I'm not suggesting to remove base_path() as prefix (as that would certainly break other things).
Comment #2
paddy_deburca commentedI cannot comment on the security implications of including 3rd party scripts in one's own website.
This may be necessary for some google-like applications.
Try this patch to test if the URL is a valid URL with all the http://, https:// or ftp:// bits 'n pieces.
Paddy.
Comment #3
chx commentedthis is to add Drupal JS scripts. Use drupal_set_html_head IMO.
Comment #4
drummI agree with chx. We don't need to put in extra logic for third party scripts that can be added with drupal_set_html_head(). I don't see the lack of duplicate detection (main feature of drupal_add_js()) as being a problem for the Google example.