Changeset 952

Show
Ignore:
Timestamp:
07/07/10 10:06:37 (2 months ago)
Author:
ort
Message:

fix text parser

Location:
trunk/engine
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/lib/external/Jevix/jevix.class.php

    r866 r952  
    954954                                                } 
    955955                                                // HTTP в начале если нет 
    956                                                 if(!preg_match('/^(http|https|ftp):\/\//ui', $value) && !preg_match('/^(\/|\#)/ui', $value) ) $value = 'http://'.$value; 
     956                                                if(!preg_match('/^(http|https|ftp):\/\//ui', $value) && !preg_match('/^(\/|\#)/ui', $value) && !preg_match('/^(mailto):/ui', $value) ) $value = 'http://'.$value; 
    957957                                                break; 
    958958 
  • trunk/engine/modules/text/Text.class.php

    r916 r952  
    4747         */ 
    4848        protected function JevixConfig() { 
     49                // разрешаем в параметрах символ & 
     50                unset($this->oJevix->entities1['&']); 
    4951                // Разрешённые теги 
    5052                $this->oJevix->cfgAllowTags(array('cut','a', 'img', 'i', 'b', 'u', 's', 'video', 'em',  'strong', 'nobr', 'li', 'ol', 'ul', 'sup', 'abbr', 'sub', 'acronym', 'h4', 'h5', 'h6', 'br', 'hr', 'pre', 'code', 'object', 'param', 'embed', 'blockquote')); 
     
    5759                $this->oJevix->cfgAllowTagParams('a', array('title', 'href', 'rel'));            
    5860                $this->oJevix->cfgAllowTagParams('cut', array('name')); 
    59                 $this->oJevix->cfgAllowTagParams('object', array('width' => '#int', 'height' => '#int', 'data' => '#link')); 
     61                $this->oJevix->cfgAllowTagParams('object', array('width' => '#int', 'height' => '#int', 'data' => '#link', 'type' => '#text')); 
    6062                $this->oJevix->cfgAllowTagParams('param', array('name' => '#text', 'value' => '#text')); 
    6163                $this->oJevix->cfgAllowTagParams('embed', array('src' => '#image', 'type' => '#text','allowscriptaccess' => '#text', 'allowfullscreen' => '#text','width' => '#int', 'height' => '#int', 'flashvars'=> '#text', 'wmode'=> '#text')); 
     
    139141         */ 
    140142        protected function FlashParamParser($sText) {    
    141                 if (preg_match_all("@(<\s*param\s*name\s*=\s*\".*\"\s*value\s*=\s*\".*\")\s*/?\s*>(?!</param>)@Ui",$sText,$aMatch)) {                            
     143                if (preg_match_all("@(<\s*param\s*name\s*=\s*(?:\"|').*(?:\"|')\s*value\s*=\s*(?:\"|').*(?:\"|'))\s*/?\s*>(?!</param>)@Ui",$sText,$aMatch)) {                            
    142144                        foreach ($aMatch[1] as $key => $str) { 
    143145                                $str_new=$str.'></param>';                               
     
    154156                 * Удаляем все <param name="wmode" value="*"></param>             
    155157                 */ 
    156                 if (preg_match_all("@(<param\s.*name=\"wmode\".*>\s*</param>)@Ui",$sText,$aMatch)) { 
     158                if (preg_match_all("@(<param\s.*name=(?:\"|')wmode(?:\"|').*>\s*</param>)@Ui",$sText,$aMatch)) { 
    157159                        foreach ($aMatch[1] as $key => $str) { 
    158160                                $sText=str_replace($aMatch[0][$key],'',$sText);