Changeset 3451457
- Timestamp:
- 02/01/2026 03:40:27 PM (8 weeks ago)
- Location:
- tune-library/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
tune-library.php (modified) (5 diffs)
-
writeNodes.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tune-library/trunk/readme.txt
r3369267 r3451457 4 4 Tags: iTunes, music, collection, list, XML, AJAX 5 5 Requires at least: 2.7 6 Tested up to: 6. 8.27 Stable tag: 1.6. 36 Tested up to: 6.9 7 Stable tag: 1.6.4 8 8 9 9 Import your iTunes music list into Wordpress and display your song collection on any page. … … 28 28 29 29 == Changelog == 30 31 = 1.6.4 = 32 * Fixed potential security issue 30 33 31 34 = 1.6.3 = -
tune-library/trunk/tune-library.php
r3369267 r3451457 4 4 Plugin URI: https://ylefebvre.github.io/wordpress-plugins/tune-library/ 5 5 Description: A plugin that can be used to import an iTunes Library into a MySQl database and display the contents of the collection on a Wordpress Page. 6 Version: 1.6. 36 Version: 1.6.4 7 7 Author: Yannick Lefebvre 8 8 Author URI: https://ylefebvre.github.io/ … … 175 175 176 176 if ( isset( $_POST['importitunes'] ) ) { 177 178 // ADD: Capability check and nonce validation 179 if ( !current_user_can( 'manage_options' ) ) { 180 die( __( 'Unauthorized' ) ); 181 } 182 183 check_admin_referer( 'tunelibrarypp-config' ); 184 177 185 echo "<div id='message' class='updated fade'>"; 178 186 $options = get_option('TuneLibraryPP'); … … 218 226 echo '</div>'; 219 227 } elseif ( isset( $_POST['importcsv'] ) ) { 228 229 // ADD: Capability check and nonce validation 230 if ( !current_user_can( 'manage_options' ) ) { 231 die( __( 'Unauthorized' ) ); 232 } 233 234 check_admin_referer( 'tunelibrarypp-config' ); 235 220 236 global $wpdb; 221 237 $row = 0; … … 233 249 if (!$skiprow) { 234 250 if ( count( $data ) == 5 ) { 235 $wpdb->insert( $wpdb->get_blog_prefix() . "tracks", array( 'title' => $data[0], 'artist' => $data[1], 'albumartist' => $data[2], 'album' => $data[3], 'tracknum' => $data[4]) );251 $wpdb->insert( $wpdb->get_blog_prefix() . "tracks", array( 'title' => sanitize_text_field( $data[0] ), 'artist' => sanitize_text_field( $data[1] ), 'albumartist' => sanitize_text_field( $data[2] ), 'album' => sanitize_text_field( $data[3] ), 'tracknum' => intval( $data[4] ) ) ); 236 252 } 237 253 } … … 308 324 <input type="hidden" name="action" value="tune_lib_admin" /> 309 325 <input type="hidden" name="MAX_FILE_SIZE" value="128000000" /> 326 310 327 <table class="form-table" style="width:100%;"> 311 328 <?php -
tune-library/trunk/writeNodes.php
r1724383 r3451457 15 15 16 16 foreach($tracks as $track){ 17 echo "<li><a href='#'> ". $track->album."</a>17 echo "<li><a href='#'> ". esc_html( $track->album )."</a> 18 18 <ul> 19 19 <li parentId='album::".urlencode($itemData)."::".urlencode($track->album)."'><a href='#'>Loading...</a></li> … … 29 29 30 30 foreach($tracks as $track){ 31 echo "<li><a href='#'> ". $track->album."</a>31 echo "<li><a href='#'> ". esc_html( $track->album )."</a> 32 32 <ul> 33 33 <li parentId='albumvarious::".urlencode($itemData)."::".urlencode($track->album)."'><a href='#'>Loading...</a></li> … … 67 67 echo '<li class="dhtmlgoodies_sheet.gif"><a href="#" disabled></a> '; 68 68 if ( isset( $track['diskid'] ) && ( 1 != $track['diskid'] || count( $disk_id_array ) > 1 ) ) { 69 echo $track['diskid']. ' - ';69 echo intval( $track['diskid'] ) . ' - '; 70 70 } 71 echo $track['tracknum'] . ' - ' . $track['title']. '</li>';71 echo intval( $track['tracknum'] ) . ' - ' . esc_html( $track['title'] ) . '</li>'; 72 72 } else { 73 echo "<li class='dhtmlgoodies_sheet.gif'><a href='#' disabled></a> " . $track['title']. '</li>';73 echo "<li class='dhtmlgoodies_sheet.gif'><a href='#' disabled></a> " . esc_html( $track['title'] ) . '</li>'; 74 74 } 75 75 } … … 109 109 echo '<li class="dhtmlgoodies_sheet.gif"><a href="#" disabled></a> '; 110 110 if ( isset( $track['diskid'] ) && ( 1 != $track['diskid'] || count( $disk_id_array ) > 1 ) ) { 111 echo $track['diskid']. ' - ';111 echo intval( $track['diskid'] ) . ' - '; 112 112 } 113 echo $track['tracknum'] . ' - ' . $track['artist'] . ' - ' . $track['title']. '</li>';113 echo intval( $track['tracknum'] ) . ' - ' . esc_html( $track['artist'] ) . ' - ' . esc_html( $track['title'] ) . '</li>'; 114 114 } else { 115 echo '<li class="dhtmlgoodies_sheet.gif"><a href="#" disabled></a> ' . $track['title']. '</li>';115 echo '<li class="dhtmlgoodies_sheet.gif"><a href="#" disabled></a> ' . esc_html( $track['title'] ) . '</li>'; 116 116 } 117 117 }
Note: See TracChangeset
for help on using the changeset viewer.