Author Topic: [1.7.1] {if blah} {endif blah} left in templates  (Read 20670 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
[1.7.1] {if blah} {endif blah} left in templates
« on: March 16, 2005, 04:20:34 AM »
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: [Select]
    $template = preg_replace(
      "/".preg_quote($this->start)."[^".preg_quote($this->end)."\s]+".preg_quote($this->end)."/",
      '',
      $template
    );

add after:
Code: [Select]
    $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);
« Last Edit: July 16, 2005, 08:06:39 PM by V@no »