Changeset 517231
- Timestamp:
- 03/10/2012 02:45:10 PM (14 years ago)
- Location:
- hacklog-remote-image-autosave/trunk
- Files:
-
- 3 edited
-
hacklog-remote-image-autosave.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
util.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hacklog-remote-image-autosave/trunk/hacklog-remote-image-autosave.php
r517177 r517231 2 2 /* 3 3 Plugin Name: Hacklog Remote Image Autosave 4 Version: 2.0. 34 Version: 2.0.4 5 5 Plugin URI: http://ihacklog.com/?p=5087 6 6 Description: save remote images in the posts to local server and add it as an attachment to the post. … … 25 25 class hacklog_remote_image_autosave 26 26 { 27 const VERSION = 'Hacklog Remote Image Autosave 2.0. 3';27 const VERSION = 'Hacklog Remote Image Autosave 2.0.4'; 28 28 const textdomain = 'hacklog_remote_image_autosave'; 29 29 const opt = 'hacklog_ria_auto_down'; -
hacklog-remote-image-autosave/trunk/readme.txt
r517176 r517231 5 5 Requires at least: 3.2.1 6 6 Tested up to: 3.3.1 7 Stable tag: 2.0. 37 Stable tag: 2.0.4 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.4 = 47 * fixed: corrected the logic to check if a url is remote or not. 48 46 49 = 2.0.3 = 47 50 * improved: get PHP execution timeout errors being caught. -
hacklog-remote-image-autosave/trunk/util.class.php
r517176 r517231 32 32 } 33 33 34 /** 35 * check if the url is a remote image resource. 36 * @param unknown_type $url 37 */ 34 38 static function is_remote_file($url) { 35 $ home_url = home_url ( '/');36 $ is_remote_file = FALSE;39 $upload_dir = wp_upload_dir(); 40 $local_baseurl = $upload_dir['baseurl']; 37 41 $my_remote_baseurl = ''; 38 42 // Compatible with Hacklog Remote Attachment plugin … … 41 45 $my_remote_baseurl = $hacklogra_opt ['remote_baseurl']; 42 46 } 47 //Hacklog Remote Attachment upyun 48 if (class_exists ( 'hacklogra_upyun' )) { 49 $hacklogra_opt = get_option ( hacklogra_upyun::opt_primary ); 50 $my_remote_baseurl = $hacklogra_opt ['remote_baseurl']; 51 } 43 52 // var_dump( ( 0 !== stripos($url,$home_url) ) ); 44 if (0 !== stripos ( $url, $home_url )) { 45 $is_remote_file = TRUE; 46 } elseif (! empty ( $my_remote_baseurl ) && (stripos ( $url, $my_remote_baseurl ) === FALSE)) { 47 $is_remote_file = TRUE; 48 } 49 return $is_remote_file; 53 if( 0 === stripos ( $url, $local_baseurl ) ) 54 { 55 return FALSE; 56 } 57 58 if( !empty( $my_remote_baseurl ) && ( 0 === stripos( $url, $my_remote_baseurl ) ) ) 59 { 60 return FALSE; 61 } 62 return TRUE; 50 63 } 51 64
Note: See TracChangeset
for help on using the changeset viewer.