Changeset 3364351
- Timestamp:
- 09/19/2025 06:52:00 AM (6 months ago)
- File:
-
- 1 edited
-
wpyog-documents/tags/1.3.5/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpyog-documents/tags/1.3.5/index.php
r3364123 r3364351 469 469 if (isset($_REQUEST['document']) && !empty($_REQUEST['document'])) { 470 470 $downloadUrl = sanitize_text_field($_REQUEST['document']); 471 $post_id = base64_decode( urldecode( $downloadUrl)); 471 $post_id = intval(base64_decode( urldecode( $downloadUrl))); 472 473 if(empty($post_id)){ 474 wp_die('invalid document id'); 475 } 476 472 477 $document_link = get_post_meta( $post_id, 'document_link', true ); 473 478 474 479 if (empty($document_link)){ 475 wp_die('file not found' , 404);480 wp_die('file not found'); 476 481 } 477 482 … … 499 504 header('Content-Length: ' . filesize($physical_path)); 500 505 flush(); // Flush system output buffer 501 readfile($physical_path); 506 readfile($physical_path); 507 die(); 508 } else{ 509 wp_die('file not found'); 502 510 } 503 die();504 } 511 512 } 505 513 } 506 514
Note: See TracChangeset
for help on using the changeset viewer.