Dotclear


Ignore:
Timestamp:
08/29/18 23:56:57 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.14
Message:

Back to the original global_filters() function as the current seems to be buggy on some installations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.tpl.context.php

    r3752 r3830  
    119119    { 
    120120        $args[0] = &$str; 
    121         $params  = new ArrayObject($args); 
    122121 
    123122        # --BEHAVIOR-- publicBeforeContentFilter 
    124         $res = $GLOBALS['core']->callBehavior('publicBeforeContentFilter', $GLOBALS['core'], $tag, $params); 
    125         $str = $params[0]; 
    126  
    127         if ($params['strip_tags']) { 
     123        $res = $GLOBALS['core']->callBehavior('publicBeforeContentFilter', $GLOBALS['core'], $tag, $args); 
     124        $str = $args[0]; 
     125 
     126        if ($args['strip_tags']) { 
    128127            $str = self::strip_tags($str); 
    129128        } 
    130         if ($params['remove_html']) { 
     129        if ($args['remove_html']) { 
    131130            $str = self::remove_html($str); 
    132131            $str = preg_replace('/\s+/', ' ', $str); 
    133132        } 
    134         if ($params['encode_xml'] || $params['encode_html']) { 
     133        if ($args['encode_xml'] || $args['encode_html']) { 
    135134            $str = self::encode_xml($str); 
    136135        } 
    137136 
    138         if ($params['cut_string'] > 0) { 
    139             $str = self::cut_string($str, (integer) $params['cut_string']); 
    140         } 
    141  
    142         if ($params['lower_case']) { 
     137        if ($args['cut_string'] > 0) { 
     138            $str = self::cut_string($str, (integer) $args['cut_string']); 
     139        } 
     140 
     141        if ($args['lower_case']) { 
    143142            $str = self::lower_case($str); 
    144         } elseif ($params['capitalize']) { 
     143        } elseif ($args['capitalize']) { 
    145144            $str = self::capitalize($str); 
    146         } elseif ($params['upper_case']) { 
     145        } elseif ($args['upper_case']) { 
    147146            $str = self::upper_case($str); 
    148147        } 
    149148 
    150         if ($params['encode_url']) { 
     149        if ($args['encode_url']) { 
    151150            $str = self::encode_url($str); 
    152151        } 
    153152 
    154153        # --BEHAVIOR-- publicAfterContentFilter 
    155         $res = $GLOBALS['core']->callBehavior('publicAfterContentFilter', $GLOBALS['core'], $tag, $params); 
    156         $str = $params[0]; 
     154        $res = $GLOBALS['core']->callBehavior('publicAfterContentFilter', $GLOBALS['core'], $tag, $args); 
     155        $str = $args[0]; 
    157156 
    158157        return $str; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map