WP Photo Album Plus - Version 7.1.07.004

Version Description

= 7.1.07 =

  • This version addresses various bug fixes and feature requests.

= 7.1.06 =

  • This version addresses various bug fixes and feature requests.

= 7.1.05 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.04 =

  • This version addresses various bug fixes.

= 7.1.03 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.02 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.1.01 =

  • This version addresses various bug fixes and feature requests.

= 7.1.00 =

  • This version addresses various bug fixes and feature requests.
  • The Photo Album -> Upload Photos and Import Photos admin pages have been substantially improved. Read the changelog for details.

= 7.0.11 =

  • This version addresses various bug fixes and feature requests.

= 7.0.11 =

  • This version addresses various bug fixes

= 7.0.10 =

  • This version addresses various bug fixes

= 7.0.09 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.0.08 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.07 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

  • This version addresses various minor bug fixes and feature requests.

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

  • This version addresses various minor bug fixes and feature requests.

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.05 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.02 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.01 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 7.1.07.004
Comparing to
See all releases

Code changes from version 7.1.06.012 to 7.1.07.004

changelog.txt CHANGED
@@ -1,5 +1,13 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
3
  = 7.1.06 =
4
 
5
  * Added shortcode argument delay="yes" to fill the wppa container by ajax after document.ready.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 7.1.07 =
4
+
5
+ * Added Table IX-D19: Sanitize filenames during import/upload. Do not switch this off unless you really need this.
6
+ * Added a checkbox on the Import screen to remove empty dirs after dir to album imports.
7
+ * Improved reliability of remote imports.
8
+ * Session data is now also maintained for using admin pages.
9
+ * Added cover_linktype to acceptable items in wppa_update_album().
10
+
11
  = 7.1.06 =
12
 
13
  * Added shortcode argument delay="yes" to fill the wppa container by ajax after document.ready.
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.1.06
6
- Stable tag: 7.1.05.006
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
140
  = 7.1.06 =
141
 
142
  * This version addresses various bug fixes and feature requests.
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.1.07
6
+ Stable tag: 7.1.06.012
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 7.1.07 =
141
+
142
+ * This version addresses various bug fixes and feature requests.
143
+
144
  = 7.1.06 =
145
 
146
  * This version addresses various bug fixes and feature requests.
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.1.05
6
  *
7
  */
8
 
@@ -681,7 +681,7 @@ global $wppa_log_file_new;
681
 
682
  // A zip is created
683
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$zipfilename;
684
- echo $desturl.'||OK||';
685
  if ( $zipcount != count( $photos ) ) echo sprintf( __( 'Only %s out of %s photos could be added to the zipfile' , 'wp-photo-album-plus'), $zipcount, count( $photos ) );
686
  wppa_exit();
687
  break;
@@ -693,7 +693,7 @@ global $wppa_log_file_new;
693
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
694
  $zipfileurl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename;
695
  if ( is_file( $zipfilepath ) ) {
696
- echo $zipfileurl;
697
  }
698
  else {
699
  echo 'ER';
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.1.07
6
  *
7
  */
8
 
681
 
682
  // A zip is created
683
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$zipfilename;
684
+ echo htmlentities( $desturl.'||OK||' );
685
  if ( $zipcount != count( $photos ) ) echo sprintf( __( 'Only %s out of %s photos could be added to the zipfile' , 'wp-photo-album-plus'), $zipcount, count( $photos ) );
686
  wppa_exit();
687
  break;
693
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
694
  $zipfileurl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename;
695
  if ( is_file( $zipfilepath ) ) {
696
+ echo htmlentities( $zipfileurl );
697
  }
698
  else {
699
  echo 'ER';
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.1.06
6
  *
7
  */
8
 
@@ -297,8 +297,8 @@ global $wppa_randseed_modified;
297
  }
298
  }
299
 
300
- // Log
301
- if($type=='')
302
  wppa_log( 'obs', 'wppa_get_randseed returned {b}' . $result . '{/b}, ' .
303
  'type= {b}' . ( $type ? $type : 'default' ) . '{/b}, ' .
304
  'wp-page= {b}' . ( isset( $wppa_session['randpage'] ) ? $wppa_session['randpage'] : 'unknown' ) . '{/b}, ' .
@@ -725,6 +725,9 @@ function wppa_dbg_msg( $txt = '', $color = 'blue', $force = false, $return = fal
725
 
726
  if ( wppa( 'debug' ) || $force || ( is_admin() && WPPA_DEBUG ) || ( WPPA_DEBUG && $color == 'red' ) ) {
727
 
 
 
 
728
  $result = '<span style="color:' . sanitize_text_field( $color ) . ';" >' .
729
  '<small>' .
730
  '[WPPA+ dbg msg: ' . sanitize_text_field( $txt ) . ']' .
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.1.07
6
  *
7
  */
8
 
297
  }
298
  }
299
 
300
+ // Log (debug)
301
+ if ( false && $type=='' )
302
  wppa_log( 'obs', 'wppa_get_randseed returned {b}' . $result . '{/b}, ' .
303
  'type= {b}' . ( $type ? $type : 'default' ) . '{/b}, ' .
304
  'wp-page= {b}' . ( isset( $wppa_session['randpage'] ) ? $wppa_session['randpage'] : 'unknown' ) . '{/b}, ' .
725
 
726
  if ( wppa( 'debug' ) || $force || ( is_admin() && WPPA_DEBUG ) || ( WPPA_DEBUG && $color == 'red' ) ) {
727
 
728
+ if ( $force ) {
729
+ wppa_log( 'Err', 'Forced debug message: ' . sanitize_text_field( $txt ), true );
730
+ }
731
  $result = '<span style="color:' . sanitize_text_field( $color ) . ';" >' .
732
  '<small>' .
733
  '[WPPA+ dbg msg: ' . sanitize_text_field( $txt ) . ']' .
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 7.1.06
7
  *
8
  */
9
 
@@ -131,7 +131,7 @@ global $wppa_revno;
131
  // Sanitize input
132
  if ( $atts['alt'] && $atss['alt'] != 'none' ) $atts['alt'] = strval( intval( $atts['alt'] ) );
133
  foreach ( array_keys( $atts ) as $key ) {
134
- $atts[$key] = htmlentities( $atts[$key] );
135
  }
136
  $content = htmlentities( $content );
137
 
@@ -370,7 +370,7 @@ global $wppa_revno;
370
  break;
371
 
372
  default:
373
- wppa_dbg_msg ( 'Invalid type: '.$atts['type'].' in wppa shortcode.', 'red', 'force' );
374
  return '';
375
  }
376
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 7.1.07
7
  *
8
  */
9
 
131
  // Sanitize input
132
  if ( $atts['alt'] && $atss['alt'] != 'none' ) $atts['alt'] = strval( intval( $atts['alt'] ) );
133
  foreach ( array_keys( $atts ) as $key ) {
134
+ $atts[$key] = strip_tags( $atts[$key] );
135
  }
136
  $content = htmlentities( $content );
137
 
370
  break;
371
 
372
  default:
373
+ wppa_dbg_msg ( 'Invalid type: '.htmlentities($atts['type']).' in wppa shortcode.', 'red', 'force' );
374
  return '';
375
  }
376
 
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 7.1.05
7
  *
8
  */
9
 
@@ -130,6 +130,7 @@ global $wppa_session;
130
  update_option( 'wppa_import_source_url_'.$user, esc_url( $_POST['wppa-source-remote'] ) );
131
  update_option( 'wppa_import_source_url_found_'.$user, false );
132
  update_option( 'wppa_import_remote_max_'.$user, strval( intval( $_POST['wppa-import-remote-max'] ) ) );
 
133
  }
