Changeset 2389310
- Timestamp:
- 09/28/2020 02:50:33 AM (6 years ago)
- Location:
- flowpaper-lite-pdf-flipbook/trunk
- Files:
-
- 2 edited
-
flowpaper.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flowpaper-lite-pdf-flipbook/trunk/flowpaper.php
r2384046 r2389310 4 4 Plugin URI: https://wordpress.org/plugins/flowpaper-lite-pdf-flipbook 5 5 Description: Shortcode for adding a PDF flipbook to a post: [flipbook pdf="http://yourwebsite.com/yourdocument.pdf"]. Replace the URL with a URL to a PDF document you want to publish. 6 Version: 1.9. 56 Version: 1.9.6 7 7 Author: Devaldi Ltd 8 8 Author URI: https://flowpaper.com … … 10 10 */ 11 11 12 define('FLOWPAPER_PLUGIN_VERSION', '1.9. 5');12 define('FLOWPAPER_PLUGIN_VERSION', '1.9.6'); 13 13 14 14 function flowpaper_plugin_parse_request($wp) { … … 339 339 340 340 if(strtolower($attr) == 'pdf'){ // append url at the end of the base url 341 if(strpos($value,'publ.flowpaper.com') > 0 || strpos($value,'online.flowpaper.com') > 0 || !strpos(strtolower($value),'.pdf')){ 342 $pdfUrl = esc_attr( $value ); 343 $cloudhosted = true; 344 345 // make sure we're using https if the website that has embedded the viewer is using https 346 if(!empty($_SERVER['HTTPS'])){ 347 $pdfUrl = str_replace("http://","https://",$pdfUrl); 341 342 $flowpaper_matches = []; 343 try { 344 if(strpos($value,'.flowpaper.com') && strpos($value,'http')==0){ 345 preg_match('/^(?:([^\.]+)\.)?flowpaper\.com$/',parse_url($value)['host'],$flowpaper_matches); 348 346 } 349 }else{ 350 $pdfUrl = 'http://flowpaper.com/flipbook/?pdf=' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":""); 351 352 if(!empty($_SERVER['HTTPS'])){ // use https if PDF is on a https url 353 $pdfUrl = 'https://flowpaper.com/flipbook/?pdf=' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":""); 354 } 347 }catch (Exception $ssx) {} 348 349 if(count($flowpaper_matches)==2 || strpos($value,'publ.flowpaper.com') > 0 || strpos($value,'online.flowpaper.com') > 0 || !strpos(strtolower($value),'.pdf')){ 350 $pdfUrl = esc_attr( $value ); 351 $cloudhosted = true; 352 353 // make sure we're using https if the website that has embedded the viewer is using https 354 if(!empty($_SERVER['HTTPS'])){ 355 $pdfUrl = str_replace("http://","https://",$pdfUrl); 356 } 357 }else{ 358 $pdfUrl = 'http://flowpaper.com/flipbook/?pdf=' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":""); 359 360 if(!empty($_SERVER['HTTPS'])){ // use https if PDF is on a https url 361 $pdfUrl = 'https://flowpaper.com/flipbook/?pdf=' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":""); 362 } 363 } 364 }else if(strtolower($attr) == 'theme'){ 365 $theme = esc_attr( $value ); 366 }else if(strtolower($attr) == 'title'){ 367 $title = esc_attr( $value ); 368 }else if(strtolower($attr) == 'cover'){ 369 $cover = esc_attr( $value ); 370 }else if(strtolower($attr) == 'singlepage'){ 371 $singlepage = esc_attr( $value ); 355 372 } 356 }else if(strtolower($attr) == 'theme'){357 $theme = esc_attr( $value );358 }else if(strtolower($attr) == 'title'){359 $title = esc_attr( $value );360 }else if(strtolower($attr) == 'cover'){361 $cover = esc_attr( $value );362 }else if(strtolower($attr) == 'singlepage'){363 $singlepage = esc_attr( $value );364 }365 373 } 366 374 } … … 390 398 391 399 if(strtolower($attr) == 'pdf'){ // append url at the end of the base url 392 if(strpos($value,'publ.flowpaper.com') > 0 || strpos($value,'online.flowpaper.com') > 0 || !strpos(strtolower($value),'.pdf')){ 400 401 $flowpaper_matches = []; 402 try { 403 if(strpos($value,'.flowpaper.com') && strpos($value,'http')==0){ 404 preg_match('/^(?:([^\.]+)\.)?flowpaper\.com$/',parse_url($value)['host'],$flowpaper_matches); 405 } 406 }catch (Exception $ssx) {} 407 408 if(count($flowpaper_matches)==2 || strpos($value,'publ.flowpaper.com') > 0 || strpos($value,'online.flowpaper.com') > 0 || !strpos(strtolower($value),'.pdf')){ 393 409 $pdfUrl = esc_attr( $value ); 394 410 $cloudhosted = true; -
flowpaper-lite-pdf-flipbook/trunk/readme.txt
r2384046 r2389310 185 185 * Regression issue w/ unclosed div around viewer 186 186 187 = 1.9.6 = 188 * Support for subdomains to flowpaper.com added 189 190 187 191 == Installation == 188 192
Note: See TracChangeset
for help on using the changeset viewer.