Opened 5 years ago

Closed 5 years ago

#1484859 closed Feature Patches (fixed)

patch roundcube skin-engine to allow absolute urls as image location

Reported by: maharaja Owned by:
Priority: 5 Milestone: 0.2-alpha
Component: Client Scripts Version: 0.1-stable
Severity: normal Keywords:
Cc:

Description

i tried to use https://somehost/logo.png in the roundcube templates, but roundcube always appended the skin path.

the patch below looks for the ":" combination found in a url and skips the skin_path accordingly.

--- include/rcmail_template.inc.old     2008-03-07 10:48:39.377078000 +0100
+++ include/rcmail_template.inc 2008-03-07 10:49:59.474083750 +0100
@@ -691,7 +691,11 @@ class rcmail_template extends rcube_html
     {
       $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'width', 'height', 'border', 'hspace', 'vspace', 'align', 'alt'));
       $img_tag = sprintf('<img src="%%s"%s />', $attrib_str);
-      $btn_content = sprintf($img_tag, $skin_path.$attrib['image']);
+      // skip skin_path if we found some http://somehost/image.png image url
+      if ( strpos( $attrib['image'], '://' ) == FALSE ) {
+        $btn_content = sprintf($img_tag, $skin_path.$attrib['image']);
+      } else {
+        $btn_content = sprintf($img_tag, $attrib['image']);
+      }
       if ($attrib['label'])
         $btn_content .= ' '.$attrib['label'];

Change History (3)

comment:1 Changed 5 years ago by till

  • Milestone changed from 0.1.1 to 0.1.5

comment:2 Changed 5 years ago by maharaja

thanks for taking a look - i would consider this a bugfix thou :)

comment:3 Changed 5 years ago by alec

  • Milestone changed from 0.1.5 to 0.1.2
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [ae0c82b0]

Note: See TracTickets for help on using tickets.