134
  }
135
 
@@ -474,7 +475,7 @@ global $wppa_session;
474
  ' class="wppa-zip"' .
475
  ' checked="checked"' .
476
  ' />&nbsp;&nbsp;' .
477
- wppa_sanitize_file_name( basename( $file ) ) .
478
  '</td>';
479
  if ( $ct == 3 ) {
480
  echo( '</tr><tr>' );
@@ -831,7 +832,7 @@ global $wppa_session;
831
  echo sanitize_file_name( basename( str_replace( '/', '', $t[1] ) ) );
832
  }
833
  else {
834
- echo wppa_sanitize_file_name( basename( $file ) );
835
  }
836
 
837
  if ( $meta ) {
@@ -980,7 +981,7 @@ global $wppa_session;
980
  ' id="name-file-' . $idx . '"' .
981
  ' >' .
982
  '&nbsp;&nbsp;' .
983
- wppa_sanitize_file_name( basename( $file ) ) .
984
  ' (' . sprintf( '%3.1f', wppa_filesize( $file ) / 1024 ) . ' kb)' .
985
  '</span>' .
986
  '</td>';
@@ -1093,7 +1094,7 @@ global $wppa_session;
1093
  ' id="name-file-' . $idx . '"' .
1094
  ' >' .
1095
  '&nbsp;&nbsp;' .
1096
- wppa_sanitize_file_name( basename( $file ) ) .
1097
  ' (' . sprintf( '%3.1f', wppa_filesize( $file ) / 1024 ) . ' kb)' .
1098
  '</span>' .
1099
  '</td>';
@@ -1325,6 +1326,18 @@ global $wppa_session;
1325
  __( 'Check/uncheck all', 'wp-photo-album-plus') .
1326
  '</b>' .
1327
  '</td>' .
 
 
 
 
 
 
 
 
 
 
 
 
1328
  '</tr>' .
1329
  '</thead>' .
1330
  '</table>';
@@ -1350,7 +1363,7 @@ global $wppa_session;
1350
  ' />' .
1351
  '&nbsp;&nbsp;' .
1352
  '<b>' .
1353
- wppa_sanitize_file_name( basename( $dir ) ) .
1354
  '</b>';
1355
  $subdirs = wppa_glob( $dir.'/*', WPPA_ONLYDIRS );
1356
  $subfiles = wppa_glob( $dir.'/*', WPPA_ONLYFILES );
@@ -1612,6 +1625,7 @@ global $wppa_session;
1612
 
1613
  // get array of files to import
1614
  function wppa_get_import_files() {
 
1615
 
1616
  // Init
1617
  $user = wppa_get_user();
@@ -1638,7 +1652,8 @@ function wppa_get_import_files() {
1638
  $old_setting = $setting;
1639
 
1640
  // assume not
1641
- if ( wppa_is_url_a_photo( $setting ) ) {
 
1642
  wppa( 'is_wppa_tree', false );
1643
  $is_image = true;
1644
  }
@@ -1647,6 +1662,7 @@ function wppa_get_import_files() {
1647
 
1648
  // though?
1649
  if ( wppa_is_url_a_photo( $setting ) ) {
 
1650
  wppa( 'is_wppa_tree', true );
1651
  $is_image = true;
1652
  }
@@ -1654,6 +1670,7 @@ function wppa_get_import_files() {
1654
  $is_image = false;
1655
  }
1656
  }
 
1657
 
1658
  // Is it a photofile?
1659
  if ( $is_image ) {
@@ -1791,6 +1808,7 @@ global $wppa_supported_photo_extensions;
1791
  global $wppa_supported_video_extensions;
1792
  global $wppa_supported_audio_extensions;
1793
  global $wppa_supported_document_extensions;
 
1794
 
1795
  $warning_given = false;
1796
 
@@ -2105,7 +2123,7 @@ global $wppa_supported_document_extensions;
2105
  if ( wppa( 'ajax' ) && wppa( 'is_remote' ) ) {
2106
  $setting = get_option( 'wppa_import_source_url_'.$user, 'http://' );
2107
  $setting_x = wppa_expand_tree_path( $setting );
2108
- if ( wppa_is_url_a_photo( $setting ) || wppa_is_url_a_photo( $setting_x ) ) {
2109
  update_option( 'wppa_import_source_url_' . wppa_get_user(), wppa_compress_tree_path( $unsanitized_path_name ) );
2110
  }
2111
  }
@@ -2996,7 +3014,7 @@ function wppa_extract( $xpath, $delz ) {
2996
  }
2997
 
2998
  $zip->close();
2999
- wppa_ok_message( sprintf( __( 'Zipfile %s processed. %s files extracted, %s files skipped.', 'wp-photo-album-plus'), basename( $path ), $done, $skip ) );
3000
  if ( $delz ) {
3001
  wppa_unlink( $xpath );
3002
  }
@@ -3125,7 +3143,11 @@ global $wppa_session;
3125
  }
3126
  }
3127
  }
3128
- // wppa_rmdir( $file ); // Try to remove dir, ignore error
 
 
 
 
3129
  }
