Changeset 428927
- Timestamp:
- 08/26/2011 09:29:42 AM (15 years ago)
- Location:
- u-extended-comment/tags
- Files:
-
- 2 deleted
- 2 edited
- 34 copied
-
1.0.1/includes/attachment.php (modified) (1 diff)
-
1.0/includes/attachment.php (modified) (1 diff)
-
1.1 (copied) (copied from u-extended-comment/trunk)
-
1.1/css (copied) (copied from u-extended-comment/trunk/css)
-
1.1/css/attachment.css (copied) (copied from u-extended-comment/trunk/css/attachment.css)
-
1.1/css/editor-content.css (copied) (copied from u-extended-comment/trunk/css/editor-content.css)
-
1.1/css/editor.css (copied) (copied from u-extended-comment/trunk/css/editor.css)
-
1.1/css/utils.css (copied) (copied from u-extended-comment/trunk/css/utils.css)
-
1.1/images (copied) (copied from u-extended-comment/trunk/images)
-
1.1/images/ajax-loader.gif (copied) (copied from u-extended-comment/trunk/images/ajax-loader.gif)
-
1.1/images/button-grad.png (copied) (copied from u-extended-comment/trunk/images/button-grad.png)
-
1.1/images/close.png (copied) (copied from u-extended-comment/trunk/images/close.png)
-
1.1/images/upload-progress.gif (deleted)
-
1.1/includes (copied) (copied from u-extended-comment/trunk/includes)
-
1.1/includes/admin.php (copied) (copied from u-extended-comment/trunk/includes/admin.php)
-
1.1/includes/allowed-tags.php (copied) (copied from u-extended-comment/trunk/includes/allowed-tags.php)
-
1.1/includes/attachment.php (copied) (copied from u-extended-comment/trunk/includes/attachment.php)
-
1.1/includes/editor.php (copied) (copied from u-extended-comment/trunk/includes/editor.php)
-
1.1/includes/mimes.php (copied) (copied from u-extended-comment/trunk/includes/mimes.php)
-
1.1/includes/utils.php (copied) (copied from u-extended-comment/trunk/includes/utils.php)
-
1.1/js (copied) (copied from u-extended-comment/trunk/js)
-
1.1/js/attachment.js (copied) (copied from u-extended-comment/trunk/js/attachment.js)
-
1.1/js/editor.js (copied) (copied from u-extended-comment/trunk/js/editor.js)
-
1.1/js/tiny_mce (copied) (copied from u-extended-comment/trunk/js/tiny_mce)
-
1.1/js/tinymce_plugins (deleted)
-
1.1/js/utils.js (copied) (copied from u-extended-comment/trunk/js/utils.js)
-
1.1/languages (copied) (copied from u-extended-comment/trunk/languages)
-
1.1/languages/uexc-fr_FR.mo (copied) (copied from u-extended-comment/trunk/languages/uexc-fr_FR.mo)
-
1.1/languages/uexc-fr_FR.po (copied) (copied from u-extended-comment/trunk/languages/uexc-fr_FR.po)
-
1.1/languages/uexc-ko_KR.mo (copied) (copied from u-extended-comment/trunk/languages/uexc-ko_KR.mo)
-
1.1/languages/uexc-ko_KR.po (copied) (copied from u-extended-comment/trunk/languages/uexc-ko_KR.po)
-
1.1/languages/uexc-nl_NL.mo (copied) (copied from u-extended-comment/trunk/languages/uexc-nl_NL.mo)
-
1.1/languages/uexc-nl_NL.po (copied) (copied from u-extended-comment/trunk/languages/uexc-nl_NL.po)
-
1.1/readme.txt (copied) (copied from u-extended-comment/trunk/readme.txt)
-
1.1/screenshot-1.png (copied) (copied from u-extended-comment/trunk/screenshot-1.png)
-
1.1/screenshot-2.png (copied) (copied from u-extended-comment/trunk/screenshot-2.png)
-
1.1/screenshot-3.png (copied) (copied from u-extended-comment/trunk/screenshot-3.png)
-
1.1/u-extended-comment.php (copied) (copied from u-extended-comment/trunk/u-extended-comment.php)
Legend:
- Unmodified
- Added
- Removed
-
u-extended-comment/tags/1.0.1/includes/attachment.php
r420122 r428927 287 287 288 288 function _do_download(){ 289 global $uexc;290 291 if ( !wp_verify_nonce($_GET['_wpnonce'], $this->id.'_nonce') )292 wp_die(__('Your nonce did not verify.', $uexc->id));293 294 $wp_upload_dir = wp_upload_dir();295 $filepath = str_replace($wp_upload_dir['baseurl'], $wp_upload_dir['basedir'], $_REQUEST['fileurl']);296 $filename = pathinfo($_REQUEST['fileurl']);297 $filename = $filename['basename'];298 299 if( empty($filename) || !file_exists($filepath) ) {300 wp_die(__('File does not exist', $uexc->id));301 }else{302 $this->_force_download($filename, file_get_contents($filepath));303 }304 }305 306 function _force_download($filename = '', $data = ''){307 global $uexc;308 309 if ($filename == '' OR $data == '') return FALSE;310 311 if (FALSE === strpos($filename, '.')) return FALSE;312 313 $x = explode('.', $filename);314 $extension = end($x);315 316 require_once('mimes.php');317 318 if ( ! isset($mimes[$extension])){319 $mime = 'application/octet-stream';320 }else{321 $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension];322 }323 324 if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE){325 header('Content-Type: "'.$mime.'"');326 header('Content-Disposition: attachment; filename="'.$filename.'"');327 header('Expires: 0');328 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');329 header("Content-Transfer-Encoding: binary");330 header('Pragma: public');331 header("Content-Length: ".strlen($data));332 }else{333 header('Content-Type: "'.$mime.'"');334 header('Content-Disposition: attachment; filename="'.$filename.'"');335 header("Content-Transfer-Encoding: binary");336 header('Expires: 0');337 header('Pragma: no-cache');338 header("Content-Length: ".strlen($data));339 }340 exit($data);341 289 } 342 290 -
u-extended-comment/tags/1.0/includes/attachment.php
r419641 r428927 289 289 290 290 function _do_download(){ 291 global $uexc;292 293 if ( !wp_verify_nonce($_GET['_wpnonce'], $this->id.'_nonce') )294 wp_die(__('Your nonce did not verify.', $uexc->id));295 296 $wp_upload_dir = wp_upload_dir();297 $filepath = str_replace($wp_upload_dir['baseurl'], $wp_upload_dir['basedir'], $_REQUEST['fileurl']);298 $filename = pathinfo($_REQUEST['fileurl']);299 $filename = $filename['basename'];300 301 if( empty($filename) || !file_exists($filepath) ) {302 wp_die(__('File does not exist', $uexc->id));303 }else{304 $this->_force_download($filename, file_get_contents($filepath));305 }306 }307 308 function _force_download($filename = '', $data = ''){309 global $uexc;310 311 if ($filename == '' OR $data == '') return FALSE;312 313 if (FALSE === strpos($filename, '.')) return FALSE;314 315 $x = explode('.', $filename);316 $extension = end($x);317 318 require_once('mimes.php');319 320 if ( ! isset($mimes[$extension])){321 $mime = 'application/octet-stream';322 }else{323 $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension];324 }325 326 if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE){327 header('Content-Type: "'.$mime.'"');328 header('Content-Disposition: attachment; filename="'.$filename.'"');329 header('Expires: 0');330 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');331 header("Content-Transfer-Encoding: binary");332 header('Pragma: public');333 header("Content-Length: ".strlen($data));334 }else{335 header('Content-Type: "'.$mime.'"');336 header('Content-Disposition: attachment; filename="'.$filename.'"');337 header("Content-Transfer-Encoding: binary");338 header('Expires: 0');339 header('Pragma: no-cache');340 header("Content-Length: ".strlen($data));341 }342 exit($data);343 291 } 344 292
Note: See TracChangeset
for help on using the changeset viewer.