WP Photo Album Plus - Version 7.1.02.004

Version Description

= 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.02.004
Comparing to
See all releases

Code changes from version 7.1.02.003 to 7.1.02.004

changelog.txt CHANGED
@@ -4,6 +4,7 @@ WP Photo Album Plus Changelog
4
 
5
  * Added Table IX-A16: Load nicescroller js always.
6
  * Table I-C10 (Thumbnail area max size) and Table I-C11 (Use nicescroller) have been moved to Table I-A12 and Table I-A13 and apply now also to the album cover area.
 
7
 
8
  = 7.1.01 =
9
 
@@ -11,7 +12,7 @@ WP Photo Album Plus Changelog
11
  * You can have a CDN active when PDFs are enabled. However, the documents will stay stored locally on the server.
12
  * Table IX-A15.1 and 15.2 added. Use in complex situations where window resizing partially fails.
13
  * Multimedia icons are now custom uploadable. See Table II-J14.x. Note that changing the size here also changes the size of the medals on the thumbnail.
14
- * Added Table IX-F13 and Table IX-F13 to specify size and margin of the watermark placement.
15
 
16
  = 7.1.00 =
17
 
4
 
5
  * Added Table IX-A16: Load nicescroller js always.
6
  * Table I-C10 (Thumbnail area max size) and Table I-C11 (Use nicescroller) have been moved to Table I-A12 and Table I-A13 and apply now also to the album cover area.
7
+ * The local cdn file list on the photo admin page now link to the images in a new window.
8
 
9
  = 7.1.01 =
10
 
12
  * You can have a CDN active when PDFs are enabled. However, the documents will stay stored locally on the server.
13
  * Table IX-A15.1 and 15.2 added. Use in complex situations where window resizing partially fails.
14
  * Multimedia icons are now custom uploadable. See Table II-J14.x. Note that changing the size here also changes the size of the medals on the thumbnail.
15
+ * Added Table IX-F13 and Table IX-F14 to specify size and margin of the watermark placement.
16
 
17
  = 7.1.00 =
18
 
readme.txt CHANGED
@@ -139,6 +139,7 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
139
 
140
  = 7.1.02 =
141
 
 
142
  * This version addresses various bug fixes and feature requests.
143
 
144
  = 7.1.01 =
139
 
140
  = 7.1.02 =
141
 
142
+ * This version addresses various security issues.
143
  * This version addresses various bug fixes and feature requests.
144
 
145
  = 7.1.01 =
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 7.1.00
7
  *
8
  */
9
 