3130
  else {
3131
  wppa_dbg_msg( 'Invalid file in wppa_import_dir_to_album(): '.$file );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 7.1.07
7
  *
8
  */
9
 
130
  update_option( 'wppa_import_source_url_'.$user, esc_url( $_POST['wppa-source-remote'] ) );
131
  update_option( 'wppa_import_source_url_found_'.$user, false );
132
  update_option( 'wppa_import_remote_max_'.$user, strval( intval( $_POST['wppa-import-remote-max'] ) ) );
133
+ $wppa_session['is_wppa_tree'] = false;
134
  }
135
  }
136
 
475
  ' class="wppa-zip"' .
476
  ' checked="checked"' .
477
  ' />&nbsp;&nbsp;' .
478
+ htmlentities( wppa_sanitize_file_name( basename( $file ) ) ) .
479
  '</td>';
480
  if ( $ct == 3 ) {
481
  echo( '</tr><tr>' );
832
  echo sanitize_file_name( basename( str_replace( '/', '', $t[1] ) ) );
833
  }
834
  else {
835
+ echo htmlentities( wppa_sanitize_file_name( basename( $file ) ) );
836
  }
837
 
838
  if ( $meta ) {
981
  ' id="name-file-' . $idx . '"' .
982
  ' >' .
983
  '&nbsp;&nbsp;' .
984
+ htmlentities( wppa_sanitize_file_name( basename( $file ) ) ) .
985
  ' (' . sprintf( '%3.1f', wppa_filesize( $file ) / 1024 ) . ' kb)' .
986
  '</span>' .
987
  '</td>';
1094
  ' id="name-file-' . $idx . '"' .
1095
  ' >' .
1096
  '&nbsp;&nbsp;' .
1097
+ htmlentities( wppa_sanitize_file_name( basename( $file ) ) ) .
1098
  ' (' . sprintf( '%3.1f', wppa_filesize( $file ) / 1024 ) . ' kb)' .
1099
  '</span>' .
1100
  '</td>';
1326
  __( 'Check/uncheck all', 'wp-photo-album-plus') .
1327
  '</b>' .
1328
  '</td>' .
1329
+ '<td>' .
1330
+ '<input' .
1331
+ ' type="checkbox"' .
1332
+ ' id="del-dir"' .
1333
+ ' name="del-dir"' .
1334
+ ' checked="checked"' .
1335
+ ' />' .
1336
+ '<b>' .
1337
+ '&nbsp;&nbsp;' .
1338
+ __( 'Remove empty dirs', 'wp-photo-album-plus') .
1339
+ '</b>' .
1340
+ '</td>' .
1341
  '</tr>' .
1342
  '</thead>' .
1343
  '</table>';
1363
  ' />' .
1364
  '&nbsp;&nbsp;' .
1365
  '<b>' .
1366
+ htmlentities( wppa_sanitize_file_name( basename( $dir ) ) ) .
1367
  '</b>';
1368
  $subdirs = wppa_glob( $dir.'/*', WPPA_ONLYDIRS );
1369
  $subfiles = wppa_glob( $dir.'/*', WPPA_ONLYFILES );
1625
 
1626
  // get array of files to import
1627
  function wppa_get_import_files() {
1628
+ global $wppa_session;
1629
 
1630
  // Init
1631
  $user = wppa_get_user();
1652
  $old_setting = $setting;
1653
 
1654
  // assume not
1655
+ if ( ! $wppa_session['is_wppa_tree'] && wppa_is_url_a_photo( $setting ) ) {
1656
+ $wppa_session['is_wppa_tree'] = false;
1657
  wppa( 'is_wppa_tree', false );
1658
  $is_image = true;
1659
  }
1662
 
1663
  // though?
1664
  if ( wppa_is_url_a_photo( $setting ) ) {
1665
+ $wppa_session['is_wppa_tree'] = true;
1666
  wppa( 'is_wppa_tree', true );
1667
  $is_image = true;
1668
  }
1670
  $is_image = false;
1671
  }
1672
  }
1673
+ // wppa_session_end();
1674
 
1675
  // Is it a photofile?
1676
  if ( $is_image ) {
1808
  global $wppa_supported_video_extensions;
1809
  global $wppa_supported_audio_extensions;
1810
  global $wppa_supported_document_extensions;
1811
+ global $wppa_session;
1812
 
1813
  $warning_given = false;
1814
 
2123
  if ( wppa( 'ajax' ) && wppa( 'is_remote' ) ) {
2124
  $setting = get_option( 'wppa_import_source_url_'.$user, 'http://' );
2125
  $setting_x = wppa_expand_tree_path( $setting );
2126
+ if ( ( ! $wppa_session['is_wppa_tree'] && wppa_is_url_a_photo( $setting ) ) || wppa_is_url_a_photo( $setting_x ) ) {
2127
  update_option( 'wppa_import_source_url_' . wppa_get_user(), wppa_compress_tree_path( $unsanitized_path_name ) );
2128
  }
2129
  }
3014
  }
