Changeset 919
- Timestamp:
- 02/28/08 20:34:03 (9 months ago)
- Files:
-
- allow-images/trunk/allow-images.php (modified) (3 diffs)
- allow-images/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
allow-images/trunk/allow-images.php
r17 r919 6 6 Author: Michael D Adams 7 7 Author URI: http://blogwaffe.com/ 8 Version: 0. 7.18 Version: 0.8 9 9 */ 10 10 … … 15 15 } 16 16 17 function allow_images_encode_bad( $text ) {18 $text = wp_specialchars( $text );19 $text = preg_replace('|<br />|', '<br />', $text);20 foreach ( bb_allowed_tags() as $tag => $args ) {21 if ( 'br' == $tag )22 continue;23 if ( $args )24 $text = preg_replace("|<(/?$tag.*?)>|", '<$1>', $text);25 else26 $text = preg_replace("|<(/?$tag)>|", '<$1>', $text);27 }28 29 $text = preg_replace("|`(.*?)`|se", "'<code>' . encodeit('$1') . '</code>'", $text);30 31 return $text;32 }33 34 17 function 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 ) ) 36 19 foreach( $matches as $match ) 37 20 if ( … … 46 29 } 47 30 48 remove_filter( 'pre_post', 'encode_bad' );49 add_filter( 'pre_post', 'allow_images_encode_bad', 9 );50 31 add_filter( 'pre_post', 'allow_images', 52 ); 51 32 add_filter( 'bb_allowed_tags', 'allow_images_allowed_tags' ); allow-images/trunk/readme.txt
r367 r919 2 2 Tags: images, html 3 3 Contributors: mdawaffe 4 Requires at least: 0. 735 Tested up to: 0. 734 Requires at least: 0.8.4 5 Tested up to: 0.8.4 6 6 Stable Tag: 0.7.1 7 7
