[SPIP] ~maj v3.2.9-->v3.2.11
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / write.id3v1.php
index 6f84867..22c4677 100644 (file)
@@ -14,6 +14,9 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+       exit;
+}
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
 
 class getid3_write_id3v1
@@ -68,16 +71,16 @@ class getid3_write_id3v1
                                } else {
                                        fseek($fp_source, 0, SEEK_END);    // append new ID3v1 tag
                                }
-                               $this->tag_data['track'] = (isset($this->tag_data['track']) ? $this->tag_data['track'] : (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : (isset($this->tag_data['tracknumber']) ? $this->tag_data['tracknumber'] : '')));
+                               $this->tag_data['track_number'] = (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : '');
 
                                $new_id3v1_tag_data = getid3_id3v1::GenerateID3v1Tag(
-                                                                                                               (isset($this->tag_data['title']  ) ? $this->tag_data['title']   : ''),
-                                                                                                               (isset($this->tag_data['artist'] ) ? $this->tag_data['artist']  : ''),
-                                                                                                               (isset($this->tag_data['album']  ) ? $this->tag_data['album']   : ''),
-                                                                                                               (isset($this->tag_data['year']   ) ? $this->tag_data['year']    : ''),
-                                                                                                               (isset($this->tag_data['genreid']) ? $this->tag_data['genreid'] : ''),
-                                                                                                               (isset($this->tag_data['comment']) ? $this->tag_data['comment'] : ''),
-                                                                                                               (isset($this->tag_data['track']  ) ? $this->tag_data['track']   : ''));
+                                                                                                               (isset($this->tag_data['title']       ) ? $this->tag_data['title']        : ''),
+                                                                                                               (isset($this->tag_data['artist']      ) ? $this->tag_data['artist']       : ''),
+                                                                                                               (isset($this->tag_data['album']       ) ? $this->tag_data['album']        : ''),
+                                                                                                               (isset($this->tag_data['year']        ) ? $this->tag_data['year']         : ''),
+                                                                                                               (isset($this->tag_data['genreid']     ) ? $this->tag_data['genreid']      : ''),
+                                                                                                               (isset($this->tag_data['comment']     ) ? $this->tag_data['comment']      : ''),
+                                                                                                               (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : ''));
                                fwrite($fp_source, $new_id3v1_tag_data, 128);
                                fclose($fp_source);
                                return true;