[opencms-dev] Protocol Relative URLs in html content
Stephan Hartmann
hartmann at metamesh.de
Thu Apr 10 16:55:43 CEST 2014
Hi Richard,
I see at least two problems: TinyMCE and the link substituion handler of
OpenCms.
TinyMCE converts protocol-relative urls to urls with protocol by default.
To prevent this you have to configure TinyMCE with "convert_urls:false".
Next, the link substition handler (by default
org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler) does not
recognize protocol-relative links as external. You can provide your own
implementation (of org.opencms.staticexport.I_CmsLinkSubstitutionHandler)
and configure it in opencms-importexport.xml.
Kind regards,
Stephan
2014-04-10 14:43 GMT+02:00 Richard Hardy <rhardy5014 at aol.com>:
> Hi,
>
> We are using OpenCMS v 8.0.2 and have a problem using protocol relative
> URLs in img src attributes. See
> http://www.paulirish.com/2010/the-protocol-relative-url/
>
> For example, if we enter the following in an html editor within OpenCMS:
>
> <img src="//images.domain.com/folder/file.jpg/>
>
> when we save the page and re-open it, the link is transformed to:
>
> <img src="/folder/file.jpg/>
>
> images.domain.com is a domain that is not, in any way, related to our
> OpenCMS instance.
>
> We need to use protocol relative URLs as our page may be http or https
> and we need to host our images on another domain from the one managed in
> OpenCMS.
>
> Is there any way, through configuration, that we can stop this
> happening? Failing that, can someone point us at the source code where this
> replacement may be happening, so that we can try to change this behaviour
> ourselves?
>
> Thanks very much,
>
> Richard Hardy.
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20140410/d56ca0dc/attachment.htm>
More information about the opencms-dev
mailing list