relative protocol url was replaced by asset filter
Reported by hiromi2424 | November 23rd, 2011 @ 02:16 PM | in 1.3.13 (closed)
What I did
use following line in app/Config/core.php:
Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
in the view:
<?php echo $this->Html->script('//example.com/js/hoge.js'); ?>
What happened
outout was:
<script type="text/javascript" src="//example.com/cjs/hoge.js"></script>
What I expected to happen
outout would be:
<script type="text/javascript" src="//example.com/cjs/hoge.js"></script>
Comments and changes to this ticket
-

hiromi2424 November 23rd, 2011 @ 02:18 PM
last line should be:
<script type="text/javascript" src="//example.com/js/hoge.js"></script> -

Mark Story November 23rd, 2011 @ 07:12 PM
- → Milestone set to 1.3.13
- → Tag changed from asset, url to asset, defect, helper, url, webroot
I'm pretty sure this exists in 1.3 and 2.0.
-

pocketcrocodile November 24th, 2011 @ 01:17 PM
http://api13.cakephp.org/view_source/html-helper/#line-409
if you include a relative url, the standard js directory is overwritten by the setting of the asset filter.
-

Mark Story November 24th, 2011 @ 07:06 PM
- → Assigned user set to Mark Story
pocketcrocodile: Rewriting relative URLs is intentional, I think hiromi's issue comes from a non relative url.
It seems like changing the
://condition to//would solve the issue. The same will probably need to be done for CSS files. -

CakePHP November 24th, 2011 @ 08:02 PM
- → State changed from new to resolved
(from [ff993f893d832220fd0da7fdf689234fe2716bdc]) Fix protocol relative urls for CSS and JS files.
Protocol relative urls are generally not on the same host
don't try and run them through the asset filters.Fixes #2285
https://github.com/cakephp/cakephp/commit/ff993f893d832220fd0da7fdf... -

CakePHP November 24th, 2011 @ 08:05 PM
(from [5180540d1f5eae68f39ff000f743669ce328d56b]) Fix protocol relative urls for CSS and JS files.
Protocol relative urls are generally not on the same host
don't try and run them through the asset filters.Fixes #2285
https://github.com/cakephp/cakephp/commit/5180540d1f5eae68f39ff000f...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
Repository is at http://github.com/cakephp/cakephp
Creating a bug report
When creating a bug report, please include as much relevant information as possible. Please include code to reproduce the issue. Or even better, make a unit test. Either change an existing test or add a new test to show that the expected behavior is not occuring.