@@ -133,7 +133,7 @@ global $wpdb;
133
  if ( $albums ) foreach ( $albums as $album ) {
134
  $source_dir = wppa_get_source_album_dir( $album['id'] );
135
  if ( wppa_is_dir( $source_dir ) ) {
136
- $files = glob( $source_dir.'/*' );
137
  if ( $files ) foreach ( $files as $file ) {
138
  if ( ! wppa_is_dir( $file ) ) {
139
  $filename = basename( $file );
@@ -496,13 +496,14 @@ function _wppa_sanitze_files( $root ) {
496
  }
497
 
498
  $paths = $root.'/*';
499
- $files = glob( $paths );
500
 
501
  $count = '0';
502
  if ( $files ) foreach ( $files as $file ) {
503
 
504
- // Make sure file ext is downcase
505
  $dfile = wppa_down_ext( $file );
 
506
  if ( $dfile != $file ) {
507
  wppa_rename( $file, $dfile );
508
  $file = $dfile;
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 7.1.02
7
  *
8
  */
9
 
133
  if ( $albums ) foreach ( $albums as $album ) {
134
  $source_dir = wppa_get_source_album_dir( $album['id'] );
135
  if ( wppa_is_dir( $source_dir ) ) {
136
+ $files = wppa_glob( $source_dir.'/*' );
137
  if ( $files ) foreach ( $files as $file ) {
138
  if ( ! wppa_is_dir( $file ) ) {
139
  $filename = basename( $file );
496
  }
497
 
498
  $paths = $root.'/*';
499
+ $files = wppa_glob( $paths );
500
 
501
  $count = '0';
502
  if ( $files ) foreach ( $files as $file ) {
503
 
504
+ // Make sure file ext is downcase, and name is sanitized
505
  $dfile = wppa_down_ext( $file );
506
+ $dfile = dirname( $dfile ) . '/' . sanitize_file_name( basename( $dfile ) );
507
  if ( $dfile != $file ) {
508
  wppa_rename( $file, $dfile );
509
  $file = $dfile;
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.1.00
6
  *
7
  */
8
 
@@ -2607,7 +2607,7 @@ global $wppa_log_file;
2607
  }
2608
  elseif ( substr( $option, 0, 8 ) == 'wppa_qr_' ) { // Is qr code setting
2609
  if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
2610
- $caches = glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
2611
  if ( $caches ) foreach ( $caches as $cache ) {
2612
  unlink( $cache );
2613
  }
@@ -3445,7 +3445,7 @@ global $wppa_log_file;
3445
  $ok = true;
3446
  if ( $value ) {
3447
  $ok = false;
3448
- $files = glob( $value . '/*' );
3449
  if ( is_array( $files ) ) {
3450
  foreach ( $files as $file ) {
3451
  if ( basename( $file ) == 'convert' ) {
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.1.02
6
  *
7
  */
8
 
2607
  }
2608
  elseif ( substr( $option, 0, 8 ) == 'wppa_qr_' ) { // Is qr code setting
2609
  if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
2610
+ $caches = wppa_glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
2611
  if ( $caches ) foreach ( $caches as $cache ) {
2612
  unlink( $cache );
2613
  }
3445
  $ok = true;
3446
  if ( $value ) {
3447
  $ok = false;
3448
+ $files = wppa_glob( $value . '/*' );
3449
  if ( is_array( $files ) ) {
3450
  foreach ( $files as $file ) {
3451
  if ( basename( $file ) == 'convert' ) {
wppa-boxes-html.php CHANGED
@@ -1132,7 +1132,7 @@ function wppa_get_admins_choice_html( $admins ) {
1132
  $zipsdir = WPPA_UPLOAD_PATH.'/zips/';
1133
 
1134
  // Find all zipfiles
1135
- $zipfiles = glob($zipsdir.'*.zip');
1136
 
1137
  // admins specified?
1138
  if ( $admins ) {
1132
  $zipsdir = WPPA_UPLOAD_PATH.'/zips/';
1133
 
1134
  // Find all zipfiles
1135
+ $zipfiles = wppa_glob($zipsdir.'*.zip');
1136
 
1137
  // admins specified?
1138
  if ( $admins ) {
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.00
6
  *
7
  */
8
 
@@ -1072,7 +1072,7 @@ global $cache_path;
1072
 
1073
  // Removes the content of $dir, ignore errors
1074
  function wppa_tree_empty( $dir ) {
1075
- $files = glob( $dir.'/*' );
1076
  if ( is_array( $files ) ) foreach ( $files as $file ) {
1077
  $name = basename( $file );
1078
  if ( $name == '.' || $name == '..' ) {}
@@ -1899,7 +1899,7 @@ function wppa_delete_obsolete_tempfiles( $force = false ) {
1899
 
1900
  while ( $filecount > $max ) {
1901
 
1902
- $files = glob( WPPA_UPLOAD_PATH.'/temp/*' );
1903
  $filecount = 0;
1904
 
1905
  if ( $files ) {
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.1.02
6
  *
7
  */
8
 
1072
 
1073
  // Removes the content of $dir, ignore errors
1074
  function wppa_tree_empty( $dir ) {
1075
+ $files = wppa_glob( $dir.'/*' );
1076
  if ( is_array( $files ) ) foreach ( $files as $file ) {
1077
  $name = basename( $file );
1078
  if ( $name == '.' || $name == '..' ) {}
1899
 
1900
  while ( $filecount > $max ) {
1901
 
1902
+ $files = wppa_glob( WPPA_UPLOAD_PATH.'/temp/*' );
1903
  $filecount = 0;
1904
 
1905
  if ( $files ) {
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 7.0.10
7
  *
8
  *
9
  */
@@ -271,7 +271,7 @@ global $wppa_endtime;
271
 
272
  // Cleanup qr cache
273
  if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
274
- $qrs = glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
275
  if ( ! empty( $qrs ) ) {
276
  $count = count( $qrs );
277
  if ( $count > 250 ) {
@@ -384,7 +384,7 @@ function _wppa_do_clear_cache( $dir ) {
384
  static $did_tempfiles;
385
 
386
  $needle = 'data-wppa="yes"';
387
- $fsos = glob( $dir . '/*' );
388
  if ( is_array( $fsos ) ) foreach ( $fsos as $fso ) {
389
  $name = basename( $fso );
390
  if ( $name == '.' || $name == '..' ) {}
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 7.1.02
7
  *
8
  *
9
  */
271
 
272
  // Cleanup qr cache
273
  if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
274
+ $qrs = wppa_glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
275
  if ( ! empty( $qrs ) ) {
276
  $count = count( $qrs );
277
  if ( $count > 250 ) {
384
  static $did_tempfiles;
385
 
386
  $needle = 'data-wppa="yes"';
387
+ $fsos = wppa_glob( $dir . '/*' );
388
  if ( is_array( $fsos ) ) foreach ( $fsos as $fso ) {
389
  $name = basename( $fso );
390
  if ( $name == '.' || $name == '..' ) {}
wppa-import.php CHANGED
@@ -1352,8 +1352,11 @@ global $wppa_session;
1352
  '<b>' .
1353
  wppa_sanitize_file_name( basename( $dir ) ) .
1354
  '</b>';
1355
- $subfiles = wppa_glob( $dir.'/*' );
1356
- $subdircount = '0';
 
 
 
1357
  if ( $subfiles ) {
1358
  foreach ( $subfiles as $subfile ) {
1359
  if ( wppa_is_dir( $subfile ) && basename( $subfile ) != '.' && basename( $subfile ) != '..' ) {
@@ -1361,9 +1364,10 @@ global $wppa_session;
1361
  }
1362
  }
1363
  }
1364
- $sfcount = empty( $subfiles ) ? '0' : wppa_get_photocount( $subfiles );
 
1365
  echo ' ' .
1366
- sprintf( _n( 'Contains %d file', 'Contains %d files', $sfcount, 'wp-photo-album-plus' ), $sfcount );
1367
  if ( $subdircount ) {
1368
  echo ' ' .
1369
  sprintf( _n( 'and %d subdirectory', 'and %d subdirectories', $subdircount, 'wp-photo-album-plus' ), $subdircount );
@@ -3079,6 +3083,7 @@ global $wppa_session;
3079
  $xfile = str_replace( array( '[', ']', '(', ')', '{', '}', '$', '+' ), array( '\[', '\]', '\(', '\)', '\{', '\}', '\$', '\+' ), $file );
3080
  $photofiles = wppa_glob( $xfile.'/*' );
3081
  if ( $photofiles ) foreach ( $photofiles as $photofile ) {
 
3082
  if ( ! wppa_is_dir( $photofile ) ) {
3083
 
3084
  if ( ! isset( $wppa_session[$photofile] ) || ! wppa_switch( 'keep_import_files' ) ) {
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 );
1357
+ $subdircount = count( $subdirs );
1358
+ $subfilecount = count( $subfiles );
1359
+ /*
1360
  if ( $subfiles ) {
1361
  foreach ( $subfiles as $subfile ) {
1362
  if ( wppa_is_dir( $subfile ) && basename( $subfile ) != '.' && basename( $subfile ) != '..' ) {
1364
  }
1365
  }
1366
  }
1367
+ */
1368
+ //$sfcount = $subdircount ? wppa_get_photocount( $subfiles ) : '0';
1369
  echo ' ' .
1370
+ sprintf( _n( 'Contains %d file', 'Contains %d files', $subfilecount, 'wp-photo-album-plus' ), $subfilecount );
1371
  if ( $subdircount ) {
1372
  echo ' ' .
1373
  sprintf( _n( 'and %d subdirectory', 'and %d subdirectories', $subdircount, 'wp-photo-album-plus' ), $subdircount );
3083
  $xfile = str_replace( array( '[', ']', '(', ')', '{', '}', '$', '+' ), array( '\[', '\]', '\(', '\)', '\{', '\}', '\$', '\+' ), $file );
3084
  $photofiles = wppa_glob( $xfile.'/*' );
3085
  if ( $photofiles ) foreach ( $photofiles as $photofile ) {
3086
+ wppa_log('obs', 'FOUND:'.$photofile);
3087
  if ( ! wppa_is_dir( $photofile ) ) {
3088
 
3089
  if ( ! isset( $wppa_session[$photofile] ) || ! wppa_switch( 'keep_import_files' ) ) {
wppa-local-cdn.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
- * Version 7.0.09
7
  *
8
  */
9
 
@@ -158,7 +158,7 @@ function wppa_cdn_make( $id, $x, $y ) {
158
  function wppa_cdn_files( $id ) {
159
 
160
  $dir = dirname( wppa_cdn_path( $id, 1, 1 ) );
161
- $files = glob( $dir . '/*' );
162
  $result = array();
163
  if ( is_array( $files ) ) {
164
  foreach( $files as $file ) {
@@ -175,7 +175,7 @@ function wppa_cdn_files( $id ) {
175
  function wppa_cdn_delete( $id ) {
176
 
177
  $dir = dirname( wppa_cdn_path( $id, 1, 1 ) );
178
- $files = glob( $dir . '/*' );
179
  if ( is_array( $files ) ) {
180
  foreach( $files as $file ) {
181
  if ( is_file( $file ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
+ * Version 7.1.02
7
  *
8
  */
9
 
158
  function wppa_cdn_files( $id ) {
159
 
160
  $dir = dirname( wppa_cdn_path( $id, 1, 1 ) );
161
+ $files = wppa_glob( $dir . '/*' );
162
  $result = array();
163
  if ( is_array( $files ) ) {
164
  foreach( $files as $file ) {
175
  function wppa_cdn_delete( $id ) {
176
 
177
  $dir = dirname( wppa_cdn_path( $id, 1, 1 ) );
178
+ $files = wppa_glob( $dir . '/*' );
179
  if ( is_array( $files ) ) {
180
  foreach( $files as $file ) {
181
  if ( is_file( $file ) ) {
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.0.10
7
  *
8
  */
9
 
@@ -595,7 +595,7 @@ global $wppa_endtime;
595
  break;
596
 
597
  case 'wppa_cleanup':
598
- $photo_files = glob( WPPA_UPLOAD_PATH.'/'.$id.'.*' );
599
  // Remove dirs
600
  if ( $photo_files ) {
601
  foreach( array_keys( $photo_files ) as $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.02
7
  *
8
  */
9
 
595
  break;
596
 
597
  case 'wppa_cleanup':
598
+ $photo_files = wppa_glob( WPPA_UPLOAD_PATH.'/'.$id.'.*' );
599
  // Remove dirs
600
  if ( $photo_files ) {
601
  foreach( array_keys( $photo_files ) as $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.01
7
  *
8
  */
9
 
@@ -1032,8 +1032,19 @@ function wppaToggleExif( id, count ) {
1032
  if ( is_array( $files ) ) {
1033
  foreach( $files as $file ) {
1034
  if ( basename( $file ) != 'index.php' ) {
 
 
 
 
1035
  $size = filesize( $file );
1036
- echo basename( $file ) . ' ' . sprintf( '%4.2fkB', $size / 1024 ) . ' ';
 
 
 
 
 
 
 
1037
  }
1038
  }
1039
  }
@@ -1142,7 +1153,7 @@ function wppaToggleExif( id, count ) {
1142
  '</select>' .
1143
  ' ' .
1144
  __( 'Images:', 'wp-photo-album-plus' ) . ' ';
1145
- $files = glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1146
 
1147
  if ( empty( $files ) ) {
1148
  echo
@@ -1192,8 +1203,8 @@ function wppaToggleExif( id, count ) {
1192
 
1193
  $user = wppa_get_user();
1194
  $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1195
- $can_remove = ( wppa_get_album_item( $album, 'wmfile' ) == '--- none ---' ) ||
1196
- ( wppa_get_album_item( $album, 'wmfile' ) == '--- default ---' && wppa_opt( 'watermark_file' ) == '--- none ---' );
1197
  if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1198
  echo
1199
  ' ' . __( 'Watermark:', 'wp-photo-album-plus') . ' ';
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 7.1.02
7
  *
8
  */
9
 
1032
  if ( is_array( $files ) ) {
1033
  foreach( $files as $file ) {
1034
  if ( basename( $file ) != 'index.php' ) {
1035
+ $t = explode( '.', basename( $file ) );
1036
+ $t = explode( '-', $t[0] );
1037
+ $x = $t[0];
1038
+ $y = $t[1];
1039
  $size = filesize( $file );
1040
+ echo '
1041
+ <a
1042
+ href="' . wppa_cdn_url( $id, $x, $y ) . '"
1043
+ target="_blank"
1044
+ >' .
1045
+ basename( $file ) .
1046
+ ' </a>' .
1047
+ sprintf( '%4.2fkB', $size / 1024 ) . ' ';
1048
  }
1049
  }
1050
  }
1153
  '</select>' .
1154
  ' ' .
1155
  __( 'Images:', 'wp-photo-album-plus' ) . ' ';
1156
+ $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1157
 
1158
  if ( empty( $files ) ) {
1159
  echo
1203
 
1204
  $user = wppa_get_user();
1205
  $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1206
+ $can_remove = ( wppa_get_album_item( $album, 'wmfile' ) == '--- none ---' ) ||
1207
+ ( wppa_get_album_item( $album, 'wmfile' ) == '--- default ---' && wppa_opt( 'watermark_file' ) == '--- none ---' );
1208
  if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1209
  echo
1210
  ' ' . __( 'Watermark:', 'wp-photo-album-plus') . ' ';
wppa-settings-autosave.php CHANGED
@@ -7522,7 +7522,7 @@ global $wppa_supported_camara_brands;
7522
  $help = (__('Restores all the settings from the factory supplied defaults, the backup you created or from a skin file.', 'wp-photo-album-plus'));
7523
  $slug1 = 'wppa_skinfile';
7524
  $slug2 = 'wppa_load_skin';
7525
- $files = glob(WPPA_PATH.'/theme/*.skin');
7526
  $options = false;
7527
  $values = false;
7528
  $options[] = __('--- set to defaults ---', 'wp-photo-album-plus');
@@ -9755,7 +9755,7 @@ global $wppa_supported_camara_brands;
9755
  $fopts = array( 'System' );
9756
  $fvals = array( 'system' );
9757
  $style = wppa_opt( 'textual_watermark_type' );
9758
- $fonts = glob( WPPA_UPLOAD_PATH . '/fonts/*.ttf' );
9759
  sort($fonts);
9760
  foreach ( $fonts as $font ) {
9761
  $f = basename($font);
7522
  $help = (__('Restores all the settings from the factory supplied defaults, the backup you created or from a skin file.', 'wp-photo-album-plus'));
7523
  $slug1 = 'wppa_skinfile';
7524
  $slug2 = 'wppa_load_skin';
7525
+ $files = wppa_glob(WPPA_PATH.'/theme/*.skin');
7526
  $options = false;
7527
  $values = false;
7528
  $options[] = __('--- set to defaults ---', 'wp-photo-album-plus');
9755
  $fopts = array( 'System' );
9756
  $fvals = array( 'system' );
9757
  $style = wppa_opt( 'textual_watermark_type' );
9758
+ $fonts = wppa_glob( WPPA_UPLOAD_PATH . '/fonts/*.ttf' );
9759
  sort($fonts);
9760
  foreach ( $fonts as $font ) {
9761
  $f = basename($font);
wppa-setup.php CHANGED
@@ -635,7 +635,7 @@ global $wppa_error;
635
 
636
  // Copy factory supplied watermarks
637
  $frompath = WPPA_PATH . '/watermarks';
638
- $watermarks = glob($frompath . '/*.png');
639
  if ( is_array($watermarks) ) {
640
  foreach ($watermarks as $fromfile) {
641
  $tofile = WPPA_UPLOAD_PATH . '/watermarks/' . basename($fromfile);
@@ -645,7 +645,7 @@ global $wppa_error;
645
 
646
  // Copy factory supplied watermark fonts
647
  $frompath = WPPA_PATH . '/fonts';
648
- $fonts = glob($frompath . '/*');
649
  if ( is_array($fonts) ) {
650
  foreach ($fonts as $fromfile) {
651
  if ( is_file ( $fromfile ) ) {
@@ -706,7 +706,7 @@ global $wppa_error;
706
  }
707
 
708
  // Remove dynamic files
709
- $files = glob( WPPA_PATH.'/dynamic/wppa-init.*.js' );
710
  if ( $files ) {
711
  foreach ( $files as $file ) {
712
  wppa_unlink ( $file ); // Will be auto re-created
635
 
636
  // Copy factory supplied watermarks
637
  $frompath = WPPA_PATH . '/watermarks';
638
+ $watermarks = wppa_glob($frompath . '/*.png');
639
  if ( is_array($watermarks) ) {
640
  foreach ($watermarks as $fromfile) {
641
  $tofile = WPPA_UPLOAD_PATH . '/watermarks/' . basename($fromfile);
645
 
646
  // Copy factory supplied watermark fonts
647
  $frompath = WPPA_PATH . '/fonts';
648
+ $fonts = wppa_glob($frompath . '/*');
649
  if ( is_array($fonts) ) {
650
  foreach ($fonts as $fromfile) {
651
  if ( is_file ( $fromfile ) ) {
706
  }
707
 
708
  // Remove dynamic files
709
+ $files = wppa_glob( WPPA_PATH.'/dynamic/wppa-init.*.js' );
710
  if ( $files ) {
711
  foreach ( $files as $file ) {
712
  wppa_unlink ( $file ); // Will be auto re-created
wppa-source.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -62,8 +62,8 @@ function wppa_delete_source( $name, $alb ) {
62
  $path = wppa_get_source_album_dir( $alb ).'/'.$name;
63
  $path = wppa_strip_ext( $path );
64
 
65
- $all_paths = glob( $path . '.*' );
66
- $o1paths = glob( $path . '-o1.*' );
67
 
68
  if ( is_array( $all_paths ) && is_array( $o1paths ) ) {
69
  $all_paths = array_merge( $all_paths, $o1paths );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
+ * Version 7.1.02
7
  *
8
  */
9
 
62
  $path = wppa_get_source_album_dir( $alb ).'/'.$name;
63
  $path = wppa_strip_ext( $path );
64
 
65
+ $all_paths = wppa_glob( $path . '.*' );
66
+ $o1paths = wppa_glob( $path . '-o1.*' );
67
 
68
  if ( is_array( $all_paths ) && is_array( $o1paths ) ) {
69
  $all_paths = array_merge( $all_paths, $o1paths );
wppa-stereo.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the stereo stuff
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -319,7 +319,7 @@ function wppa_get_stereo_path( $id, $type, $glass ) {
319
 
320
  function wppa_delete_stereo_images( $id ) {
321
 
322
- $files = glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
323
  if ( $files ) foreach ( $files as $file ) {
324
  if ( is_file( $file ) ) {
325
  unlink( $file );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the stereo stuff
6
+ * Version 7.1.02
7
  *
8
  */
9
 
319
 
320
  function wppa_delete_stereo_images( $id ) {
321
 
322
+ $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
323
  if ( $files ) foreach ( $files as $file ) {
324
  if ( is_file( $file ) ) {
325
  unlink( $file );
wppa-utils.php CHANGED
@@ -3708,7 +3708,7 @@ global $wpdb;
3708
  function wppa_print_tree( $path ) {
3709
  $path = rtrim( $path, '/' );
3710
  echo $path . '<br />';
3711
- $files = glob( $path . '/*' );
3712
  foreach( $files as $file ) {
3713
  echo $file . '<br />';
3714
  if ( wppa_is_dir( $file ) ) {
@@ -4772,7 +4772,7 @@ function wppa_remote_file_exists( $url ) {
4772
  function wppa_rename_files_sanitized( $root ) {
4773
 
4774
  // Get the files
4775
- $my_import_files = glob( $root . '/*' );
4776
 
4777
  // If files
4778
  if ( is_array( $my_import_files ) ) {
3708
  function wppa_print_tree( $path ) {
3709
  $path = rtrim( $path, '/' );
3710
  echo $path . '<br />';
3711
+ $files = wppa_glob( $path . '/*' );
3712
  foreach( $files as $file ) {
3713
  echo $file . '<br />';
3714
  if ( wppa_is_dir( $file ) ) {
4772
  function wppa_rename_files_sanitized( $root ) {
4773
 
4774
  // Get the files
4775
+ $my_import_files = wppa_glob( $root . '/*' );
4776
 
4777
  // If files
4778
  if ( is_array( $my_import_files ) ) {
wppa-watermark.php CHANGED
@@ -609,7 +609,7 @@ function wppa_watermark_file_select( $key, $album = '0' ) {
609
 
610
  // See what's in there
611
  $paths = WPPA_UPLOAD_PATH . '/watermarks/*.png';
612
- $files = glob( $paths );
613
 
614
  /* Find current selection */
615
  // System default
609
 
610
  // See what's in there
611
  $paths = WPPA_UPLOAD_PATH . '/watermarks/*.png';
612
+ $files = wppa_glob( $paths );
613
 
614
  /* Find current selection */
615
  // System default
wppa-wrappers.php CHANGED
@@ -174,16 +174,51 @@ function wppa_fopen( $file, $mode ) {
174
  }
175
 
176
  // Wrapper for glob
 
 
 
 
 
177
  function wppa_glob( $pattern, $flags = null, $wp_content = false ) {
 
178
 
179
  // Is path safe?
180
  $dir = dirname( $pattern );
181
  if ( ! wppa_is_path_safe( $dir, $wp_content ) ) {
182
  wppa_log( 'War', 'Unsafe path detected in wppa_glob(): ' . sanitize_text_field( $dir ), true );
183
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
 
 
 
 
185
 
186
- return glob( $pattern, $flags );
187
  }
188
 
189
  // Wrapper for unlink
174
  }
175
 
176
  // Wrapper for glob
177
+ // This wrapper never returns the . and .. dirs
178
+ // Returns always an array
179
+ // Additional flags: WPPA_ONLYDIRS === GLOB_ONLYDIR, WPPA_ONLYFILES
180
+ define( 'WPPA_ONLYDIRS', GLOB_ONLYDIR );
181
+ define( 'WPPA_ONLYFILES', 1024 );
182
  function wppa_glob( $pattern, $flags = null, $wp_content = false ) {
183
+ global $wp_filesystem;
184
 
185
  // Is path safe?
186
  $dir = dirname( $pattern );
187
  if ( ! wppa_is_path_safe( $dir, $wp_content ) ) {
188
  wppa_log( 'War', 'Unsafe path detected in wppa_glob(): ' . sanitize_text_field( $dir ), true );
189
+ return array();
190
+ }
191
+
192
+ // Get dirlist
193
+ wppa_init_fs();
194
+ $dirlist = $wp_filesystem->dirlist( dirname( $pattern ) );
195
+
196
+ // Convert glob pattern to preg_match pattern
197
+ $pregpat = str_replace( '.', '\.', basename( $pattern ) ); // Dot (.) to ecaped dot (\.)
198
+ $pregpat = str_replace( '*', '.*', $pregpat ); // Any chars (*) to any number of any chars (*.)
199
+ $pregpat = '/' . $pregpat . '/';
200
+
201
+ // Init result;
202
+ $result = array();
203
+
204
+ // Process dirlist
205
+ if ( ! empty( $dirlist ) ) foreach( $dirlist as $item ) {
206
+
207
+ if ( ! $flags || // if never mnd
208
+ ( ( $flags & WPPA_ONLYDIRS ) && $item['type'] == 'd' ) || // or must be dir and is dir
209
+ ( ( $flags & WPPA_ONLYFILES ) && $item['type'] == 'f' ) ) { // or must be file and is file
210
+
211
+ if ( preg_match( $pregpat, $item['name'] ) ) { // and pattern matches
212
+ $result[] = $dir . '/' . $item['name'];
213
+ }
214
+ }
215
  }
216
+
217
+ // wppa_log('obs', 'New = '.serialize($result));
218
+ // $result = glob( $pattern, $flags | GLOB_NOSORT );
219
+ // wppa_log('obs', 'Old = '.serialize($result));
220
 
221
+ return $result;
222
  }
223
 
224
  // Wrapper for unlink
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.02.003
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/
@@ -23,7 +23,7 @@ global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7102'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.1.02.003'; // WPPA software version
27
 
28
  /* start timers */
29
  add_action( 'plugins_loaded', 'wppa_init_timer' );
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.02.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/
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7102'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.1.02.004'; // WPPA software version
27
 
28
  /* start timers */
29
  add_action( 'plugins_loaded', 'wppa_init_timer' );