<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32979] trunk/src/wp-includes/ID3: Update getID3 to 1.9.9</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32979">32979</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32979","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-06-28 00:16:17 +0000 (Sun, 28 Jun 2015)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Update getID3 to 1.9.9

Changelog:
* https://github.com/JamesHeinrich/getID3/blob/master/changelog.txt
* https://github.com/JamesHeinrich/getID3/compare/v1.9.8...v1.9.9

Fixes <a href="https://core.trac.wordpress.org/ticket/32806">#32806</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesID3getid3libphp">trunk/src/wp-includes/ID3/getid3.lib.php</a></li>
<li><a href="#trunksrcwpincludesID3getid3php">trunk/src/wp-includes/ID3/getid3.php</a></li>
<li><a href="#trunksrcwpincludesID3licensecommercialtxt">trunk/src/wp-includes/ID3/license.commercial.txt</a></li>
<li><a href="#trunksrcwpincludesID3licensetxt">trunk/src/wp-includes/ID3/license.txt</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiovideoasfphp">trunk/src/wp-includes/ID3/module.audio-video.asf.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiovideoflvphp">trunk/src/wp-includes/ID3/module.audio-video.flv.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiovideomatroskaphp">trunk/src/wp-includes/ID3/module.audio-video.matroska.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiovideoquicktimephp">trunk/src/wp-includes/ID3/module.audio-video.quicktime.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudioac3php">trunk/src/wp-includes/ID3/module.audio.ac3.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiodtsphp">trunk/src/wp-includes/ID3/module.audio.dts.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudioflacphp">trunk/src/wp-includes/ID3/module.audio.flac.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiomp3php">trunk/src/wp-includes/ID3/module.audio.mp3.php</a></li>
<li><a href="#trunksrcwpincludesID3moduleaudiooggphp">trunk/src/wp-includes/ID3/module.audio.ogg.php</a></li>
<li><a href="#trunksrcwpincludesID3moduletagapetagphp">trunk/src/wp-includes/ID3/module.tag.apetag.php</a></li>
<li><a href="#trunksrcwpincludesID3moduletagid3v1php">trunk/src/wp-includes/ID3/module.tag.id3v1.php</a></li>
<li><a href="#trunksrcwpincludesID3moduletagid3v2php">trunk/src/wp-includes/ID3/module.tag.id3v2.php</a></li>
<li><a href="#trunksrcwpincludesID3moduletaglyrics3php">trunk/src/wp-includes/ID3/module.tag.lyrics3.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesID3getid3libphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/getid3.lib.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/getid3.lib.php  2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/getid3.lib.php    2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -519,11 +519,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public static function XML2array($XMLstring) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( function_exists( 'simplexml_load_string' ) && function_exists( 'libxml_disable_entity_loader' ) ) {
-                       $loader = libxml_disable_entity_loader( true );
-                       $XMLobject = simplexml_load_string( $XMLstring, 'SimpleXMLElement', LIBXML_NOENT );
-                       $return = self::SimpleXMLelement2array( $XMLobject );
-                       libxml_disable_entity_loader( $loader );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) {
+                       // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html
+                       // https://core.trac.wordpress.org/changeset/29378
+                       $loader = libxml_disable_entity_loader(true);
+                       $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT);
+                       $return = self::SimpleXMLelement2array($XMLobject);
+                       libxml_disable_entity_loader($loader);
</ins><span class="cx" style="display: block; padding: 0 10px">                         return $return;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">                return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1163,6 +1165,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                fwrite($tmp, $imgData);
</span><span class="cx" style="display: block; padding: 0 10px">                                fclose($tmp);
</span><span class="cx" style="display: block; padding: 0 10px">                                $GetDataImageSize = @getimagesize($tempfilename, $imageinfo);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $GetDataImageSize['height'] = $GetDataImageSize[0];
+                               $GetDataImageSize['width']  = $GetDataImageSize[1];
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        unlink($tempfilename);
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1373,4 +1377,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3getid3php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/getid3.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/getid3.php      2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/getid3.php        2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) {
</span><span class="cx" style="display: block; padding: 0 10px">        $temp_dir = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if (!$temp_dir) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if (!$temp_dir && function_exists('sys_get_temp_dir')) { // sys_get_temp_dir added in PHP v5.2.1
</ins><span class="cx" style="display: block; padding: 0 10px">         // sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts
</span><span class="cx" style="display: block; padding: 0 10px">        $temp_dir = sys_get_temp_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        protected $startup_error   = '';
</span><span class="cx" style="display: block; padding: 0 10px">        protected $startup_warning = '';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const VERSION           = '1.9.8-20140511';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const VERSION           = '1.9.9-20141121';
</ins><span class="cx" style="display: block; padding: 0 10px">         const FREAD_BUFFER_SIZE = 32768;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        const ATTACHMENTS_NONE   = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->filename = $filename;
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->info = array();
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->info['GETID3_VERSION']   = $this->version();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->info['php_memory_limit'] = $this->memory_limit;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // remote files not supported
</span><span class="cx" style="display: block; padding: 0 10px">                        if (preg_match('/^(ht|f)tp:\/\//', $filename)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1793,4 +1793,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_exception extends Exception
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px">        public $message;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3licensecommercialtxt"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/license.commercial.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/license.commercial.txt  2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/license.commercial.txt    2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,4 +24,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> The licensee may not sub-license getID3() itself, meaning that any
</span><span class="cx" style="display: block; padding: 0 10px"> commercially released product containing all or parts of getID3() must
</span><span class="cx" style="display: block; padding: 0 10px"> have added functionality beyond what is available in getID3();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-getID3() itself may not be re-licensed by the licensee.
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+getID3() itself may not be re-licensed by the licensee.
</ins></span></pre></div>
<a id="trunksrcwpincludesID3licensetxt"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/license.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/license.txt     2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/license.txt       2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,4 +26,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *****************************************************************
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> Copies of each of the above licenses are included in the 'licenses'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-directory of the getID3 distribution.
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+directory of the getID3 distribution.
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiovideoasfphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio-video.asf.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio-video.asf.php      2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio-video.asf.php        2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2010,4 +2010,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return $string;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiovideoflvphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio-video.flv.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio-video.flv.php      2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio-video.flv.php        2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -742,4 +742,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function getHeight() {
</span><span class="cx" style="display: block; padding: 0 10px">                return $this->height;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiovideomatroskaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio-video.matroska.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio-video.matroska.php 2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio-video.matroska.php   2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1748,4 +1748,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return $info;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiovideoquicktimephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio-video.quicktime.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio-video.quicktime.php        2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio-video.quicktime.php  2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $offset      = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                $atomcounter = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $atom_data_read_buffer_size = ($info['php_memory_limit'] ? round($info['php_memory_limit'] / 2) : $this->getid3->option_fread_buffer_size * 1024); // allow [default: 32MB] if PHP configured with no memory_limit
</ins><span class="cx" style="display: block; padding: 0 10px">                 while ($offset < $info['avdataend']) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if (!getid3_lib::intValueSupported($offset)) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['error'][] = 'Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                break;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $atomHierarchy = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $info['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize, round($this->getid3->memory_limit / 2))), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $info['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $offset += $atomsize;
</span><span class="cx" style="display: block; padding: 0 10px">                        $atomcounter++;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -799,9 +799,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                //$FrameRateCalculatorArray = array();
</span><span class="cx" style="display: block; padding: 0 10px">                                $frames_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $max_stts_entries_to_scan = min(floor($this->getid3->memory_limit / 10000), $atom_structure['number_entries']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $max_stts_entries_to_scan = ($info['php_memory_limit'] ? min(floor($this->getid3->memory_limit / 10000), $atom_structure['number_entries']) : $atom_structure['number_entries']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ($max_stts_entries_to_scan < $atom_structure['number_entries']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $info['warning'][] = 'QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($this->getid3->memory_limit / 1048576).'MB).';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $info['warning'][] = 'QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($atom_structure['number_entries'] / 1048576).'MB).';
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                                for ($i = 0; $i < $max_stts_entries_to_scan; $i++) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $atom_structure['time_to_sample_table'][$i]['sample_count']    = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1399,7 +1399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        case "\x00\x00\x00\x00":
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'meta': // METAdata atom
</span><span class="cx" style="display: block; padding: 0 10px">                                // some kind of metacontainer, may contain a big data dump such as:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // mdta keys  mdtacom.apple.quicktime.make (mdtacom.apple.quicktime.creationdate ,mdtacom.apple.quicktime.location.ISO6709 $mdtacom.apple.quicktime.software !mdtacom.apple.quicktime.model ilst   data DEApple 0  (data DE2011-05-11T17:54:04+0200 2  *data DE+52.4936+013.3897+040.247/   data DE4.3.1  data DEiPhone 4
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         // mdta keys \005 mdtacom.apple.quicktime.make (mdtacom.apple.quicktime.creationdate ,mdtacom.apple.quicktime.location.ISO6709 $mdtacom.apple.quicktime.software !mdtacom.apple.quicktime.model ilst \01D \001 \015data \001DE\010Apple 0 \002 (data \001DE\0102011-05-11T17:54:04+0200 2 \003 *data \001DE\010+52.4936+013.3897+040.247/ \01D \004 \015data \001DE\0104.3.1 \005 \018data \001DE\010iPhone 4
</ins><span class="cx" style="display: block; padding: 0 10px">                                 // http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                    $atom_structure['version']   =          getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2243,4 +2243,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return substr($pascalstring, 1);
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudioac3php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio.ac3.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio.ac3.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio.ac3.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -471,4 +471,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiodtsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio.dts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio.dts.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio.dts.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,4 +288,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return false;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudioflacphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio.flac.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio.flac.php   2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio.flac.php     2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,7 +135,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) {
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ($info['flac']['PICTURE'] as $entry) {
</span><span class="cx" style="display: block; padding: 0 10px">                                if (!empty($entry['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $info['flac']['comments']['picture'][] = array('image_mime'=>$entry['image_mime'], 'data'=>$entry['data']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (!isset($info['flac']['comments']['picture'])) {
+                                               $info['flac']['comments']['picture'] = array();
+                                       }
+                                       $comments_picture_data = array();
+                                       foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {
+                                               if (isset($entry[$picture_key])) {
+                                                       $comments_picture_data[$picture_key] = $entry[$picture_key];
+                                               }
+                                       }
+                                       $info['flac']['comments']['picture'][] = $comments_picture_data;
+                                       unset($comments_picture_data);
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,25 +353,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $info = &$this->getid3->info;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $picture['typeid']         = getid3_lib::BigEndian2Int($this->fread(4));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $picture['type']           = self::pictureTypeLookup($picture['typeid']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $picture['picturetype']    = self::pictureTypeLookup($picture['typeid']);
</ins><span class="cx" style="display: block; padding: 0 10px">                 $picture['image_mime']     = $this->fread(getid3_lib::BigEndian2Int($this->fread(4)));
</span><span class="cx" style="display: block; padding: 0 10px">                $descr_length              = getid3_lib::BigEndian2Int($this->fread(4));
</span><span class="cx" style="display: block; padding: 0 10px">                if ($descr_length) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $picture['description'] = $this->fread($descr_length);
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $picture['width']          = getid3_lib::BigEndian2Int($this->fread(4));
-               $picture['height']         = getid3_lib::BigEndian2Int($this->fread(4));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $picture['image_width']    = getid3_lib::BigEndian2Int($this->fread(4));
+               $picture['image_height']   = getid3_lib::BigEndian2Int($this->fread(4));
</ins><span class="cx" style="display: block; padding: 0 10px">                 $picture['color_depth']    = getid3_lib::BigEndian2Int($this->fread(4));
</span><span class="cx" style="display: block; padding: 0 10px">                $picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $data_length               = getid3_lib::BigEndian2Int($this->fread(4));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $picture['datalength']     = getid3_lib::BigEndian2Int($this->fread(4));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ($picture['image_mime'] == '-->') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $picture['data'] = $this->fread($data_length);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $picture['data'] = $this->fread($picture['datalength']);
</ins><span class="cx" style="display: block; padding: 0 10px">                 } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        $picture['data'] = $this->saveAttachment(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                str_replace('/', '_', $picture['type']).'_'.$this->ftell(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         str_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $this->ftell(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $data_length,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $picture['datalength'],
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $picture['image_mime']);
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,4 +450,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiomp3php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio.mp3.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio.mp3.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio.mp3.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2009,4 +2009,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org');
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiooggphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.audio.ogg.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.audio.ogg.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.audio.ogg.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,6 +63,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                } elseif (substr($filedata, 0, 8) == 'OpusHead') {
+
+                       if( $this->ParseOpusPageHeader($filedata, $filedataoffset, $oggpageinfo) == false ) {
+                               return false;
+                       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 } elseif (substr($filedata, 0, 8) == 'Speex   ') {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // http://www.speex.org/manual/node10.html
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -255,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $info['error'][] = 'Expecting either "Speex   " or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $info['error'][] = 'Expecting either "Speex   ", "OpusHead" or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';
</ins><span class="cx" style="display: block; padding: 0 10px">                         unset($info['ogg']);
</span><span class="cx" style="display: block; padding: 0 10px">                        unset($info['mime_type']);
</span><span class="cx" style="display: block; padding: 0 10px">                        return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,9 +294,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $this->fseek($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR);
</span><span class="cx" style="display: block; padding: 0 10px">                                $this->ParseVorbisComments();
</span><span class="cx" style="display: block; padding: 0 10px">                                break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       case 'opus':
+                               $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
+                               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags'
+                               if(substr($filedata, 0, 8)  != 'OpusTags') {
+                                       $info['error'][] = 'Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"';
+                                       return false;
+                               }
+
+                               $this->ParseVorbisComments();
+                               break;
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">                 // Last Page - Number of Samples
</span><span class="cx" style="display: block; padding: 0 10px">                if (!getid3_lib::intValueSupported($info['avdataend'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,6 +426,57 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return true;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        // http://tools.ietf.org/html/draft-ietf-codec-oggopus-03
+       public function ParseOpusPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {
+               $info = &$this->getid3->info;
+               $info['audio']['dataformat']   = 'opus';
+               $info['mime_type']             = 'audio/ogg; codecs=opus';
+
+               /** @todo find a usable way to detect abr (vbr that is padded to be abr) */
+               $info['audio']['bitrate_mode'] = 'vbr';
+
+               $info['audio']['lossless']     = false;
+
+               $info['ogg']['pageheader']['opus']['opus_magic'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'OpusHead'
+               $filedataoffset += 8;
+               $info['ogg']['pageheader']['opus']['version']    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
+               $filedataoffset += 1;
+
+               if ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) {
+                       $info['error'][] = 'Unknown opus version number (only accepting 1-15)';
+                       return false;
+               }
+
+               $info['ogg']['pageheader']['opus']['out_channel_count'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
+               $filedataoffset += 1;
+
+               if ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) {
+                       $info['error'][] = 'Invalid channel count in opus header (must not be zero)';
+                       return false;
+               }
+
+               $info['ogg']['pageheader']['opus']['pre_skip'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
+               $filedataoffset += 2;
+
+               $info['ogg']['pageheader']['opus']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
+               $filedataoffset += 4;
+
+               //$info['ogg']['pageheader']['opus']['output_gain'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
+               //$filedataoffset += 2;
+
+               //$info['ogg']['pageheader']['opus']['channel_mapping_family'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
+               //$filedataoffset += 1;
+
+               $info['opus']['opus_version']      = $info['ogg']['pageheader']['opus']['version'];
+               $info['opus']['sample_rate']       = $info['ogg']['pageheader']['opus']['sample_rate'];
+               $info['opus']['out_channel_count'] = $info['ogg']['pageheader']['opus']['out_channel_count'];
+
+               $info['audio']['channels']      = $info['opus']['out_channel_count'];
+               $info['audio']['sample_rate']   = $info['opus']['sample_rate'];
+               return true;
+       }
+
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function ParseOggPageHeader() {
</span><span class="cx" style="display: block; padding: 0 10px">                // http://xiph.org/ogg/vorbis/doc/framing.html
</span><span class="cx" style="display: block; padding: 0 10px">                $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -471,6 +539,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                switch ($info['audio']['dataformat']) {
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'vorbis':
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'speex':
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        case 'opus':
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset'];  // Second Ogg page, after header block
</span><span class="cx" style="display: block; padding: 0 10px">                                $this->fseek($CommentStartOffset);
</span><span class="cx" style="display: block; padding: 0 10px">                                $commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,6 +548,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                if ($info['audio']['dataformat'] == 'vorbis') {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $commentdataoffset += (strlen('vorbis') + 1);
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                else if ($info['audio']['dataformat'] == 'opus') {
+                                       $commentdataoffset += strlen('OpusTags');
+                               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'flac':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,6 +578,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw'];
</span><span class="cx" style="display: block; padding: 0 10px">                for ($i = 0; $i < $CommentsCount; $i++) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        if ($i >= 10000) {
+                               // https://github.com/owncloud/music/issues/212#issuecomment-43082336
+                               $info['warning'][] = 'Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments';
+                               break;
+                       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                         $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -615,8 +694,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $ogg = new self($this->getid3);
</span><span class="cx" style="display: block; padding: 0 10px">                                        $ogg->setStringMode($data);
</span><span class="cx" style="display: block; padding: 0 10px">                                        $info['ogg']['comments']['picture'][] = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                'image_mime' => $imageinfo['mime'],
-                                               'data'       => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         'image_mime'   => $imageinfo['mime'],
+                                               'datalength'   => strlen($data),
+                                               'picturetype'  => 'cover art',
+                                               'image_height' => $imageinfo['height'],
+                                               'image_width'  => $imageinfo['width'],
+                                               'data'         => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']),
</ins><span class="cx" style="display: block; padding: 0 10px">                                         );
</span><span class="cx" style="display: block; padding: 0 10px">                                        unset($ogg);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -753,4 +836,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return (isset($TheoraPixelFormatLookup[$pixelformat_id]) ? $TheoraPixelFormatLookup[$pixelformat_id] : null);
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduletagapetagphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.tag.apetag.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.tag.apetag.php   2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.tag.apetag.php     2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,58 +138,88 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $thisfile_ape_items_current['flags'] = $this->parseAPEtagFlags($item_flags);
</span><span class="cx" style="display: block; padding: 0 10px">                        switch ($thisfile_ape_items_current['flags']['item_contents_raw']) {
</span><span class="cx" style="display: block; padding: 0 10px">                                case 0: // UTF-8
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                case 3: // Locator (URL, filename, etc), UTF-8 encoded
-                                       $thisfile_ape_items_current['data'] = explode("\x00", trim($thisfile_ape_items_current['data']));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         case 2: // Locator (URL, filename, etc), UTF-8 encoded
+                                       $thisfile_ape_items_current['data'] = explode("\x00", $thisfile_ape_items_current['data']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                default: // binary data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         case 1:  // binary data
+                               default:
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        switch (strtolower($item_key)) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                // http://wiki.hydrogenaud.io/index.php?title=ReplayGain#MP3Gain
</ins><span class="cx" style="display: block; padding: 0 10px">                                 case 'replaygain_track_gain':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
-                                       $thisfile_replaygain['track']['originator'] = 'unspecified';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[\\-\\+][0-9\\.,]{8}$#', $thisfile_ape_items_current['data'][0])) {
+                                               $thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                               $thisfile_replaygain['track']['originator'] = 'unspecified';
+                                       } else {
+                                               $info['warning'][] = 'MP3gainTrackGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'replaygain_track_peak':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $thisfile_replaygain['track']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
-                                       $thisfile_replaygain['track']['originator'] = 'unspecified';
-                                       if ($thisfile_replaygain['track']['peak'] <= 0) {
-                                               $info['warning'][] = 'ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[0-9\\.,]{8}$#', $thisfile_ape_items_current['data'][0])) {
+                                               $thisfile_replaygain['track']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                               $thisfile_replaygain['track']['originator'] = 'unspecified';
+                                               if ($thisfile_replaygain['track']['peak'] <= 0) {
+                                                       $info['warning'][] = 'ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
+                                               }
+                                       } else {
+                                               $info['warning'][] = 'MP3gainTrackPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px">                                        break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'replaygain_album_gain':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
-                                       $thisfile_replaygain['album']['originator'] = 'unspecified';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[\\-\\+][0-9\\.,]{8}$#', $thisfile_ape_items_current['data'][0])) {
+                                               $thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                               $thisfile_replaygain['album']['originator'] = 'unspecified';
+                                       } else {
+                                               $info['warning'][] = 'MP3gainAlbumGain value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'replaygain_album_peak':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $thisfile_replaygain['album']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
-                                       $thisfile_replaygain['album']['originator'] = 'unspecified';
-                                       if ($thisfile_replaygain['album']['peak'] <= 0) {
-                                               $info['warning'][] = 'ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[0-9\\.,]{8}$#', $thisfile_ape_items_current['data'][0])) {
+                                               $thisfile_replaygain['album']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                               $thisfile_replaygain['album']['originator'] = 'unspecified';
+                                               if ($thisfile_replaygain['album']['peak'] <= 0) {
+                                                       $info['warning'][] = 'ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
+                                               }
+                                       } else {
+                                               $info['warning'][] = 'MP3gainAlbumPeak value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px">                                        break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'mp3gain_undo':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $thisfile_ape_items_current['data'][0]);
-                                       $thisfile_replaygain['mp3gain']['undo_left']  = intval($mp3gain_undo_left);
-                                       $thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right);
-                                       $thisfile_replaygain['mp3gain']['undo_wrap']  = (($mp3gain_undo_wrap == 'Y') ? true : false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[\\-\\+][0-9]{3},[\\-\\+][0-9]{3},[NW]$#', $thisfile_ape_items_current['data'][0])) {
+                                               list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                               $thisfile_replaygain['mp3gain']['undo_left']  = intval($mp3gain_undo_left);
+                                               $thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right);
+                                               $thisfile_replaygain['mp3gain']['undo_wrap']  = (($mp3gain_undo_wrap == 'Y') ? true : false);
+                                       } else {
+                                               $info['warning'][] = 'MP3gainUndo value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'mp3gain_minmax':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $thisfile_ape_items_current['data'][0]);
-                                       $thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min);
-                                       $thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[0-9]{3},[0-9]{3}$#', $thisfile_ape_items_current['data'][0])) {
+                                               list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                               $thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min);
+                                               $thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max);
+                                       } else {
+                                               $info['warning'][] = 'MP3gainMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'mp3gain_album_minmax':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $thisfile_ape_items_current['data'][0]);
-                                       $thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min);
-                                       $thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (preg_match('#^[0-9]{3},[0-9]{3}$#', $thisfile_ape_items_current['data'][0])) {
+                                               list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                               $thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min);
+                                               $thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max);
+                                       } else {
+                                               $info['warning'][] = 'MP3gainAlbumMinMax value in APEtag appears invalid: "'.$thisfile_ape_items_current['data'][0].'"';
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'tracknumber':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,6 +252,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'cover art (recording)':
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'cover art (studio)':
</span><span class="cx" style="display: block; padding: 0 10px">                                        // list of possible cover arts from http://taglib-sharp.sourcearchive.com/documentation/2.0.3.0-2/Ape_2Tag_8cs-source.html
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        if (is_array($thisfile_ape_items_current['data'])) {
+                                               $info['warning'][] = 'APEtag "'.$item_key.'" should be flagged as Binary data, but was incorrectly flagged as UTF-8';
+                                               $thisfile_ape_items_current['data'] = implode("\x00", $thisfile_ape_items_current['data']);
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                         list($thisfile_ape_items_current['filename'], $thisfile_ape_items_current['data']) = explode("\x00", $thisfile_ape_items_current['data'], 2);
</span><span class="cx" style="display: block; padding: 0 10px">                                        $thisfile_ape_items_current['data_offset'] = $thisfile_ape_items_current['offset'] + strlen($thisfile_ape_items_current['filename']."\x00");
</span><span class="cx" style="display: block; padding: 0 10px">                                        $thisfile_ape_items_current['data_length'] = strlen($thisfile_ape_items_current['data']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -269,7 +303,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if (!isset($info['ape']['comments']['picture'])) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                                $info['ape']['comments']['picture'] = array();
</span><span class="cx" style="display: block; padding: 0 10px">                                                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        $info['ape']['comments']['picture'][] = array('data'=>$thisfile_ape_items_current['data'], 'image_mime'=>$thisfile_ape_items_current['image_mime']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 $comments_picture_data = array();
+                                                       foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {
+                                                               if (isset($thisfile_ape_items_current[$picture_key])) {
+                                                                       $comments_picture_data[$picture_key] = $thisfile_ape_items_current[$picture_key];
+                                                               }
+                                                       }
+                                                       $info['ape']['comments']['picture'][] = $comments_picture_data;
+                                                       unset($comments_picture_data);
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                                        } while (false);
</span><span class="cx" style="display: block; padding: 0 10px">                                        break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function parseAPEtagFlags($rawflagint) {
</span><span class="cx" style="display: block; padding: 0 10px">                // "Note: APE Tags 1.0 do not use any of the APE Tag flags.
</span><span class="cx" style="display: block; padding: 0 10px">                // All are set to zero on creation and ignored on reading."
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // http://www.uni-jena.de/~pfk/mpp/sv8/apetagflags.html
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags
</ins><span class="cx" style="display: block; padding: 0 10px">                 $flags['header']            = (bool) ($rawflagint & 0x80000000);
</span><span class="cx" style="display: block; padding: 0 10px">                $flags['footer']            = (bool) ($rawflagint & 0x40000000);
</span><span class="cx" style="display: block; padding: 0 10px">                $flags['this_is_header']    = (bool) ($rawflagint & 0x20000000);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,4 +409,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return in_array(strtolower($itemkey), $APEtagItemIsUTF8Lookup);
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduletagid3v1php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.tag.id3v1.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.tag.id3v1.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.tag.id3v1.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,4 +357,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return $ID3v1Tag;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduletagid3v2php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.tag.id3v2.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.tag.id3v2.php    2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.tag.id3v2.php      2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -625,12 +625,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -640,8 +641,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['encodingid']  = $frame_textencoding;
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $parsedFrame['description'] = $frame_description;
-                       $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $parsedFrame['description'] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $frame_description));
+                       $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px">                         if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
</span><span class="cx" style="display: block; padding: 0 10px">                                if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -717,11 +718,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -729,10 +732,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_description) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding));
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        if ($frame_terminatorpos) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,20 +959,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset += 3;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_description) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['encodingid']   = $frame_textencoding;
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1002,8 +1007,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset += 3;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1020,16 +1027,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_remainingdata = substr($parsedFrame['data'], $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        while (strlen($frame_remainingdata)) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_offset = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $frame_terminatorpos = strpos($frame_remainingdata, $this->TextEncodingTerminatorLookup($frame_textencoding));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $frame_terminatorpos = strpos($frame_remainingdata, $frame_textencoding_terminator);
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ($frame_terminatorpos === false) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $frame_remainingdata = '';
</span><span class="cx" style="display: block; padding: 0 10px">                                } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        $parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px">                                         if (($timestampindex == 0) && (ord($frame_remainingdata{0}) != 0)) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                // timestamp probably omitted for first data item
</span><span class="cx" style="display: block; padding: 0 10px">                                        } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1060,20 +1067,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_offset += 3;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                         $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                                if (ord($frame_description) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $frame_description = '';
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['encodingid']   = $frame_textencoding;
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1330,8 +1339,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1367,8 +1378,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if ($frame_offset >= $parsedFrame['datalength']) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                         $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1386,7 +1397,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['picturetypeid']    = $frame_picturetype;
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['picturetype']      = $this->APICPictureTypeLookup($frame_picturetype);
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['description']      = $frame_description;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $parsedFrame['data']             = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $parsedFrame['data']             = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator));
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $parsedFrame['datalength']       = strlen($parsedFrame['data']);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                $parsedFrame['image_mime'] = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1443,7 +1454,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if (!isset($info['id3v2']['comments']['picture'])) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                                $info['id3v2']['comments']['picture'] = array();
</span><span class="cx" style="display: block; padding: 0 10px">                                                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        $info['id3v2']['comments']['picture'][] = array('data'=>$parsedFrame['data'], 'image_mime'=>$parsedFrame['image_mime']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 $comments_picture_data = array();
+                                                       foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) {
+                                                               if (isset($parsedFrame[$picture_key])) {
+                                                                       $comments_picture_data[$picture_key] = $parsedFrame[$picture_key];
+                                                               }
+                                                       }
+                                                       $info['id3v2']['comments']['picture'][] = $comments_picture_data;
+                                                       unset($comments_picture_data);
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                } while (false);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1462,8 +1480,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1472,25 +1492,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = $frame_terminatorpos + strlen("\x00");
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_filename) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_filename = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_description) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['objectdata']  = (string) substr($parsedFrame['data'], $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['encodingid']  = $frame_textencoding;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1607,7 +1627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'LINK')) || // 4.20  LINK Linked information
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) {     // 4.22  LNK  Linked information
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) {    // 4.22  LNK  Linked information
</ins><span class="cx" style="display: block; padding: 0 10px">                         //   There may be more than one 'LINK' frame in a tag,
</span><span class="cx" style="display: block; padding: 0 10px">                        //   but only one with the same contents
</span><span class="cx" style="display: block; padding: 0 10px">                        // <Header for 'Linked information', ID: 'LINK'>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1635,7 +1655,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $parsedFrame['additionaldata'] = (string) substr($parsedFrame['data'], $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = utf8_encode($parsedFrame['url']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback_iso88591_utf8($parsedFrame['url']);
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        unset($parsedFrame['data']);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1729,8 +1749,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding);
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $frame_textencoding_terminator = "\x00";
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1752,25 +1774,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1));
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_sellername) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_sellername = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        if (ord($frame_description) === 0) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $frame_description = '';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
</span><span class="cx" style="display: block; padding: 0 10px">                        $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1944,6 +1966,186 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        unset($parsedFrame['data']);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CHAP')) { // CHAP Chapters frame (ID3v2.3+ only)
+                       // http://id3.org/id3v2-chapters-1.0
+                       // <ID3v2.3 or ID3v2.4 frame header, ID: "CHAP">           (10 bytes)
+                       // Element ID      <text string> $00
+                       // Start time      $xx xx xx xx
+                       // End time        $xx xx xx xx
+            // Start offset    $xx xx xx xx
+            // End offset      $xx xx xx xx
+            // <Optional embedded sub-frames>
+
+                       $frame_offset = 0;
+                       @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2);
+                       $frame_offset += strlen($parsedFrame['element_id']."\x00");
+                       $parsedFrame['time_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       $frame_offset += 4;
+                       $parsedFrame['time_end']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       $frame_offset += 4;
+                       if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") {
+                               // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized."
+                               $parsedFrame['offset_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       }
+                       $frame_offset += 4;
+                       if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") {
+                               // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized."
+                               $parsedFrame['offset_end']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       }
+                       $frame_offset += 4;
+
+                       if ($frame_offset < strlen($parsedFrame['data'])) {
+                               $parsedFrame['subframes'] = array();
+                               while ($frame_offset < strlen($parsedFrame['data'])) {
+                                       // <Optional embedded sub-frames>
+                                       $subframe = array();
+                                       $subframe['name']      =                           substr($parsedFrame['data'], $frame_offset, 4);
+                                       $frame_offset += 4;
+                                       $subframe['size']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                                       $frame_offset += 4;
+                                       $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                                       $frame_offset += 2;
+                                       if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {
+                                               $info['warning'][] = 'CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)';
+                                               break;
+                                       }
+                                       $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']);
+                                       $frame_offset += $subframe['size'];
+
+                                       $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1));
+                                       $subframe['text']       =     substr($subframe_rawdata, 1);
+                                       $subframe['encoding']   = $this->TextEncodingNameLookup($subframe['encodingid']);
+                                       $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));;
+                                       switch (substr($encoding_converted_text, 0, 2)) {
+                                               case "\xFF\xFE":
+                                               case "\xFE\xFF":
+                                                       switch (strtoupper($info['id3v2']['encoding'])) {
+                                                               case 'ISO-8859-1':
+                                                               case 'UTF-8':
+                                                                       $encoding_converted_text = substr($encoding_converted_text, 2);
+                                                                       // remove unwanted byte-order-marks
+                                                                       break;
+                                                               default:
+                                                                       // ignore
+                                                                       break;
+                                                       }
+                                                       break;
+                                               default:
+                                                       // do not remove BOM
+                                                       break;
+                                       }
+
+                                       if (($subframe['name'] == 'TIT2') || ($subframe['name'] == 'TIT3')) {
+                                               if ($subframe['name'] == 'TIT2') {
+                                                       $parsedFrame['chapter_name']        = $encoding_converted_text;
+                                               } elseif ($subframe['name'] == 'TIT3') {
+                                                       $parsedFrame['chapter_description'] = $encoding_converted_text;
+                                               }
+                                               $parsedFrame['subframes'][] = $subframe;
+                                       } else {
+                                               $info['warning'][] = 'ID3v2.CHAP subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)';
+                                       }
+                               }
+                               unset($subframe_rawdata, $subframe, $encoding_converted_text);
+                       }
+
+                       $id3v2_chapter_entry = array();
+                       foreach (array('id', 'time_begin', 'time_end', 'offset_begin', 'offset_end', 'chapter_name', 'chapter_description') as $id3v2_chapter_key) {
+                               if (isset($parsedFrame[$id3v2_chapter_key])) {
+                                       $id3v2_chapter_entry[$id3v2_chapter_key] = $parsedFrame[$id3v2_chapter_key];
+                               }
+                       }
+                       if (!isset($info['id3v2']['chapters'])) {
+                               $info['id3v2']['chapters'] = array();
+                       }
+                       $info['id3v2']['chapters'][] = $id3v2_chapter_entry;
+                       unset($id3v2_chapter_entry, $id3v2_chapter_key);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CTOC')) { // CTOC Chapters Table Of Contents frame (ID3v2.3+ only)
+                       // http://id3.org/id3v2-chapters-1.0
+                       // <ID3v2.3 or ID3v2.4 frame header, ID: "CTOC">           (10 bytes)
+                       // Element ID      <text string> $00
+                       // CTOC flags        %xx
+                       // Entry count       $xx
+                       // Child Element ID  <string>$00   /* zero or more child CHAP or CTOC entries */
+            // <Optional embedded sub-frames>
+
+                       $frame_offset = 0;
+                       @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2);
+                       $frame_offset += strlen($parsedFrame['element_id']."\x00");
+                       $ctoc_flags_raw = ord(substr($parsedFrame['data'], $frame_offset, 1));
+                       $frame_offset += 1;
+                       $parsedFrame['entry_count'] = ord(substr($parsedFrame['data'], $frame_offset, 1));
+                       $frame_offset += 1;
+
+                       $terminator_position = null;
+                       for ($i = 0; $i < $parsedFrame['entry_count']; $i++) {
+                               $terminator_position = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                               $parsedFrame['child_element_ids'][$i] = substr($parsedFrame['data'], $frame_offset, $terminator_position - $frame_offset);
+                               $frame_offset = $terminator_position + 1;
+                       }
+
+                       $parsedFrame['ctoc_flags']['ordered']   = (bool) ($ctoc_flags_raw & 0x01);
+                       $parsedFrame['ctoc_flags']['top_level'] = (bool) ($ctoc_flags_raw & 0x03);
+
+                       unset($ctoc_flags_raw, $terminator_position);
+
+                       if ($frame_offset < strlen($parsedFrame['data'])) {
+                               $parsedFrame['subframes'] = array();
+                               while ($frame_offset < strlen($parsedFrame['data'])) {
+                                       // <Optional embedded sub-frames>
+                                       $subframe = array();
+                                       $subframe['name']      =                           substr($parsedFrame['data'], $frame_offset, 4);
+                                       $frame_offset += 4;
+                                       $subframe['size']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                                       $frame_offset += 4;
+                                       $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                                       $frame_offset += 2;
+                                       if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {
+                                               $info['warning'][] = 'CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)';
+                                               break;
+                                       }
+                                       $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']);
+                                       $frame_offset += $subframe['size'];
+
+                                       $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1));
+                                       $subframe['text']       =     substr($subframe_rawdata, 1);
+                                       $subframe['encoding']   = $this->TextEncodingNameLookup($subframe['encodingid']);
+                                       $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));;
+                                       switch (substr($encoding_converted_text, 0, 2)) {
+                                               case "\xFF\xFE":
+                                               case "\xFE\xFF":
+                                                       switch (strtoupper($info['id3v2']['encoding'])) {
+                                                               case 'ISO-8859-1':
+                                                               case 'UTF-8':
+                                                                       $encoding_converted_text = substr($encoding_converted_text, 2);
+                                                                       // remove unwanted byte-order-marks
+                                                                       break;
+                                                               default:
+                                                                       // ignore
+                                                                       break;
+                                                       }
+                                                       break;
+                                               default:
+                                                       // do not remove BOM
+                                                       break;
+                                       }
+
+                                       if (($subframe['name'] == 'TIT2') || ($subframe['name'] == 'TIT3')) {
+                                               if ($subframe['name'] == 'TIT2') {
+                                                       $parsedFrame['toc_name']        = $encoding_converted_text;
+                                               } elseif ($subframe['name'] == 'TIT3') {
+                                                       $parsedFrame['toc_description'] = $encoding_converted_text;
+                                               }
+                                               $parsedFrame['subframes'][] = $subframe;
+                                       } else {
+                                               $info['warning'][] = 'ID3v2.CTOC subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)';
+                                       }
+                               }
+                               unset($subframe_rawdata, $subframe, $encoding_converted_text);
+                       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3344,7 +3546,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        3   => "\x00",     // $03  UTF-8 encoded Unicode. Terminated with $00.
</span><span class="cx" style="display: block; padding: 0 10px">                        255 => "\x00\x00"
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : "\x00");
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public static function TextEncodingNameLookup($encoding) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3422,3 +3624,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins></span></pre></div>
<a id="trunksrcwpincludesID3moduletaglyrics3php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ID3/module.tag.lyrics3.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ID3/module.tag.lyrics3.php  2015-06-27 23:39:16 UTC (rev 32978)
+++ trunk/src/wp-includes/ID3/module.tag.lyrics3.php    2015-06-28 00:16:17 UTC (rev 32979)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,20 +101,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size);
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if (!isset($info['ape'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $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'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         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)';
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (!empty($getid3_temp->info['replay_gain'])) {
-                                       $info['replay_gain'] = $getid3_temp->info['replay_gain'];
-                               }
-                               unset($getid3_temp, $getid3_apetag);
</del><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,4 +295,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">                return null;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre>
</div>
</div>

</body>
</html>