Changeset 517438
- Timestamp:
- 03/11/2012 07:11:46 AM (14 years ago)
- Location:
- hacklog-remote-image-autosave/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
util.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hacklog-remote-image-autosave/trunk/readme.txt
r517231 r517438 5 5 Requires at least: 3.2.1 6 6 Tested up to: 3.3.1 7 Stable tag: 2.0. 47 Stable tag: 2.0.5 8 8 9 9 save remote images in the posts to local server and add it as an attachment to the post. … … 44 44 == Changelog == 45 45 46 = 2.0.5 = 47 * improved: the method to check whether a link resource is a picture 48 * fixed: the compatibility with Hacklog Remote Attachment plugin (resolved the dumplicated filename bug) 49 46 50 = 2.0.4 = 47 51 * fixed: corrected the logic to check if a url is remote or not. -
hacklog-remote-image-autosave/trunk/util.class.php
r517434 r517438 85 85 /** 86 86 * 87 * @todo : add extra to check w ether a link resource is a picture87 * @todo : add extra to check whether a link resource is a picture 88 88 */ 89 89 public static function link_img_tag_callback($matches) { … … 92 92 $replaced_content = $index; 93 93 $src = $matches [5]; 94 $href = $matches[2]; 94 95 // if the link is not a picture 95 $href = strpos ( basename ( $matches [2] ), '.' ) !== FALSE ? $matches [2] : $src; 96 $url_path = parse_url($href,PHP_URL_PATH); 97 $ext_no_dot = pathinfo(basename($url_path), PATHINFO_EXTENSION); 98 $href = in_array($ext_no_dot, array_values(self::$mime_to_ext) ) ? $href : $src; 96 99 if (self::is_remote_file ( $href )) { 97 100 self::$code_block [$index] = array (
Note: See TracChangeset
for help on using the changeset viewer.