3015
 
3016
  $zip->close();
3017
+ wppa_ok_message( htmlentities( sprintf( __( 'Zipfile %s processed. %s files extracted, %s files skipped.', 'wp-photo-album-plus'), basename( $path ), $done, $skip ) ) );
3018
  if ( $delz ) {
3019
  wppa_unlink( $xpath );
3020
  }
3143
  }
3144
  }
3145
  }
3146
+
3147
+ // Remove empty dirs if requested
3148
+ if ( isset( $_REQUEST['del-dir'] ) ) {
3149
+ wppa_rmdir( $xfile, true );
3150
+ }
3151
  }
3152
  else {
3153
  wppa_dbg_msg( 'Invalid file in wppa_import_dir_to_album(): '.$file );
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.1.05
8
  *
9
  */
10
 
@@ -560,6 +560,13 @@ global $wpdb;
560
 
561
  // The photo owner
562
  $owner = get_user_by( 'login', wppa_get_photo_item( $pho, 'owner' ) );
 
 
 
 
 
 
 
563
  if ( ! $alb ) {
564
  $alb = wppa_get_photo_item( $pho, 'album' );
565
  }
@@ -568,7 +575,10 @@ global $wpdb;
568
  $link = get_option( 'wppa_mailinglist_callback_url', '' );
569
 
570
  // The content
571
- $cont = sprintf( __( 'User %1$s uploaded photo %2$s into album %3$s' , 'wp-photo-album-plus' ), $owner->display_name, $pho, wppa_get_album_name( $alb ) );
 
 
 
572
 
573
  $cont .= '<br />' . __( 'This photo needs moderation', 'wp-photo-album-plus' );
574
 
@@ -635,7 +645,7 @@ global $wpdb;
635
  $link = get_option( 'wppa_mailinglist_callback_url', '' );
636
 
637
  $cont =
638
- $aut . ' ' . __( 'wrote on photo' , 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $pho ) . ':' .
639
  '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
640
  <em> ' . stripslashes( $comment['comment'] ) . '</em>
641
  </blockquote>';
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 7.1.07
8
  *
9
  */
10
 
560
 
561
  // The photo owner
562
  $owner = get_user_by( 'login', wppa_get_photo_item( $pho, 'owner' ) );
563
+ if ( ! $owner ) {
564
+ $owner = new WP_User;
565
+ $owner->display_name = __( 'Anonymus', 'wp-photo-album-plus' );
566
+ $owner->user_email = '';
567
+ }
568
+
569
+ // The album
570
  if ( ! $alb ) {
571
  $alb = wppa_get_photo_item( $pho, 'album' );
572
  }
575
  $link = get_option( 'wppa_mailinglist_callback_url', '' );
576
 
577
  // The content
578
+ $cont = sprintf( __( 'User %1$s uploaded photo %2$s into album %3$s' , 'wp-photo-album-plus' ),
579
+ $owner->display_name . ( $owner->user_email ? ' (' . make_clickable( $owner->user_email ) . ') ' : '' ),
580
+ $pho,
581
+ wppa_get_album_name( $alb ) );
582
 
583
  $cont .= '<br />' . __( 'This photo needs moderation', 'wp-photo-album-plus' );
584
 
645
  $link = get_option( 'wppa_mailinglist_callback_url', '' );
646
 
647
  $cont =
648
+ $aut . ( strpos( $comment['email'], '@' ) ? ' (' . make_clickable( $comment['email'] ) . ') ' : ' ' ) . __( 'wrote on photo' , 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $pho ) . ':' .
649
  '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
650
  <em> ' . stripslashes( $comment['comment'] ) . '</em>
651
  </blockquote>';
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 7.1.05
7
  *
8
  */
9
 
@@ -1348,12 +1348,15 @@ global $wppa_log_file_new;
1348
  <td style="width:150px;" >'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), $session['timestamp']).'</td>
1349
  <td>' . htmlentities( $session['count'] ) . '</td>
1350
  <td>' . htmlentities( $session['status'] ) . '</td>
1351
- <td style="border-bottom:1px solid gray;max-width:300px;" >';
1352
  if ( is_array( $data ) ) foreach ( array_keys( $data ) as $key ) {
1353
  if ( $key != 'uris' ) {
1354
  if ( is_array( $data[$key] ) ) {
1355
- $result .= '['.$key.'] => Array('.
1356
- implode( ',', array_keys($data[$key]) ) .
 
 
 
1357
  ')<br />';
1358
  }
1359
  elseif ( is_object( $data[$key] ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 7.1.07
7
  *
8
  */
9
 
1348
  <td style="width:150px;" >'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), $session['timestamp']).'</td>
1349
  <td>' . htmlentities( $session['count'] ) . '</td>
1350
  <td>' . htmlentities( $session['status'] ) . '</td>
1351
+ <td style="border-bottom:1px solid gray;" >';
1352
  if ( is_array( $data ) ) foreach ( array_keys( $data ) as $key ) {
1353
  if ( $key != 'uris' ) {
1354
  if ( is_array( $data[$key] ) ) {
1355
+ $result .= '['.$key.'] => Array(<br />';
1356
+ foreach( array_keys($data[$key]) as $k ) {
1357
+ $result .= '&nbsp;' . $k . ' = ' . $data[$key][$k] . '<br />';
1358
+ }
1359
+ $result .=
1360
  ')<br />';
1361
  }
1362
  elseif ( is_object( $data[$key] ) ) {
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 7.1.03
7
  *
8
  */
9
 
@@ -194,7 +194,7 @@ global $wpdb;
194
 
195
  if ( is_array( $cmt ) && count( $cmt ) ) {
196
 
197
- $cmt = array_unique( $cmt );
198
 
199
  foreach( $cmt as $id ) {
200
  $photos[] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
@@ -2308,13 +2308,14 @@ function wppa_album_photos_bulk( $album ) {
2308
  $skip = true;
2309
  }
2310
  }
2311
- if ( $skip ) continue;
2312
- wppa_invalidate_treecounts( $photo['album'] ); // Current album
2313
- wppa_invalidate_treecounts( $newalb ); // New album
2314
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
2315
- SET album = %d
2316
- WHERE id = %d", $newalb, $id ) );
2317
- wppa_move_source( $photo['filename'], $photo['album'], $newalb );
 
2318
  }
2319
  else wppa_error_message( 'Unexpected error #4 in wppa_album_photos_bulk().' );
2320
  break;
@@ -2329,9 +2330,10 @@ function wppa_album_photos_bulk( $album ) {
2329
  $skip = true;
2330
  }
2331
  }
2332
- if ( $skip ) continue;
2333
- wppa_copy_photo( $id, $newalb );
2334
- wppa_invalidate_treecounts( $newalb );
 
2335
  }
2336
  else wppa_error_message( 'Unexpected error #3 in wppa_album_photos_bulk().' );
2337
  break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 7.1.07
7
  *
8
  */
9
 
194
 
195
  if ( is_array( $cmt ) && count( $cmt ) ) {
196
 
197
+ // $cmt = array_unique( $cmt );
198
 
199
  foreach( $cmt as $id ) {
200
  $photos[] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
2308
  $skip = true;
2309
  }
2310
  }
2311
+ if ( ! $skip ) {
2312
+ wppa_invalidate_treecounts( $photo['album'] ); // Current album
2313
+ wppa_invalidate_treecounts( $newalb ); // New album
2314
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
2315
+ SET album = %d
2316
+ WHERE id = %d", $newalb, $id ) );
2317
+ wppa_move_source( $photo['filename'], $photo['album'], $newalb );
2318
+ }
2319
  }
2320
  else wppa_error_message( 'Unexpected error #4 in wppa_album_photos_bulk().' );
2321
  break;
2330
  $skip = true;
2331
  }
2332
  }
2333
+ if ( ! $skip ) {
2334
+ wppa_copy_photo( $id, $newalb );
2335
+ wppa_invalidate_treecounts( $newalb );
2336
+ }
2337
  }
2338
  else wppa_error_message( 'Unexpected error #3 in wppa_album_photos_bulk().' );
2339
  break;
wppa-session.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
- * Version 7.1.06
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
@@ -31,8 +31,13 @@ global $wppa_session;
31
  // If the session table does not yet exist on activation the first time
32
  if ( is_admin() ) {
33
  $tables = $wpdb->get_results( "SHOW TABLES FROM `" . DB_NAME . "`", ARRAY_A );
34
- if ( ! in_array( WPPA_SESSION, $tables ) ) {
 
 
 
 
35
  $wppa_session['id'] = '0';
 
36
  return false;
37
  }
38
  }
@@ -91,12 +96,13 @@ global $wppa_session;
91
  }
92
 
93
  $wppa_session = array();
94
- $wppa_session['page'] = '0';
95
- $wppa_session['ajax'] = '0';
96
- $wppa_session['id'] = $iret;
97
- $wppa_session['user'] = wppa_get_user();
98
- $wppa_session['wfcart'] = null;
99
- $wppa_session['photo'] = array();
 
100
  }
