Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-3999

Allow image macros to refer to other images on the server by allowing an initial /

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Minor
    • None
    • 1.9
    • None
    • Trivial

    Description

      Currently all image urls are prepended with the download path of the current page unless they start with http://

      I would like to refer to other images on the server by referring to them via something like /some/other/path.

      If the ImageMacro.java code checked for a leading '/' and did not compute a download path url it would allow this capability. The workaround is to fully specify the complete server path. e.g. http://someserver:8080/some/other/path. Since I'm generating this from another macro, I'd like to avoid hardwiring in the server path.

      Change
      if (img.indexOf("://") != -1) {

      to be

      if (img.indexOf("://") != -1 || img.startsWith("/")) {

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              glenne Glenn Engel
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: