4images Help / Hilfe > Bug Fixes & Patches

[1.7.1] {if blah} {endif blah} left in templates

(1/1)

Chris:
Since 4images v1.7.1 was released some conditional tags in the templates are not working properly, the tags are being showed.
I'm not quite sure if this was intentionally or it was forgotten from v1.7.1 beta, but function clean_template() is missing cleaning the conditional tags.

To fix that find in include/templates.php:


--- Code: ---    $template = preg_replace(
      "/".preg_quote($this->start)."[^".preg_quote($this->end)."\s]+".preg_quote($this->end)."/",
      '',
      $template
    );
--- End code ---

add after:

--- Code: ---    $search_array = array(
      "/".preg_quote($this->start).'if\s+([A-Z0-9_]+)'.preg_quote($this->end)."/i",
      "/".preg_quote($this->start).'endif\s+([A-Z0-9_]+)'.preg_quote($this->end)."/i"
    );
    $replace_array = array(
      "",
      ""
    );
    $template = preg_replace($search_array, $replace_array, $template);
--- End code ---

Navigation

[0] Message Index

Go to full version