WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / ID3 / module.tag.lyrics3.php
index 7891603e1dcac38fe49dbe8c51b3f52c9f3fa784..419888bf4f03501eb483da9aaf7d5f4ea1e40973 100644 (file)
@@ -101,20 +101,24 @@ class getid3_lyrics3 extends getid3_handler
                        $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size);
 
                        if (!isset($info['ape'])) {
-                               $GETID3_ERRORARRAY = &$info['warning'];
-                               getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
-                               $getid3_temp = new getID3();
-                               $getid3_temp->openfile($this->getid3->filename);
-                               $getid3_apetag = new getid3_apetag($getid3_temp);
-                               $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
-                               $getid3_apetag->Analyze();
-                               if (!empty($getid3_temp->info['ape'])) {
-                                       $info['ape'] = $getid3_temp->info['ape'];
-                               }
-                               if (!empty($getid3_temp->info['replay_gain'])) {
-                                       $info['replay_gain'] = $getid3_temp->info['replay_gain'];
+                               if (isset($info['lyrics3']['tag_offset_start'])) {
+                                       $GETID3_ERRORARRAY = &$info['warning'];
+                                       getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
+                                       $getid3_temp = new getID3();
+                                       $getid3_temp->openfile($this->getid3->filename);
+                                       $getid3_apetag = new getid3_apetag($getid3_temp);
+                                       $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
+                                       $getid3_apetag->Analyze();
+                                       if (!empty($getid3_temp->info['ape'])) {
+                                               $info['ape'] = $getid3_temp->info['ape'];
+                                       }
+                                       if (!empty($getid3_temp->info['replay_gain'])) {
+                                               $info['replay_gain'] = $getid3_temp->info['replay_gain'];
+                                       }
+                                       unset($getid3_temp, $getid3_apetag);
+                               } else {
+                                       $info['warning'][] = 'Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)';
                                }
-                               unset($getid3_temp, $getid3_apetag);
                        }
 
                }
@@ -291,4 +295,4 @@ class getid3_lyrics3 extends getid3_handler
                }
                return null;
        }
-}
\ No newline at end of file
+}