Changeset 919

Show
Ignore:
Timestamp:
02/28/08 20:34:03 (9 months ago)
Author:
mdawaffe
Message:

allow images for new core bbPress trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • allow-images/trunk/allow-images.php

    r17 r919  
    66Author: Michael D Adams 
    77Author URI: http://blogwaffe.com/ 
    8 Version: 0.7.1 
     8Version: 0.8 
    99*/ 
    1010 
     
    1515} 
    1616 
    17 function allow_images_encode_bad( $text ) { 
    18         $text = wp_specialchars( $text ); 
    19         $text = preg_replace('|&lt;br /&gt;|', '<br />', $text); 
    20         foreach ( bb_allowed_tags() as $tag => $args ) { 
    21                 if ( 'br' == $tag ) 
    22                         continue; 
    23                 if ( $args ) 
    24                         $text = preg_replace("|&lt;(/?$tag.*?)&gt;|", '<$1>', $text); 
    25                 else 
    26                         $text = preg_replace("|&lt;(/?$tag)&gt;|", '<$1>', $text); 
    27         } 
    28  
    29         $text = preg_replace("|`(.*?)`|se", "'<code>' . encodeit('$1') . '</code>'", $text); 
    30  
    31         return $text; 
    32 } 
    33  
    3417function allow_images( $text ) { 
    35         if ( preg_match_all('/<img(.+?)src=("|\')(.+?)\\2(.+?)>/i', $text, $matches, PREG_SET_ORDER ) ) 
     18        if ( preg_match_all('/<img(.+?)src=("|\')(.+?)\\2(.*?)>/i', $text, $matches, PREG_SET_ORDER ) ) 
    3619                foreach( $matches as $match ) 
    3720                        if ( 
     
    4629} 
    4730 
    48 remove_filter( 'pre_post', 'encode_bad' ); 
    49 add_filter( 'pre_post', 'allow_images_encode_bad', 9 ); 
    5031add_filter( 'pre_post', 'allow_images', 52 ); 
    5132add_filter( 'bb_allowed_tags', 'allow_images_allowed_tags' ); 
  • allow-images/trunk/readme.txt

    r367 r919  
    22Tags: images, html 
    33Contributors: mdawaffe 
    4 Requires at least: 0.73 
    5 Tested up to: 0.73 
     4Requires at least: 0.8.4 
     5Tested up to: 0.8.4 
    66Stable Tag: 0.7.1 
    77