Loading...
 
Skip to main content

smarty_security and tiki_cdn cause Icons missing when using own content delivery network

Status
Closed
Subject
smarty_security and tiki_cdn cause Icons missing when using own content delivery network
Version
11.x
Category
  • Conflict of two features (each works well independently)
Feature
Templates (Smarty)
Resolution status
Duplicate
Submitted by
leagris
Lastmod by
Nelson Ko
Rating
(0)
Related-to
Description

text
On Feb 21, 2013 5:34 AM, "mekko" <hidden email> wrote:

Hi all,

I am trying to follow the instructions on using my own content delivery
network with a separate domain on the same server as my Tiki. Strangely,
while file gallery images and my logo in the tiki folder are displayed fine,
all icons disappeared and are replaced by a question mark. When moving with
the mouse over the question mark, the tooltip displays an error "URI
http://cdn.mydomain.com/Question... not allowed by security setting". When I copy
the URL and open it in a new browser tab it is displayed without a problem.
So I guess this is a Tiki specific issue. I could not find any matching
permission settings or similar.

Solution
Patch for smarty.php
Copy to clipboard
--- smarty.php.orig 2013-07-22 20:15:01.000000000 +0200 +++ smarty.php 2013-07-23 02:08:57.000000000 +0200 @@ -30,6 +30,8 @@ * @var array $secure_dir */ + public $trusted_uri = array(); + public $secure_dir = array( '', 'img/', @@ -65,11 +67,17 @@ $functions = array(); $modifiers = array(); + $urls = array(); //With phpunit and command line these don't exist yet for some reason if (isset($tikilib) && method_exists($tikilib, "get_preference")) { $functions = array_filter($tikilib->get_preference('smarty_security_functions', array(), true)); $modifiers = array_filter($tikilib->get_preference('smarty_security_functions', array(), true)); + $this->trusted_uri[0] = '#'.$tikilib->get_preference('ticki_cdn','').'$#i'; + $this->trusted_uri[1] = '#'.$tikilib->get_preference('ticki_cdn_ssl','').'$#i'; + for( $i=0, $urls = array_filter($tikilib->get_preference('multidomain_config', array(), true)), $size = count($urls); $i < $size; ++$i ) { + $this->trusted_url[$i+2] = '#'.$urls[$i].'$#i'; + } } $functions = (isset($functions) ? $functions : array());
Workaround
Unacceptable: Disable smarty_security when using tiki_cdn
Importance
5
Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4605
Created
Tuesday 23 July, 2013 00:42:18 UTC
by leagris
LastModif
Thursday 21 November, 2013 02:49:22 UTC


Show PHP error messages