101
 
102
  // Session exists, Update counter
@@ -153,6 +159,8 @@ global $wppa_session;
153
  'uris' => array(),
154
  'isrobot' => false,
155
  'wfcart' => null,
 
 
156
  );
157
 
158
  $wppa_session = wp_parse_args( $wppa_session, $defaults );
@@ -181,6 +189,7 @@ global $wppa_session;
181
  // May have logged in now
182
  $wppa_session['user'] = wppa_get_user();
183
  wppa_save_session();
 
184
  }
185
 
186
  // Save the session data
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
+ * Version 7.1.07
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
31
  // If the session table does not yet exist on activation the first time
32
  if ( is_admin() ) {
33
  $tables = $wpdb->get_results( "SHOW TABLES FROM `" . DB_NAME . "`", ARRAY_A );
34
+ $found = false;
35
+ foreach( $tables as $table ) {
36
+ if ( in_array( WPPA_SESSION, $table ) ) $found = true;
37
+ }
38
+ if ( ! $found ) {
39
  $wppa_session['id'] = '0';
40
+ // wppa_log('obs', 'Table '.WPPA_SESSION.' not found during session start. DB='.DB_NAME);
41
  return false;
42
  }
43
  }
96
  }
97
 
98
  $wppa_session = array();
99
+ $wppa_session['page'] = '0';
100
+ $wppa_session['ajax'] = '0';
101
+ $wppa_session['id'] = $iret;
102
+ $wppa_session['user'] = wppa_get_user();
103
+ $wppa_session['wfcart'] = null;
104
+ $wppa_session['photo'] = array();
105
+ $wppa_session['rem_url'] = array();
106
  }
107
 
108
  // Session exists, Update counter
159
  'uris' => array(),
160
  'isrobot' => false,
161
  'wfcart' => null,
162
+ 'is_wppa_tree' => false,
163
+ 'rem_url' => array(),
164
  );
165
 
166
  $wppa_session = wp_parse_args( $wppa_session, $defaults );
189
  // May have logged in now
190
  $wppa_session['user'] = wppa_get_user();
191
  wppa_save_session();
