Changeset 3344310
- Timestamp:
- 08/14/2025 05:42:00 AM (7 months ago)
- Location:
- mpl-publisher/trunk
- Files:
-
- 5 edited
-
helpers.php (modified) (1 diff)
-
libs/PremiumPublisher.php (modified) (2 diffs)
-
libs/WordPublisher.php (modified) (2 diffs)
-
mpl-publisher.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpl-publisher/trunk/helpers.php
r3001142 r3344310 275 275 } 276 276 } 277 278 if ( ! function_exists('mpl_sanitize_filename')) 279 { 280 function mpl_sanitize_filename($filename) 281 { 282 // Remove or replace characters that are invalid in file names 283 $filename = str_replace( 284 array('/', '\\', ':', '*', '?', '"', "'", '<', '>', '|'), 285 array('-', '-', '-', '-', '-', '', '', '', '', '-'), 286 $filename 287 ); 288 289 // Remove multiple consecutive dashes and trim 290 $filename = preg_replace('/-+/', '-', $filename); 291 $filename = trim($filename, '- '); 292 293 // Ensure filename is not empty 294 if (empty($filename)) { 295 $filename = 'untitled'; 296 } 297 298 return $filename; 299 } 300 } -
mpl-publisher/trunk/libs/PremiumPublisher.php
r3001142 r3344310 102 102 public function request($endpoint, $filename) 103 103 { 104 $filepath = $this->tempPath . '/' . $filename;104 $filepath = $this->tempPath . '/' . mpl_sanitize_filename($filename); 105 105 $authorization = is_null(mpl_premium_license()) ? mpl_premium_token() : mpl_premium_license(); 106 106 … … 123 123 { 124 124 header('Content-Description: File Transfer'); 125 header('Content-Disposition: attachment; filename="' . $filename. '"');125 header('Content-Disposition: attachment; filename="' . mpl_sanitize_filename($filename) . '"'); 126 126 header('Content-Transfer-Encoding: binary'); 127 127 header('Content-Length: ' . filesize($filepath)); -
mpl-publisher/trunk/libs/WordPublisher.php
r3001142 r3344310 151 151 public function send($filename) 152 152 { 153 $filepath = $this->tempPath . '/' . $filename. '.docx';153 $filepath = $this->tempPath . '/' . mpl_sanitize_filename($filename) . '.docx'; 154 154 155 155 $writer = IOFactory::createWriter($this->word, 'Word2007'); … … 159 159 // https://github.com/PHPOffice/PHPWord/issues/449 160 160 header('Content-Description: File Transfer'); 161 header('Content-Disposition: attachment; filename="' . $filename. '.docx"');161 header('Content-Disposition: attachment; filename="' . mpl_sanitize_filename($filename) . '.docx"'); 162 162 header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); 163 163 header('Content-Transfer-Encoding: binary'); -
mpl-publisher/trunk/mpl-publisher.php
r3288277 r3344310 4 4 * Plugin URI: https://wordpress.mpl-publisher.com/ 5 5 * Description: MPL-Publisher 📚 creates an ebook, print-ready PDF book, EPUB for KDP, or Audiobook MP3 directly from your WordPress posts. 6 * Version: 2.19. 06 * Version: 2.19.1 7 7 * Author: Ferran Figueredo 8 8 * Author URI: https://ferranfigueredo.com -
mpl-publisher/trunk/readme.txt
r3288277 r3344310 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 2.19. 08 Stable tag: 2.19.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 127 127 == Changelog == 128 128 129 = 2.19.1 = 130 - Fixed error when book title contains a slash 131 129 132 = 2.19.0 = 130 133 - Added support for selecting and sorting multiple chapters simultaneously
Note: See TracChangeset
for help on using the changeset viewer.