Changeset 738


Ignore:
Timestamp:
03/30/11 12:17:19 (14 months ago)
Author:
r2
Message:

вставка видео вконтакте и новый код ютуба

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/clubs/frontend.php

    r705 r738  
    273273        //save to database 
    274274        $description            = $inCore->request('description', 'html', ''); 
    275                 $description            = $inCore->badTagClear($description); 
     275        $description            = $inCore->badTagClear($description); 
    276276        $description            = $inDB->escape_string($description); 
    277277        $admin_id                       = $club['admin_id']; 
  • trunk/components/content/frontend.php

    r594 r738  
    410410 
    411411        $article['published']           = $is_auto_add ? 1 : 0; 
    412                 if ($do=='editarticle'){ 
    413                         $article['published']           = ($mod['published'] == 0) ? $mod['published'] : $article['published']; 
    414                 } 
     412          if ($do=='editarticle'){ 
     413               $article['published']           = ($mod['published'] == 0) ? $mod['published'] : $article['published']; 
     414          } 
    415415        $article['pubdate']             = $mod['pubdate'] ? $mod['pubdate'] : date('Y-m-d H:i'); 
    416416        $article['enddate']             = $article['pubdate']; 
  • trunk/components/forum/frontend.php

    r732 r738  
    784784                } else { 
    785785                $message_post = $inCore->request('message', 'html'); 
    786                 $message = $inDB->escape_string($message_post); 
    787786                $message = $inCore->badTagClear($message); 
     787                $message = $inDB->escape_string($message_post);                 
    788788                if (!$message) { echo '<p>'.$_LANG['NEED_TEXT_POST'].'</p>'; return; } 
    789789 
  • trunk/core/cms.php

    r709 r738  
    32323232     */ 
    32333233    public static function badTagClear($string){ 
    3234                 $bad_teg = array ("'<script[^>]*?>.*?</script>'si", 
    3235                                                  "'<iframe[^>]*?>.*?</iframe>'si", 
    3236                                                  "'<style[^>]*?>.*?</style>'si", 
    3237                                                  "'<meta[^>]*?>'si"); 
    3238                 $string = preg_replace($bad_teg, '', $string); 
     3234 
     3235        $bad_tags = array ( 
     3236            "'<script[^>]*?>.*?</script>'si", 
     3237            "'<style[^>]*?>.*?</style>'si", 
     3238            "'<meta[^>]*?>'si", 
     3239            '/<iframe.*?src=(?!"http:\/\/www\.youtube\.com\/embed\/|"http:\/\/vkontakte\.ru\/video_ext\.php\?).*?>.*?<\/iframe>/i', 
     3240            '/<iframe.*>.+<\/iframe>/i' 
     3241        ); 
     3242 
     3243        $string = preg_replace($bad_tags, '', $string); 
     3244 
    32393245        return $string; 
     3246         
    32403247    } 
    32413248    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
  • trunk/includes/bbcode/bbcode.lib.php

    r732 r738  
    10061006        $str = '<div class="bb_tag_video">'; 
    10071007        foreach ($elem['val'] as $item) { 
     1008             
    10081009            if ('item'==$item['type']) { continue; } 
    1009             $str .= strip_tags($item['str'], '<object><param><embed>'); 
     1010 
     1011            $iframe_regexp      = '/<iframe.*?src=(?!"http:\/\/www\.youtube\.com\/embed\/|"http:\/\/vkontakte\.ru\/video_ext\.php\?).*?><\/iframe>/i'; 
     1012            $iframe_regexp2     = '/<iframe.*>.+<\/iframe>/i'; 
     1013            $item['str']        = preg_replace($iframe_regexp, '', $item['str']); 
     1014            $item['str']        = preg_replace($iframe_regexp2, '', $item['str']); 
     1015 
     1016            $str .= strip_tags($item['str'], '<iframe><object><param><embed>'); 
     1017 
    10101018        } 
    10111019        $str .= '</div>'; 
Note: See TracChangeset for help on using the changeset viewer.