192
+ // wppa_log( 'obs', 'Session ended' );
193
  }
194
 
195
  // Save the session data
wppa-settings-autosave.php CHANGED
@@ -456,6 +456,7 @@ global $wppa_supported_camara_brands;
456
  'document' => __('Documents', 'wp-photo-album-plus'),
457
  'count' => __('Counts', 'wp-photo-album-plus'),
458
  'cover' => __('Covers', 'wp-photo-album-plus'),
 
459
  'layout' => __('Layout', 'wp-photo-album-plus'),
460
  'lightbox' => __('Lightbox', 'wp-photo-album-plus'),
461
  'link' => __('Links', 'wp-photo-album-plus'),
@@ -7047,7 +7048,7 @@ global $wppa_supported_camara_brands;
7047
  $html2 = '';
7048
  $html = array( $html1, $html2 );
7049
  $clas = '';
7050
- $tags = 'access,system';
7051
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
7052
 
7053
  $name = __('Extended status restricted', 'wp-photo-album-plus');
@@ -9376,6 +9377,15 @@ global $wppa_supported_camara_brands;
9376
  $html = wppa_select($slug, $opts, $vals);
9377
  wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
9378
 
 
 
 
 
 
 
 
 
 
9379
  }
9380
  wppa_setting_subheader( 'E', '1', __( 'Search Albums and Photos related settings' , 'wp-photo-album-plus') );
9381
  {
@@ -9695,7 +9705,7 @@ global $wppa_supported_camara_brands;
9695
  $onchange = 'wppaCheckWatermark()';
9696
  $html = wppa_checkbox($slug, $onchange);
9697
  $clas = '';
9698
- $tags = 'water,upload';
9699
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
9700
 
9701
 
@@ -10130,7 +10140,7 @@ global $wppa_supported_camara_brands;
10130
  $slug = 'wppa_import_parent_check';
10131
  $html = wppa_checkbox($slug);
10132
  $clas = '';
10133
- $tags = 'system,upload';
10134
  wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags);
10135
 
10136
  $name = __('Keep dir to album files', 'wp-photo-album-plus');
@@ -10139,7 +10149,7 @@ global $wppa_supported_camara_brands;
10139
  $slug = 'wppa_keep_import_files';
10140
  $html = wppa_checkbox($slug);
10141
  $clas = '';
10142
- $tags = 'system,upload';
10143
  wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags);
10144
 
10145
  }
456
  'document' => __('Documents', 'wp-photo-album-plus'),
457
  'count' => __('Counts', 'wp-photo-album-plus'),
458
  'cover' => __('Covers', 'wp-photo-album-plus'),
459
+ 'import' => __('Import', 'wp-photo-album-plus'),
460
  'layout' => __('Layout', 'wp-photo-album-plus'),
461
  'lightbox' => __('Lightbox', 'wp-photo-album-plus'),
462
  'link' => __('Links', 'wp-photo-album-plus'),
7048
  $html2 = '';
7049
  $html = array( $html1, $html2 );
7050
  $clas = '';
7051
+ $tags = 'access,system,import';
7052
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
7053
 
7054
  $name = __('Extended status restricted', 'wp-photo-album-plus');
9377
  $html = wppa_select($slug, $opts, $vals);
9378
  wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
9379
 
9380
+ $name = __('Sanitize files', 'wp-photo-album-plus');
9381
+ $desc = __('Sanitize filenames during import/upload', 'wp-photo-album-plus');
9382
+ $help = __('It is STRONGLY recommended to keep this box checked!', 'wp-photo-album-plus');
9383
+ $slug = 'wppa_sanitize_import';
9384
+ $html = wppa_checkbox($slug);
9385
+ $clas = '';
9386
+ $tags = 'system,import,upload';
9387
+ wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags);
9388
+
9389
  }
9390
  wppa_setting_subheader( 'E', '1', __( 'Search Albums and Photos related settings' , 'wp-photo-album-plus') );
9391
  {
9705
  $onchange = 'wppaCheckWatermark()';
9706
  $html = wppa_checkbox($slug, $onchange);
9707
  $clas = '';
9708
+ $tags = 'water,upload,import';
9709
  wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
9710
 
9711
 
10140
  $slug = 'wppa_import_parent_check';
10141
  $html = wppa_checkbox($slug);
10142
  $clas = '';
10143
+ $tags = 'system,import';
10144
  wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags);
10145
 
10146
  $name = __('Keep dir to album files', 'wp-photo-album-plus');
10149
  $slug = 'wppa_keep_import_files';
10150
  $html = wppa_checkbox($slug);
10151
  $clas = '';
10152
+ $tags = 'system,import';
10153
  wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags);
10154
 
10155
  }
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 7.1.04
7
  *
8
  */
9
 
@@ -1785,6 +1785,7 @@ cursorborder:'2px solid transparent',";
1785
  'wppa_frontend_album_public' => 'no',
1786
  'wppa_optimize_new' => 'no',
1787
  'wppa_default_album_linktype' => 'content',
 
1788
 
1789
  // E Search
1790
  'wppa_search_linkpage' => '0', // 1
@@ -2037,7 +2038,7 @@ function wppa_check_dirs() {
2037
  mkdir( $dir );
2038
  }
2039
  chmod( $dir, 0755 );
2040
-
2041
  // check the temp dir
2042
  $dir = WPPA_UPLOAD_PATH . '/temp/';
