Changeset 2188

Show
Ignore:
Timestamp:
05/01/08 22:10:28 (5 months ago)
Author:
takayama
Message:

Fixed BugId:79431
* Added new function that applies text filter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-37/php/lib/MTUtil.php

    r2098 r2188  
    15861586} 
    15871587 
     1588function apply_text_filter ($ctx, $text, $filter) { 
     1589  if ($text == '' || $filter == '') return $text; 
     1590 
     1591    if ($filter == 'convert_breaks') { 
     1592        $text = html_text_transform($text); 
     1593    } elseif ($ctx->load_modifier($filter)) { 
     1594        $mod = 'smarty_modifier_'.$filter; 
     1595        $text = $mod($text); 
     1596    } 
     1597 
     1598    return $text; 
     1599} 
     1600 
    15881601?> 
  • branches/release-37/php/lib/function.mtcommentbody.php

    r1174 r2188  
    1818        $cb = 'convert_breaks'; 
    1919    } 
    20     if ($cb) { 
    21         if ($ctx->load_modifier($cb)) { 
    22             $mod = 'smarty_modifier_'.$cb; 
    23             $text = $mod($text); 
    24         } 
    25     } 
     20    require_once 'MTUtil.php'; 
     21    $text = apply_text_filter($ctx, $text, $cb); 
    2622    if (isset($args['words'])) { 
    2723        require_once("MTUtil.php"); 
  • branches/release-37/php/lib/function.mtentrybody.php

    r1174 r2188  
    2323            $cb = 'convert_breaks'; 
    2424        } 
    25         if ($cb) { 
    26             # invoke modifier to format 
    27             if ($ctx->load_modifier($cb)) { 
    28                 $mod = 'smarty_modifier_'.$cb; 
    29                 $text = $mod($text); 
    30             } 
    31         } 
     25        require_once 'MTUtil.php'; 
     26        $text = apply_text_filter($ctx, $text, $cb); 
    3227    } 
    3328    if (isset($args['words'])) { 
  • branches/release-37/php/lib/function.mtentrymore.php

    r1174 r2188  
    2323            $cb = 'convert_breaks'; 
    2424        } 
    25         if ($cb) { 
    26             # invoke modifier to format 
    27             if ($ctx->load_modifier($cb)) { 
    28                 $mod = 'smarty_modifier_'.$cb; 
    29                 $text = $mod($text); 
    30             } 
    31         } 
     25        require_once 'MTUtil.php'; 
     26        $text = apply_text_filter($ctx, $text, $cb); 
    3227    } 
    3328    if (isset($args['words'])) { 
  • branches/release-37/php/lib/modifier.filters.php

    r1174 r2188  
    1616                $filter = 'convert_breaks'; 
    1717            } 
    18             if ($ctx->load_modifier($filter)) { 
    19                 $mod = 'smarty_modifier_'.$filter; 
    20                 $text = $mod($text); 
    21             } 
     18            require_once 'MTUtil.php'; 
     19            $text = apply_text_filter($text, $filter); 
    2220        } 
    2321    }