Create an article with text containing a URL with no protocol. A good example could be an embed of a dailymotion video which contains no protocol in the iframe src of the embed code. Then try to view a feed containing that article.
The expected result is that the iframe src is not modified.
Joomla tries to replace all relative links to absolute links in feeds. The function _relToAbs of JDocumentRenderer class considers incorrectly that URLs with no protocol are relative links and prepends the site's absolute URL to them.
Checked under Joomla! 3.4.8 and 3.5 BETA 2.
It prepends the site's URL in that case. So the result src is http://yoursite.com///www.dailymotion.com/embed/video/x3okfgt .
I have no problem with that embed in an article when using no-editor or
when using tinymce (after allowing iframe in the plugin)
On 1 February 2016 at 12:29, Lefteris Kavadas notifications@github.com
wrote:
It prepends the site's URL in that case. So the src attribute becomes
http://yoursite.com///www.dailymotion.com/embed/video/x3okfgt .
This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9039
https://issues.joomla.org/tracker/joomla-cms/9039.—
Reply to this email directly or view it on GitHub
#9039 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
This is not related with the editor. The video is fine in the article page. The issue occurs in feed views where the JDocumentRenderer _relToAbs function is called. Try to view the RSS feed of the article's category and you should be able to reproduce the issue.
Sorry I missed that part of your instructions. Will test again later.
On 1 Feb 2016 4:31 pm, "Lefteris Kavadas" notifications@github.com wrote:
This is not related with the editor. The video is fine in the article
page. The issue occurs in feed views where the JDocumentRenderer _relToAbs
function is called. Try to view the RSS feed of the article's category andyou should be able to reproduce the issue.
This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9039
https://issues.joomla.org/tracker/joomla-cms/9039.—
Reply to this email directly or view it on GitHub
#9039 (comment).
Status | New | ⇒ | Confirmed |
I can confirm it now. If you have a fix please submit a pull request
First, all embed urls if not having a protocol, should start with at least //
all these fail
src="//www.youtube.com/embed/..."
src="//player.vimeo.com/video/..."
src="//www.dailymotion.com/embed/video/..."
@brianteeman the fix is what you implied
that '//' should be detected as absolute and not as releative by the relToAbs function
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/renderer.php#L86
$text = preg_replace("/(href|src)=\"(?!http|ftp|https|mailto|data)([^\"]*)\"/", "$1=\"$base\$2\"", $text);
should be added the detection of '//'
aka be add |\/\/
$text = preg_replace("/(href|src)=\"(?!http|ftp|https|mailto|data|\/\/)([^\"]*)\"/", "$1=\"$base\$2\"", $text);
Can you please create a Pull Request for this and then we can get this
fixed in the core
On 2 February 2016 at 08:51, Lefteris Kavadas notifications@github.com
wrote:
The solution is indeed that simple. The regular expression should just
ignore the URLs with no protocol. I have applied the exact same fix that
@ggppdk https://github.com/ggppdk provided and it's working for me.—
Reply to this email directly or view it on GitHub
#9039 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
@brianteeman @kavadas Please test PR #9046
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-02 10:05:25 |
Closed_By | ⇒ | brianteeman |
Closing as we have a PR for testing #9046 Please test it so it can be accepted and merged
Not tested but what happens if it starts with //