2043
  if ( ! is_dir( $dir ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 7.1.07
7
  *
8
  */
9
 
1785
  'wppa_frontend_album_public' => 'no',
1786
  'wppa_optimize_new' => 'no',
1787
  'wppa_default_album_linktype' => 'content',
1788
+ 'wppa_sanitize_import' => 'yes',
1789
 
1790
  // E Search
1791
  'wppa_search_linkpage' => '0', // 1
2038
  mkdir( $dir );
2039
  }
2040
  chmod( $dir, 0755 );
2041
+
2042
  // check the temp dir
2043
  $dir = WPPA_UPLOAD_PATH . '/temp/';
2044
  if ( ! is_dir( $dir ) ) {
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.1.03
7
  *
8
  */
9
 
@@ -1618,15 +1618,18 @@ static $busy;
1618
  $msg = strip_tags( $msg );
1619
  array_push( $contents, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. "\n" );
1620
 
1621
- // Log stacktrace 3 levels
1622
  if ( $trace ) {
1623
 
1624
- $data = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 );
1625
  $traceline = '';
1626
  if ( is_array( $data ) ) {
1627
  $i = 1;
1628
  while ( $i < count( $data ) ) {
1629
- $traceline .= ( $i > 1 ? '&lt;- ' : '' ) . basename( $data[$i]['file'] ) . ':' . $data[$i]['line'] . ' ' . $data[$i]['function'] . '() ';
 
 
 
1630
  $i++;
1631
  }
1632
  }
@@ -2466,6 +2469,12 @@ function wppa_force_numeric_else( $value, $default ) {
2466
  // Same as wp sanitize_file_name, except that it can be used for a pathname also.
2467
  // If a pathname: only the basename of the path is sanitized.
2468
  function wppa_sanitize_file_name( $file, $check_length = true ) {
 
 
 
 
 
 
2469
  $temp = explode( '/', $file );
2470
  $cnt = count( $temp );
2471
  $temp[$cnt - 1] = sanitize_file_name( $temp[$cnt - 1] );
@@ -3576,9 +3585,17 @@ function wppa_get_mime_type( $id ) {
3576
  // Test if a given url is to a photo file
3577
  function wppa_is_url_a_photo( $url ) {
3578
  global $wppa_supported_photo_extensions;
 
 
 
 
 
 
3579
 
3580
  // Check existence
3581
  if ( ! wppa_remote_file_exists( $url ) ) {
 
 
3582
  return false;
3583
  }
3584
 
@@ -3588,6 +3605,8 @@ global $wppa_supported_photo_extensions;
3588
 
3589
  // If the url does not have a valid photo extension, its not a photo file
3590
  if ( ! in_array( $ext, $wppa_supported_photo_extensions ) ) {
 
 
3591
  return false;
3592
  }
3593
 
@@ -3622,6 +3641,8 @@ global $wppa_supported_photo_extensions;
3622
  }
3623
 
3624
  // Done
 
 
3625
  return $result;
3626
  }
3627
 
@@ -4709,14 +4730,19 @@ function wppa_is_panorama( $id ) {
4709
 
4710
  // See if a remote file exists
4711
  function wppa_remote_file_exists( $url ) {
4712
- $ch = curl_init( $url );
4713
- curl_setopt( $ch, CURLOPT_NOBODY, true );
4714
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, true );
4715
- curl_exec( $ch );
4716
- $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
4717
- curl_close( $ch );
4718
- if( $httpCode == 200 ) {
4719
- return true;
 
 
 
 
 
4720
  }
4721
  return false;
4722
  }
@@ -4724,6 +4750,11 @@ function wppa_remote_file_exists( $url ) {
4724
  // Rename all files inside a tree to their sanitized name (recursive)
4725
  function wppa_rename_files_sanitized( $root ) {
4726
 
 
 
 
 
 
4727
  // Get the files
4728
  $my_import_files = wppa_glob( $root . '/*' );
4729
 
@@ -4746,7 +4777,7 @@ function wppa_rename_files_sanitized( $root ) {
4746
 
4747
  // Process directories
4748
  elseif ( wppa_is_dir( $path ) ) {
4749
-
4750
  $file = basename( $path );
4751
 
4752
  // Only process real subfolders
@@ -4761,7 +4792,7 @@ function wppa_rename_files_sanitized( $root ) {
4761
  wppa_rename_files_sanitized( $path );
4762
  }
4763
  }
4764
-
4765
  // File system object found with weird characters
4766
  else {
4767
  if ( substr( $new_path, -1 ) == '/' ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.1.07
7
  *
8
  */
9
 
1618
  $msg = strip_tags( $msg );
1619
  array_push( $contents, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. "\n" );
1620
 
1621
+ // Log stacktrace 5 levels
1622
  if ( $trace ) {
1623
 
1624
+ $data = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 6 );
1625
  $traceline = '';
1626
  if ( is_array( $data ) ) {
1627
  $i = 1;
1628
  while ( $i < count( $data ) ) {
1629
+ $traceline .= ( $i > 1 ? '&lt;- ' : '' ) .
1630
+ ( isset( $data[$i]['file'] ) ? basename( $data[$i]['file'] ) . ':' : '' ) .
1631
+ ( isset( $data[$i]['line'] ) ? $data[$i]['line'] . ' ' : '' ) .
1632
+ ( isset( $data[$i]['function'] ) ? $data[$i]['function'] . '() ' : '' );
1633
  $i++;
1634
  }
1635
  }
2469
  // Same as wp sanitize_file_name, except that it can be used for a pathname also.
2470
  // If a pathname: only the basename of the path is sanitized.
2471
  function wppa_sanitize_file_name( $file, $check_length = true ) {
2472
+
2473
+ // Have we been disabled?
2474
+ if ( ! wppa_switch( 'sanitize_import' ) ) {
2475
+ return $file;
2476
+ }
2477
+
2478
  $temp = explode( '/', $file );
2479
  $cnt = count( $temp );
2480
  $temp[$cnt - 1] = sanitize_file_name( $temp[$cnt - 1] );
3585
  // Test if a given url is to a photo file
3586
  function wppa_is_url_a_photo( $url ) {
3587
  global $wppa_supported_photo_extensions;
3588
+ global $wppa_session;
3589
+
3590
+ // Been here before?
3591
+ if ( isset( $wppa_session['rem_url'][$url] ) ) {
3592
+ return $wppa_session['rem_url'][$url];
3593
+ }
3594
 
3595
  // Check existence
3596
  if ( ! wppa_remote_file_exists( $url ) ) {
3597
+ $wppa_session['rem_url'][$url] = false;
3598
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3599
  return false;
3600
  }
3601
 
3605
 
3606
  // If the url does not have a valid photo extension, its not a photo file
3607
  if ( ! in_array( $ext, $wppa_supported_photo_extensions ) ) {
3608
+ $wppa_session['rem_url'][$url] = false;
3609
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3610
  return false;
3611
  }
3612
 
3641
  }
3642
 
3643
  // Done
3644
+ $wppa_session['rem_url'][$url] = $result;
3645
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3646
  return $result;
3647
  }
3648
 
4730
 
4731
  // See if a remote file exists
4732
  function wppa_remote_file_exists( $url ) {
4733
+
4734
+ for ( $i=1; $i<4; $i++ ) {
4735
+ $ch = curl_init( $url );
4736
+ curl_setopt( $ch, CURLOPT_NOBODY, true );
4737
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, true );
4738
+ curl_exec( $ch );
4739
+ $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
4740
+ curl_close( $ch );
4741
+ // wppa_log('obs', 'url = '.$url.', http code = '.$httpCode);
4742
+ if( $httpCode == 200 ) {
4743
+ return true;
4744
+ }
4745
+ sleep(2);
4746
  }
4747
  return false;
4748
  }
4750
  // Rename all files inside a tree to their sanitized name (recursive)
4751
  function wppa_rename_files_sanitized( $root ) {
4752
 
4753
+ // Have we been disabled?
4754
+ if ( ! wppa_switch( 'sanitize_import' ) ) {
4755
+ return;
4756
+ }
4757
+
4758
  // Get the files
4759
  $my_import_files = wppa_glob( $root . '/*' );
4760
 
4777
 
4778
  // Process directories
4779
  elseif ( wppa_is_dir( $path ) ) {
4780
+
4781
  $file = basename( $path );
4782
 
4783
  // Only process real subfolders
4792
  wppa_rename_files_sanitized( $path );
4793
  }
4794
  }
4795
+
4796
  // File system object found with weird characters
4797
  else {
4798
  if ( substr( $new_path, -1 ) == '/' ) {
wppa-wpdb-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
- * Version 7.1.00
7
  *
8
  */
9
 
@@ -79,6 +79,11 @@ global $wpdb;
79
  case 'sname':
80
  $doit = true;
81
  break;
 
 
 
 
 
82
 
83
  default:
84
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
+ * Version 7.1.07
7
  *
8
  */
9
 
79
  case 'sname':
80
  $doit = true;
81
  break;
82
+ case 'cover_linktype':
83
+ if ( in_array( $itemvalue, array( 'content', 'albums', 'thumbs', 'slide', 'page', 'none' ) ) ) {
84
+ $doit = true;
85
+ }
86
+ break;
87
 
88
  default:
89
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.1.05
9
  *
10
  */
11
 
@@ -340,12 +340,21 @@ global $wp_filesystem;
340
  }
341
  }
342
 
343
- function wppa_rmdir( $dir ) {
344
  global $wp_filesystem;
345
-
346
  if ( ! wppa_is_dir( $dir ) ) return;
347
 
348
  wppa_init_fs();
 
 
 
 
 
 
 
 
 
349
  $wp_filesystem->rmdir( $dir );
350
  if ( wppa_is_dir( $dir ) ) {
351
  wppa_log( 'Err', 'Could not remove dir ' . sanitize_text_field( str_replace( WPPA_CONTENT_PATH, '...', $dir ) ) );
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 7.1.07
9
  *
10
  */
11
 
340
  }
341
  }
342
 
343
+ function wppa_rmdir( $dir, $when_empty ) {
344
  global $wp_filesystem;
345
+ wppa_log('obs','wppa_rmdir called with '.$dir);
346
  if ( ! wppa_is_dir( $dir ) ) return;
347
 
348
  wppa_init_fs();
349
+
350
+ // If $when_empty, do not remove when not empty
351
+ if ( $when_empty ) {
352
+ $files = wppa_glob( $dir . '/*' );
353
+ if ( ! empty( $files ) ) {
354
+ return;
355
+ }
356
+ }
357
+
358
  $wp_filesystem->rmdir( $dir );
359
  if ( wppa_is_dir( $dir ) ) {
360
  wppa_log( 'Err', 'Could not remove dir ' . sanitize_text_field( str_replace( WPPA_CONTENT_PATH, '...', $dir ) ) );
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.1.06.012
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -22,8 +22,8 @@ global $wpdb;
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
- global $wppa_revno; $wppa_revno = '7106'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.1.06.012'; // WPPA software version
27
 
28
  /* Init page js data */
29
  global $wppa_js_page_data; $wppa_js_page_data = '';
@@ -140,6 +140,7 @@ define( 'WPPA_DEBUG', false );
140
 
141
  /* START SESSION */
142
  add_action( 'init', 'wppa_session_start', 1 );
 
143
 
144
  /* Init path and url constants */
145
  add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.1.07.004
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '7107'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.1.07.004'; // WPPA software version
27
 
28
  /* Init page js data */
29
  global $wppa_js_page_data; $wppa_js_page_data = '';
140
 
141
  /* START SESSION */
142
  add_action( 'init', 'wppa_session_start', 1 );
143
+ add_action( 'admin_init', 'wppa_session_start', 1 );
144
 
145
  /* Init path and url constants */
146
  add_action( 'init', 'wppa_init_path_and_url_constants', 1 );