<!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>[48278] trunk/src/wp-includes/ID3: External Libraries: Update getID3 to version 1.9.20.</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 { white-space: pre-line; 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/48278">48278</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/48278","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-07-02 15:46:17 +0000 (Thu, 02 Jul 2020)</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'>External Libraries: Update getID3 to version 1.9.20.
A full list of changes in this update can be found on GitHub: https://github.com/JamesHeinrich/getID3/compare/v1.9.19...v1.9.20.
Props hareesh-pillai, desrosj.
Previously [47601-47604].
Fixes <a href="https://core.trac.wordpress.org/ticket/49945">#49945</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="#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="#trunksrcwpincludesID3moduleaudiovideoriffphp">trunk/src/wp-includes/ID3/module.audio-video.riff.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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/getid3.lib.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -681,10 +681,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function array_max($arraydata, $returnkey=false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $maxvalue = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $maxkey = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $maxkey = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($arraydata as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_array($value)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($value > $maxvalue) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($maxvalue === false) || ($value > $maxvalue)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $maxvalue = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> $maxkey = $key;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,10 +701,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function array_min($arraydata, $returnkey=false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $minvalue = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $minkey = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $minkey = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($arraydata as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_array($value)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($value > $minvalue) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($minvalue === false) || ($value < $minvalue)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $minvalue = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> $minkey = $key;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1529,13 +1529,20 @@
</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"> * @param array $ThisFileInfo
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $option_tags_html default true (just as in the main getID3 class)
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function CopyTagsToComments(&$ThisFileInfo) {
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html=true) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Copy all entries from ['tags'] into common ['comments']
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($ThisFileInfo['tags'])) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isset($ThisFileInfo['tags']['id3v1'])) {
+ // bubble ID3v1 to the end, if present to aid in detecting bad ID3v1 encodings
+ $ID3v1 = $ThisFileInfo['tags']['id3v1'];
+ unset($ThisFileInfo['tags']['id3v1']);
+ $ThisFileInfo['tags']['id3v1'] = $ID3v1;
+ unset($ID3v1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($tagarray as $tagname => $tagdata) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($tagdata as $key => $value) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1554,6 +1561,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break 2;
</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">+ if (function_exists('mb_convert_encoding')) {
+ if (trim($value) == trim(substr(mb_convert_encoding($existingvalue, $ThisFileInfo['id3v1']['encoding'], $ThisFileInfo['encoding']), 0, 30))) {
+ // value stored in ID3v1 appears to be probably the multibyte value transliterated (badly) into ISO-8859-1 in ID3v1.
+ // As an example, Foobar2000 will do this if you tag a file with Chinese or Arabic or Cyrillic or something that doesn't fit into ISO-8859-1 the ID3v1 will consist of mostly "?" characters, one per multibyte unrepresentable character
+ break 2;
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (!is_array($value)) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1562,7 +1576,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $oldvaluelength = strlen(trim($existingvalue));
</span><span class="cx" style="display: block; padding: 0 10px"> if ((strlen($existingvalue) > 10) && ($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //break 2;
</del><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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1597,20 +1610,22 @@
</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">- // Copy to ['comments_html']
- if (!empty($ThisFileInfo['comments'])) {
- foreach ($ThisFileInfo['comments'] as $field => $values) {
- if ($field == 'picture') {
- // pictures can take up a lot of space, and we don't need multiple copies of them
- // let there be a single copy in [comments][picture], and not elsewhere
- continue;
- }
- foreach ($values as $index => $value) {
- if (is_array($value)) {
- $ThisFileInfo['comments_html'][$field][$index] = $value;
- } else {
- $ThisFileInfo['comments_html'][$field][$index] = str_replace('�', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($option_tags_html) {
+ // Copy ['comments'] to ['comments_html']
+ if (!empty($ThisFileInfo['comments'])) {
+ foreach ($ThisFileInfo['comments'] as $field => $values) {
+ if ($field == 'picture') {
+ // pictures can take up a lot of space, and we don't need multiple copies of them
+ // let there be a single copy in [comments][picture], and not elsewhere
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ($values as $index => $value) {
+ if (is_array($value)) {
+ $ThisFileInfo['comments_html'][$field][$index] = $value;
+ } else {
+ $ThisFileInfo['comments_html'][$field][$index] = str_replace('�', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));
+ }
+ }
</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></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/getid3.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,6 +99,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $encoding_id3v1 = 'ISO-8859-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">+ /**
+ * ID3v1 should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'Windows-1251' or 'KOI8-R'. If true attempt to detect these encodings, but may return incorrect values for some tags actually in ISO-8859-1 encoding
+ *
+ * @var bool
+ */
+ public $encoding_id3v1_autodetect = false;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional tag checks - disable for speed.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,7 +257,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</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.19-201912211559';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const VERSION = '1.9.20-202006061653';
</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">@@ -289,11 +296,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
</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">- if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
+ if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // http://php.net/manual/en/mbstring.overload.php
</span><span class="cx" style="display: block; padding: 0 10px"> // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"
</span><span class="cx" style="display: block; padding: 0 10px"> // getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n"; // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
+ $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n";
</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"> // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,13 +309,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (version_compare(PHP_VERSION, '7.4.0', '<')) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check for magic_quotes_runtime
</span><span class="cx" style="display: block; padding: 0 10px"> if (function_exists('get_magic_quotes_runtime')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (get_magic_quotes_runtime()) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
+ if (get_magic_quotes_runtime()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n";
</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"> // Check for magic_quotes_gpc
</span><span class="cx" style="display: block; padding: 0 10px"> if (function_exists('get_magic_quotes_gpc')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (get_magic_quotes_gpc()) { // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated
+ if (get_magic_quotes_gpc()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";
</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">@@ -846,6 +857,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mime_type' => 'application/octet-stream',
</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">+ // DSDIFF - audio - Direct Stream Digital Interchange File Format
+ 'dsdiff' => array(
+ 'pattern' => '^FRM8',
+ 'group' => 'audio',
+ 'module' => 'dsdiff',
+ 'mime_type' => 'audio/dsd',
+ ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // DTS - audio - Dolby Theatre System
</span><span class="cx" style="display: block; padding: 0 10px"> 'dts' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pattern' => '^\\x7F\\xFE\\x80\\x01',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -973,6 +992,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'fail_ape' => 'ERROR',
</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">+ // TAK - audio - Tom's lossless Audio Kompressor
+ 'tak' => array(
+ 'pattern' => '^tBaK',
+ 'group' => 'audio',
+ 'module' => 'tak',
+ 'mime_type' => 'application/octet-stream',
+ ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org)
</span><span class="cx" style="display: block; padding: 0 10px"> 'tta' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pattern' => '^TTA', // could also be '^TTA(\\x01|\\x02|\\x03|2|1)'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1033,6 +1060,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mime_type' => 'video/x-flv',
</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">+ // IVF - audio/video - IVF
+ 'ivf' => array(
+ 'pattern' => '^DKIF',
+ 'group' => 'audio-video',
+ 'module' => 'ivf',
+ 'mime_type' => 'video/x-ivf',
+ ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // MKAV - audio/video - Mastroka
</span><span class="cx" style="display: block; padding: 0 10px"> 'matroska' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pattern' => '^\\x1A\\x45\\xDF\\xA3',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1217,12 +1252,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'iconv_req' => false,
</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">+ // HPK - data - HPK compressed data
+ 'hpk' => array(
+ 'pattern' => '^BPUL',
+ 'group' => 'archive',
+ 'module' => 'hpk',
+ 'mime_type' => 'application/octet-stream',
+ 'fail_id3' => 'ERROR',
+ 'fail_ape' => 'ERROR',
+ ),
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // RAR - data - RAR compressed data
</span><span class="cx" style="display: block; padding: 0 10px"> 'rar' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pattern' => '^Rar\\!',
</span><span class="cx" style="display: block; padding: 0 10px"> 'group' => 'archive',
</span><span class="cx" style="display: block; padding: 0 10px"> 'module' => 'rar',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'mime_type' => 'application/octet-stream',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'mime_type' => 'application/vnd.rar',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'fail_id3' => 'ERROR',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fail_ape' => 'ERROR',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1424,6 +1469,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'flac' => array('vorbiscomment' , 'UTF-8'),
</span><span class="cx" style="display: block; padding: 0 10px"> 'divxtag' => array('divx' , 'ISO-8859-1'),
</span><span class="cx" style="display: block; padding: 0 10px"> 'iptc' => array('iptc' , 'ISO-8859-1'),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'dsdiff' => array('dsdiff' , 'ISO-8859-1'),
</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">@@ -1526,6 +1572,17 @@
</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">+ * Calls getid3_lib::CopyTagsToComments() but passes in the option_tags_html setting from this instance of getID3
+ *
+ * @param array $ThisFileInfo
+ *
+ * @return bool
+ */
+ public function CopyTagsToComments(&$ThisFileInfo) {
+ return getid3_lib::CopyTagsToComments($ThisFileInfo, $this->option_tags_html);
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $algorithm
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1560,7 +1617,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but
</span><span class="cx" style="display: block; padding: 0 10px"> // currently vorbiscomment only works on OggVorbis files.
</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 (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
+ if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');
</span><span class="cx" style="display: block; padding: 0 10px"> $this->info[$algorithm.'_data'] = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2054,6 +2112,61 @@
</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">+ * @return string|false
+ *
+ * @throws getid3_exception
+ */
+ protected function fgets() {
+ // must be able to handle CR/LF/CRLF but not read more than one lineend
+ $buffer = ''; // final string we will return
+ $prevchar = ''; // save previously-read character for end-of-line checking
+ if ($this->data_string_flag) {
+ while (true) {
+ $thischar = substr($this->data_string, $this->data_string_position++, 1);
+ if (($prevchar == "\r") && ($thischar != "\n")) {
+ // read one byte too many, back up
+ $this->data_string_position--;
+ break;
+ }
+ $buffer .= $thischar;
+ if ($thischar == "\n") {
+ break;
+ }
+ if ($this->data_string_position >= $this->data_string_length) {
+ // EOF
+ break;
+ }
+ $prevchar = $thischar;
+ }
+
+ } else {
+
+ // Ideally we would just use PHP's fgets() function, however...
+ // it does not behave consistently with regards to mixed line endings, may be system-dependent
+ // and breaks entirely when given a file with mixed \r vs \n vs \r\n line endings (e.g. some PDFs)
+ //return fgets($this->getid3->fp);
+ while (true) {
+ $thischar = fgetc($this->getid3->fp);
+ if (($prevchar == "\r") && ($thischar != "\n")) {
+ // read one byte too many, back up
+ fseek($this->getid3->fp, -1, SEEK_CUR);
+ break;
+ }
+ $buffer .= $thischar;
+ if ($thischar == "\n") {
+ break;
+ }
+ if (feof($this->getid3->fp)) {
+ break;
+ }
+ $prevchar = $thischar;
+ }
+
+ }
+ return $buffer;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function feof() {
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio-video.asf.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_asf extends getid3_handler
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio-video.flv.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,6 +53,10 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> define('GETID3_FLV_TAG_AUDIO', 8);
</span><span class="cx" style="display: block; padding: 0 10px"> define('GETID3_FLV_TAG_VIDEO', 9);
</span><span class="cx" style="display: block; padding: 0 10px"> define('GETID3_FLV_TAG_META', 18);
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio-video.matroska.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> define('EBML_ID_CHAPTERS', 0x0043A770); // [10][43][A7][70] -- A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.
</span><span class="cx" style="display: block; padding: 0 10px"> define('EBML_ID_SEEKHEAD', 0x014D9B74); // [11][4D][9B][74] -- Contains the position of other level 1 elements.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,7 +332,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $info['video']['streams'][] = $track_info;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['video']['streams'][$trackarray['TrackUID']] = $track_info;
</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 2: // Audio
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,7 +365,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // create temp instance
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp = new getID3();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($track_info['dataformat'] != 'flac') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $getid3_temp->openfile($this->getid3->filename);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp->info['avdataoffset'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'];
</span><span class="cx" style="display: block; padding: 0 10px"> if ($track_info['dataformat'][0] == 'm' || $track_info['dataformat'] == 'flac') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,7 +481,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $info['audio']['streams'][] = $track_info;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['audio']['streams'][$trackarray['TrackUID']] = $track_info;
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,6 +512,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($info['mime_type']);
</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">+ // use _STATISTICS_TAGS if available to set audio/video bitrates
+ if (!empty($info['matroska']['tags'])) {
+ $_STATISTICS_byTrackUID = array();
+ foreach ($info['matroska']['tags'] as $key1 => $value1) {
+ if (!empty($value1['Targets']['TagTrackUID'][0]) && !empty($value1['SimpleTag'])) {
+ foreach ($value1['SimpleTag'] as $key2 => $value2) {
+ if (!empty($value2['TagName']) && isset($value2['TagString'])) {
+ $_STATISTICS_byTrackUID[$value1['Targets']['TagTrackUID'][0]][$value2['TagName']] = $value2['TagString'];
+ }
+ }
+ }
+ }
+ foreach (array('audio','video') as $avtype) {
+ if (!empty($info[$avtype]['streams'])) {
+ foreach ($info[$avtype]['streams'] as $trackUID => $trackdata) {
+ if (!isset($trackdata['bitrate']) && !empty($_STATISTICS_byTrackUID[$trackUID]['BPS'])) {
+ $info[$avtype]['streams'][$trackUID]['bitrate'] = (int) $_STATISTICS_byTrackUID[$trackUID]['BPS'];
+ @$info[$avtype]['bitrate'] += $info[$avtype]['streams'][$trackUID]['bitrate'];
+ }
+ }
+ }
+ }
+ }
+
</ins><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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,8 +641,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> while ($this->getEBMLelement($subelement, $track_entry['end'], array(EBML_ID_VIDEO, EBML_ID_AUDIO, EBML_ID_CONTENTENCODINGS, EBML_ID_CODECPRIVATE))) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ($subelement['id']) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case EBML_ID_TRACKUID:
+ $track_entry[$subelement['id_name']] = getid3_lib::PrintHexBytes($subelement['data'], true, false);
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_TRACKNUMBER:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case EBML_ID_TRACKUID:
</del><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_TRACKTYPE:
</span><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_MINCACHE:
</span><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_MAXCACHE:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -963,7 +992,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_TAGEDITIONUID:
</span><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_TAGCHAPTERUID:
</span><span class="cx" style="display: block; padding: 0 10px"> case EBML_ID_TAGATTACHMENTUID:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $targets_entry[$sub_sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $targets_entry[$sub_sub_subelement['id_name']][] = getid3_lib::PrintHexBytes($sub_sub_subelement['data'], true, false);
</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"> default:
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio-video.quicktime.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,6 +15,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); // needed for ISO 639-2 language code lookup
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,23 +58,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $atomsize = getid3_lib::BigEndian2Int($this->fread(8));
</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">- $info['quicktime'][$atomname]['name'] = $atomname;
- $info['quicktime'][$atomname]['size'] = $atomsize;
- $info['quicktime'][$atomname]['offset'] = $offset;
-
</del><span class="cx" style="display: block; padding: 0 10px"> if (($offset + $atomsize) > $info['avdataend']) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime'][$atomname]['name'] = $atomname;
+ $info['quicktime'][$atomname]['size'] = $atomsize;
+ $info['quicktime'][$atomname]['offset'] = $offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->error('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)');
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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"> if ($atomsize == 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Furthermore, for historical reasons the list of atoms is optionally
</span><span class="cx" style="display: block; padding: 0 10px"> // terminated by a 32-bit integer set to 0. If you are writing a program
</span><span class="cx" style="display: block; padding: 0 10px"> // to read user data atoms, you should allow for the terminating 0.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime'][$atomname]['name'] = $atomname;
+ $info['quicktime'][$atomname]['size'] = $atomsize;
+ $info['quicktime'][$atomname]['offset'] = $offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</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 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, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsedAtomData = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
+ $parsedAtomData['name'] = $atomname;
+ $parsedAtomData['size'] = $atomsize;
+ $parsedAtomData['offset'] = $offset;
+ if (in_array($atomname, array('uuid'))) {
+ @$info['quicktime'][$atomname][] = $parsedAtomData;
+ } else {
+ $info['quicktime'][$atomname] = $parsedAtomData;
+ }
</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">@@ -114,7 +127,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($info['quicktime']['comments']['location.ISO6709'] as $ISO6709string) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ISO6709parsed = array('latitude'=>false, 'longitude'=>false, 'altitude'=>false);
</span><span class="cx" style="display: block; padding: 0 10px"> if (preg_match('#^([\\+\\-])([0-9]{2}|[0-9]{4}|[0-9]{6})(\\.[0-9]+)?([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?(([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?)?/$#', $ISO6709string, $matches)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- @list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches; // phpcs:ignore PHPCompatibility.Lists.AssignmentOrder.Affected
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // phpcs:ignore PHPCompatibility.Lists.AssignmentOrder.Affected
+ @list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (strlen($lat_deg) == 2) { // [+-]DD.D
</span><span class="cx" style="display: block; padding: 0 10px"> $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim($lat_deg, '0').$lat_deg_dec);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,8 +157,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach (array('latitude', 'longitude', 'altitude') as $key) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($ISO6709parsed[$key] !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!in_array($value, $info['quicktime']['comments']['gps_'.$key])) {
- $info['quicktime']['comments']['gps_'.$key][] = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isset($info['quicktime']['comments']['gps_'.$key]) || !in_array($value, $info['quicktime']['comments']['gps_'.$key])) {
+ @$info['quicktime']['comments']['gps_'.$key][] = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]);
</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">@@ -527,6 +541,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (preg_match('#^GIF#', $atom_structure['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['image_mime'] = 'image/gif';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');
</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 'atID':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -553,6 +568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (preg_match('#^GIF#', $atom_structure['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['image_mime'] = 'image/gif';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -756,6 +772,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['sample_description_table'][$i]['data'] = substr($atom_data, $stsdEntriesDataOffset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2));
</span><span class="cx" style="display: block; padding: 0 10px"> $stsdEntriesDataOffset += ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2);
</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 (substr($atom_structure['sample_description_table'][$i]['data'], 1, 54) == 'application/octet-stream;type=com.parrot.videometadata') {
+ // special handling for apparently-malformed (TextMetaDataSampleEntry?) data for some version of Parrot drones
+ $atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['mime_type'] = substr($atom_structure['sample_description_table'][$i]['data'], 1, 55);
+ $atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['metadata_version'] = (int) substr($atom_structure['sample_description_table'][$i]['data'], 55, 1);
+ unset($atom_structure['sample_description_table'][$i]['data']);
+$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in this version of getID3() ['.$this->getid3->version().']');
+ continue;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['sample_description_table'][$i]['encoder_version'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 0, 2));
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['sample_description_table'][$i]['encoder_revision'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 2, 2));
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['sample_description_table'][$i]['encoder_vendor'] = substr($atom_structure['sample_description_table'][$i]['data'], 4, 4);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1133,7 +1158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['component_manufacturer'] = substr($atom_data, 12, 4);
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['component_flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['component_flags_mask'] = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $atom_structure['component_name'] = $this->Pascal2String(substr($atom_data, 24));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $atom_structure['component_name'] = $this->MaybePascal2String(substr($atom_data, 24));
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (($atom_structure['component_subtype'] == 'STpn') && ($atom_structure['component_manufacturer'] == 'zzzz')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $info['video']['dataformat'] = 'quicktimevr';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1164,6 +1189,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {
</span><span class="cx" style="display: block; padding: 0 10px"> $info['comments']['language'][] = $atom_structure['language'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];
+ $info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1174,6 +1201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['atom_index'] = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2)); // usually: 0x01
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['modification_date_unix'] = getid3_lib::DateMac2Unix($atom_structure['modification_date']);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modification_date_unix'];
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1271,6 +1299,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['creation_time_unix'] = getid3_lib::DateMac2Unix($atom_structure['creation_time']);
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['modify_time_unix'] = getid3_lib::DateMac2Unix($atom_structure['modify_time']);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];
+ $info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $info['quicktime']['time_scale'] = ((isset($info['quicktime']['time_scale']) && ($info['quicktime']['time_scale'] < 1000)) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']);
</span><span class="cx" style="display: block; padding: 0 10px"> $info['quicktime']['display_scale'] = $atom_structure['matrix_a'];
</span><span class="cx" style="display: block; padding: 0 10px"> $info['playtime_seconds'] = $atom_structure['duration'] / $atom_structure['time_scale'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1309,6 +1339,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['flags']['in_poster'] = (bool) ($atom_structure['flags_raw'] & 0x0008);
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['creation_time_unix'] = getid3_lib::DateMac2Unix($atom_structure['creation_time']);
</span><span class="cx" style="display: block; padding: 0 10px"> $atom_structure['modify_time_unix'] = getid3_lib::DateMac2Unix($atom_structure['modify_time']);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['timestamps_unix']['create'][$atom_structure['hierarchy']] = $atom_structure['creation_time_unix'];
+ $info['quicktime']['timestamps_unix']['modify'][$atom_structure['hierarchy']] = $atom_structure['modify_time_unix'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // https://www.getid3.org/phpBB3/viewtopic.php?t=1908
</span><span class="cx" style="display: block; padding: 0 10px"> // attempt to compute rotation from matrix values
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1450,7 +1482,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info['avdataend'] = $atom_structure['offset'] + $atom_structure['size']; // $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp = new getID3();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $getid3_temp->openfile($this->getid3->filename);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
</ins><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp->info['avdataend'] = $info['avdataend'];
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_mp3 = new getid3_mp3($getid3_temp);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1639,122 +1671,144 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'uuid': // Atom holding 360fly spatial data??
- /* code in this block by Paul Lewis 2019-Oct-31 */
- /* Sensor Timestamps need to be calculated using the recordings base time at ['quicktime']['moov']['subatoms'][0]['creation_time_unix']. */
- $atom_structure['title'] = '360Fly Sensor Data';
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'uuid': // user-defined atom often seen containing XML data, also used for potentially many other purposes, only a few specifically handled by getID3 (e.g. 360fly spatial data)
</ins><span class="cx" style="display: block; padding: 0 10px"> //Get the UUID ID in first 16 bytes
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid_bytes_read = unpack('H8time_low/H4time_mid/H4time_hi/H4clock_seq_hi/H12clock_seq_low', substr($atom_data, 0, 16));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $atom_structure['uuid_field_id'] = print_r(implode('-', $uuid_bytes_read), true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $atom_structure['uuid_field_id'] = implode('-', $uuid_bytes_read);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //Get the UUID HEADER data
- $uuid_bytes_read = unpack('Sheader_size/Sheader_version/Stimescale/Shardware_version/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/', substr($atom_data, 16, 32));
- $atom_structure['uuid_header'] = json_encode($uuid_bytes_read, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ($atom_structure['uuid_field_id']) { // http://fileformats.archiveteam.org/wiki/Boxes/atoms_format#UUID_boxes
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $start_byte = 48;
- $atom_SENSOR_data = substr($atom_data, $start_byte);
- $atom_structure['sensor_data']['data_type'] = array(
- 'fusion_count' => 0, // ID 250
- 'fusion_data' => array(),
- 'accel_count' => 0, // ID 1
- 'accel_data' => array(),
- 'gyro_count' => 0, // ID 2
- 'gyro_data' => array(),
- 'magno_count' => 0, // ID 3
- 'magno_data' => array(),
- 'gps_count' => 0, // ID 5
- 'gps_data' => array(),
- 'rotation_count' => 0, // ID 6
- 'rotation_data' => array(),
- 'unknown_count' => 0, // ID ??
- 'unknown_data' => array(),
- 'debug_list' => '', // Used to debug variables stored as comma delimited strings
- );
- $debug_structure['debug_items'] = array();
- // Can start loop here to decode all sensor data in 32 Byte chunks:
- foreach (str_split($atom_SENSOR_data, 32) as $sensor_key => $sensor_data) {
- // This gets me a data_type code to work out what data is in the next 31 bytes.
- $sensor_data_type = substr($sensor_data, 0, 1);
- $sensor_data_content = substr($sensor_data, 1);
- $uuid_bytes_read = unpack('C*', $sensor_data_type);
- $sensor_data_array = array();
- switch ($uuid_bytes_read[1]) {
- case 250:
- $atom_structure['sensor_data']['data_type']['fusion_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
- $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
- $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
- array_push($atom_structure['sensor_data']['data_type']['fusion_data'], $sensor_data_array);
- break;
- case 1:
- $atom_structure['sensor_data']['data_type']['accel_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
- $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
- $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
- array_push($atom_structure['sensor_data']['data_type']['accel_data'], $sensor_data_array);
- break;
- case 2:
- $atom_structure['sensor_data']['data_type']['gyro_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
- $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
- $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
- array_push($atom_structure['sensor_data']['data_type']['gyro_data'], $sensor_data_array);
- break;
- case 3:
- $atom_structure['sensor_data']['data_type']['magno_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Gmagx/Gmagy/Gmagz/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['magx'] = $uuid_bytes_read['magx'];
- $sensor_data_array['magy'] = $uuid_bytes_read['magy'];
- $sensor_data_array['magz'] = $uuid_bytes_read['magz'];
- array_push($atom_structure['sensor_data']['data_type']['magno_data'], $sensor_data_array);
- break;
- case 5:
- $atom_structure['sensor_data']['data_type']['gps_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Glat/Glon/Galt/Gspeed/nbearing/nacc/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['lat'] = $uuid_bytes_read['lat'];
- $sensor_data_array['lon'] = $uuid_bytes_read['lon'];
- $sensor_data_array['alt'] = $uuid_bytes_read['alt'];
- $sensor_data_array['speed'] = $uuid_bytes_read['speed'];
- $sensor_data_array['bearing'] = $uuid_bytes_read['bearing'];
- $sensor_data_array['acc'] = $uuid_bytes_read['acc'];
- //$sensor_data_array = print_r($uuid_bytes_read, true);
- array_push($atom_structure['sensor_data']['data_type']['gps_data'], $sensor_data_array);
- //array_push($debug_structure['debug_items'], $uuid_bytes_read['timestamp']);
- break;
- case 6:
- $atom_structure['sensor_data']['data_type']['rotation_count']++;
- $uuid_bytes_read = unpack('cmode/Jtimestamp/Grotx/Groty/Grotz/x*', $sensor_data_content);
- $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
- $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
- $sensor_data_array['rotx'] = $uuid_bytes_read['rotx'];
- $sensor_data_array['roty'] = $uuid_bytes_read['roty'];
- $sensor_data_array['rotz'] = $uuid_bytes_read['rotz'];
- array_push($atom_structure['sensor_data']['data_type']['rotation_data'], $sensor_data_array);
- break;
- default:
- $atom_structure['sensor_data']['data_type']['unknown_count']++;
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case '0537cdab-9d0c-4431-a72a-fa561f2a113e': // Exif - http://fileformats.archiveteam.org/wiki/Exif
+ case '2c4c0100-8504-40b9-a03e-562148d6dfeb': // Photoshop Image Resources - http://fileformats.archiveteam.org/wiki/Photoshop_Image_Resources
+ case '33c7a4d2-b81d-4723-a0ba-f1a3e097ad38': // IPTC-IIM - http://fileformats.archiveteam.org/wiki/IPTC-IIM
+ case '8974dbce-7be7-4c51-84f9-7148f9882554': // PIFF Track Encryption Box - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format
+ case '96a9f1f1-dc98-402d-a7ae-d68e34451809': // GeoJP2 World File Box - http://fileformats.archiveteam.org/wiki/GeoJP2
+ case 'a2394f52-5a9b-4f14-a244-6c427c648df4': // PIFF Sample Encryption Box - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format
+ case 'b14bf8bd-083d-4b43-a5ae-8cd7d5a6ce03': // GeoJP2 GeoTIFF Box - http://fileformats.archiveteam.org/wiki/GeoJP2
+ case 'd08a4f18-10f3-4a82-b6c8-32d8aba183d3': // PIFF Protection System Specific Header Box - http://fileformats.archiveteam.org/wiki/Protected_Interoperable_File_Format
+ $this->warning('Unhandled (but recognized) "uuid" atom identified by "'.$atom_structure['uuid_field_id'].'" at offset '.$atom_structure['offset'].' ('.strlen($atom_data).' bytes)');
+ break;
+
+ case 'be7acfcb-97a9-42e8-9c71-999491e3afac': // XMP data (in XML format)
+ $atom_structure['xml'] = substr($atom_data, 16, strlen($atom_data) - 16 - 8); // 16 bytes for UUID, 8 bytes header(?)
+ break;
+
+ case 'efe1589a-bb77-49ef-8095-27759eb1dc6f': // 360fly data
+ /* 360fly code in this block by Paul Lewis 2019-Oct-31 */
+ /* Sensor Timestamps need to be calculated using the recordings base time at ['quicktime']['moov']['subatoms'][0]['creation_time_unix']. */
+ $atom_structure['title'] = '360Fly Sensor Data';
+
+ //Get the UUID HEADER data
+ $uuid_bytes_read = unpack('vheader_size/vheader_version/vtimescale/vhardware_version/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/', substr($atom_data, 16, 32));
+ $atom_structure['uuid_header'] = $uuid_bytes_read;
+
+ $start_byte = 48;
+ $atom_SENSOR_data = substr($atom_data, $start_byte);
+ $atom_structure['sensor_data']['data_type'] = array(
+ 'fusion_count' => 0, // ID 250
+ 'fusion_data' => array(),
+ 'accel_count' => 0, // ID 1
+ 'accel_data' => array(),
+ 'gyro_count' => 0, // ID 2
+ 'gyro_data' => array(),
+ 'magno_count' => 0, // ID 3
+ 'magno_data' => array(),
+ 'gps_count' => 0, // ID 5
+ 'gps_data' => array(),
+ 'rotation_count' => 0, // ID 6
+ 'rotation_data' => array(),
+ 'unknown_count' => 0, // ID ??
+ 'unknown_data' => array(),
+ 'debug_list' => '', // Used to debug variables stored as comma delimited strings
+ );
+ $debug_structure['debug_items'] = array();
+ // Can start loop here to decode all sensor data in 32 Byte chunks:
+ foreach (str_split($atom_SENSOR_data, 32) as $sensor_key => $sensor_data) {
+ // This gets me a data_type code to work out what data is in the next 31 bytes.
+ $sensor_data_type = substr($sensor_data, 0, 1);
+ $sensor_data_content = substr($sensor_data, 1);
+ $uuid_bytes_read = unpack('C*', $sensor_data_type);
+ $sensor_data_array = array();
+ switch ($uuid_bytes_read[1]) {
+ case 250:
+ $atom_structure['sensor_data']['data_type']['fusion_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
+ $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
+ $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
+ array_push($atom_structure['sensor_data']['data_type']['fusion_data'], $sensor_data_array);
+ break;
+ case 1:
+ $atom_structure['sensor_data']['data_type']['accel_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
+ $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
+ $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
+ array_push($atom_structure['sensor_data']['data_type']['accel_data'], $sensor_data_array);
+ break;
+ case 2:
+ $atom_structure['sensor_data']['data_type']['gyro_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['yaw'] = $uuid_bytes_read['yaw'];
+ $sensor_data_array['pitch'] = $uuid_bytes_read['pitch'];
+ $sensor_data_array['roll'] = $uuid_bytes_read['roll'];
+ array_push($atom_structure['sensor_data']['data_type']['gyro_data'], $sensor_data_array);
+ break;
+ case 3:
+ $atom_structure['sensor_data']['data_type']['magno_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Gmagx/Gmagy/Gmagz/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['magx'] = $uuid_bytes_read['magx'];
+ $sensor_data_array['magy'] = $uuid_bytes_read['magy'];
+ $sensor_data_array['magz'] = $uuid_bytes_read['magz'];
+ array_push($atom_structure['sensor_data']['data_type']['magno_data'], $sensor_data_array);
+ break;
+ case 5:
+ $atom_structure['sensor_data']['data_type']['gps_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Glat/Glon/Galt/Gspeed/nbearing/nacc/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['lat'] = $uuid_bytes_read['lat'];
+ $sensor_data_array['lon'] = $uuid_bytes_read['lon'];
+ $sensor_data_array['alt'] = $uuid_bytes_read['alt'];
+ $sensor_data_array['speed'] = $uuid_bytes_read['speed'];
+ $sensor_data_array['bearing'] = $uuid_bytes_read['bearing'];
+ $sensor_data_array['acc'] = $uuid_bytes_read['acc'];
+ array_push($atom_structure['sensor_data']['data_type']['gps_data'], $sensor_data_array);
+ //array_push($debug_structure['debug_items'], $uuid_bytes_read['timestamp']);
+ break;
+ case 6:
+ $atom_structure['sensor_data']['data_type']['rotation_count']++;
+ $uuid_bytes_read = unpack('cmode/Jtimestamp/Grotx/Groty/Grotz/x*', $sensor_data_content);
+ $sensor_data_array['mode'] = $uuid_bytes_read['mode'];
+ $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
+ $sensor_data_array['rotx'] = $uuid_bytes_read['rotx'];
+ $sensor_data_array['roty'] = $uuid_bytes_read['roty'];
+ $sensor_data_array['rotz'] = $uuid_bytes_read['rotz'];
+ array_push($atom_structure['sensor_data']['data_type']['rotation_data'], $sensor_data_array);
+ break;
+ default:
+ $atom_structure['sensor_data']['data_type']['unknown_count']++;
+ break;
+ }
+ }
+ //if (isset($debug_structure['debug_items']) && count($debug_structure['debug_items']) > 0) {
+ // $atom_structure['sensor_data']['data_type']['debug_list'] = implode(',', $debug_structure['debug_items']);
+ //} else {
+ $atom_structure['sensor_data']['data_type']['debug_list'] = 'No debug items in list!';
+ //}
+ break;
+
+ default:
+ $this->warning('Unhandled "uuid" atom identified by "'.$atom_structure['uuid_field_id'].'" at offset '.$atom_structure['offset'].' ('.strlen($atom_data).' bytes)');
</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 (isset($debug_structure['debug_items']) && count($debug_structure['debug_items']) > 0) {
-// $atom_structure['sensor_data']['data_type']['debug_list'] = implode(',', $debug_structure['debug_items']);
-// } else {
- $atom_structure['sensor_data']['data_type']['debug_list'] = 'No debug items in list!';
-// }
</del><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 'gps ':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1949,7 +2003,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> case 'thma': // subatom to "frea" -- "ThumbnailImage"
</span><span class="cx" style="display: block; padding: 0 10px"> // https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea
</span><span class="cx" style="display: block; padding: 0 10px"> if (strlen($atom_data) > 0) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'ThumbnailImage');
</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"> case 'scra': // subatom to "frea" -- "PreviewImage"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1956,10 +2010,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea
</span><span class="cx" style="display: block; padding: 0 10px"> // but the only sample file I've seen has no useful data here
</span><span class="cx" style="display: block; padding: 0 10px"> if (strlen($atom_data) > 0) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'PreviewImage');
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'cdsc': // timed metadata reference
+ // A QuickTime movie can contain none, one, or several timed metadata tracks. Timed metadata tracks can refer to multiple tracks.
+ // Metadata tracks are linked to the tracks they describe using a track-reference of type 'cdsc'. The metadata track holds the 'cdsc' track reference.
+ $atom_structure['track_number'] = getid3_lib::BigEndian2Int($atom_data);
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $this->warning('Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).'), '.$atomsize.' bytes at offset '.$baseoffset);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2000,6 +2059,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $atom_structure;
</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 (strlen($subatomdata) < ($subatomsize - 8)) {
+ // we don't have enough data to decode the subatom.
+ // this may be because we are refusing to parse large subatoms, or it may be because this atom had its size set too large
+ // so we passed in the start of a following atom incorrectly?
+ return $atom_structure;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $atom_structure[$subatomcounter++] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);
</span><span class="cx" style="display: block; padding: 0 10px"> $subatomoffset += $subatomsize;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2840,19 +2905,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($comment_key) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($comment_key == 'picture') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!is_array($data)) {
- $image_mime = '';
- if (preg_match('#^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A#', $data)) {
- $image_mime = 'image/png';
- } elseif (preg_match('#^\xFF\xD8\xFF#', $data)) {
- $image_mime = 'image/jpeg';
- } elseif (preg_match('#^GIF#', $data)) {
- $image_mime = 'image/gif';
- } elseif (preg_match('#^BM#', $data)) {
- $image_mime = 'image/bmp';
- }
- $data = array('data'=>$data, 'image_mime'=>$image_mime);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // already copied directly into [comments][picture] elsewhere, do not re-copy here
+ return true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $gooddata = array($data);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($comment_key == 'genre') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2860,7 +2914,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $gooddata = explode(';', $data);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($gooddata as $data) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (is_array($data) || (!empty($info['quicktime']['comments'][$comment_key]) && in_array($data, $info['quicktime']['comments'][$comment_key]))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!empty($info['quicktime']['comments'][$comment_key]) && in_array($data, $info['quicktime']['comments'][$comment_key], true)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // avoid duplicate copies of identical data
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2929,7 +2983,24 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $pascalstring
+ *
+ * @return string
+ */
+ public function MaybePascal2String($pascalstring) {
+ // Pascal strings have 1 unsigned byte at the beginning saying how many chars (1-255) are in the string
+ // Check if string actually is in this format or written incorrectly, straight string, or null-terminated string
+ if (ord(substr($pascalstring, 0, 1)) == (strlen($pascalstring) - 1)) {
+ return substr($pascalstring, 1);
+ } elseif (substr($pascalstring, -1, 1) == "\x00") {
+ // appears to be null-terminated instead of Pascal-style
+ return substr($pascalstring, 0, -1);
+ }
+ return $pascalstring;
+ }
</ins><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 class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Helper functions for m4b audiobook chapters
</span><span class="cx" style="display: block; padding: 0 10px"> * code by Steffen Hartmann 2015-Nov-08.
</span></span></pre></div>
<a id="trunksrcwpincludesID3moduleaudiovideoriffphp"></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.riff.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.riff.php 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio-video.riff.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,6 +23,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo Rewrite RIFF parser totally
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true);
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio.ac3.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_ac3 extends getid3_handler
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio.dts.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</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"> * @tutorial http://wiki.multimedia.cx/index.php?title=DTS
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio.flac.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,9 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio.mp3.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // number of frames to scan to determine if MPEG-audio sequence is valid
</span><span class="cx" style="display: block; padding: 0 10px"> // Lower this number to 5-20 for faster scanning
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.audio.ogg.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_ogg extends getid3_handler
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.tag.apetag.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,10 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> class getid3_apetag extends getid3_handler
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.tag.id3v1.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_id3v1 extends getid3_handler
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,26 +65,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($ParsedID3v1 as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ParsedID3v1['comments'][$key][0] = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // ID3v1 encoding detection hack START
- // ID3v1 is defined as always using ISO-8859-1 encoding, but it is not uncommon to find files tagged with ID3v1 using Windows-1251 or other character sets
- // Since ID3v1 has no concept of character sets there is no certain way to know we have the correct non-ISO-8859-1 character set, but we can guess
- $ID3v1encoding = 'ISO-8859-1';
- foreach ($ParsedID3v1['comments'] as $tag_key => $valuearray) {
- foreach ($valuearray as $key => $value) {
- if (preg_match('#^[\\x00-\\x40\\xA8\\xB8\\x80-\\xFF]+$#', $value)) {
- foreach (array('Windows-1251', 'KOI8-R') as $id3v1_bad_encoding) {
- if (function_exists('mb_convert_encoding') && @mb_convert_encoding($value, $id3v1_bad_encoding, $id3v1_bad_encoding) === $value) {
- $ID3v1encoding = $id3v1_bad_encoding;
- break 3;
- } elseif (function_exists('iconv') && @iconv($id3v1_bad_encoding, $id3v1_bad_encoding, $value) === $value) {
- $ID3v1encoding = $id3v1_bad_encoding;
- break 3;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $ID3v1encoding = $this->getid3->encoding_id3v1;
+ if ($this->getid3->encoding_id3v1_autodetect) {
+ // ID3v1 encoding detection hack START
+ // ID3v1 is defined as always using ISO-8859-1 encoding, but it is not uncommon to find files tagged with ID3v1 using Windows-1251 or other character sets
+ // Since ID3v1 has no concept of character sets there is no certain way to know we have the correct non-ISO-8859-1 character set, but we can guess
+ foreach ($ParsedID3v1['comments'] as $tag_key => $valuearray) {
+ foreach ($valuearray as $key => $value) {
+ if (preg_match('#^[\\x00-\\x40\\x80-\\xFF]+$#', $value) && !ctype_digit((string) $value)) { // check for strings with only characters above chr(128) and punctuation/numbers, but not just numeric strings (e.g. track numbers or years)
+ foreach (array('Windows-1251', 'KOI8-R') as $id3v1_bad_encoding) {
+ if (function_exists('mb_convert_encoding') && @mb_convert_encoding($value, $id3v1_bad_encoding, $id3v1_bad_encoding) === $value) {
+ $ID3v1encoding = $id3v1_bad_encoding;
+ $this->warning('ID3v1 detected as '.$id3v1_bad_encoding.' text encoding in '.$tag_key);
+ break 3;
+ } elseif (function_exists('iconv') && @iconv($id3v1_bad_encoding, $id3v1_bad_encoding, $value) === $value) {
+ $ID3v1encoding = $id3v1_bad_encoding;
+ $this->warning('ID3v1 detected as '.$id3v1_bad_encoding.' text encoding in '.$tag_key);
+ break 3;
+ }
</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="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // ID3v1 encoding detection hack END
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // ID3v1 encoding detection hack END
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // ID3v1 data is supposed to be padded with NULL characters, but some taggers pad with spaces
</span><span class="cx" style="display: block; padding: 0 10px"> $GoodFormatID3v1tag = $this->GenerateID3v1Tag(
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.tag.id3v2.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,9 @@
</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">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class getid3_id3v2 extends getid3_handler
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,14 +523,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (($this->getid3->info['id3v2']['majorversion'] == 3) && !preg_match('#[\x00]#', $genrestring)) {
</span><span class="cx" style="display: block; padding: 0 10px"> // note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here:
</span><span class="cx" style="display: block; padding: 0 10px"> // replace / with NULL, then replace back the two ID3v1 genres that legitimately have "/" as part of the single genre name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (preg_match('#/#', $genrestring)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (strpos($genrestring, '/') !== false) {
+ $LegitimateSlashedGenreList = array( // https://github.com/JamesHeinrich/getID3/issues/223
+ 'Pop/Funk', // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard
+ 'Cut-up/DJ', // Discogs - https://www.discogs.com/style/cut-up/dj
+ 'RnB/Swing', // Discogs - https://www.discogs.com/style/rnb/swing
+ 'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> $genrestring = str_replace('/', "\x00", $genrestring);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $genrestring = str_replace('Pop'."\x00".'Funk', 'Pop/Funk', $genrestring);
- $genrestring = str_replace('Rock'."\x00".'Rock', 'Folk/Rock', $genrestring);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ($LegitimateSlashedGenreList as $SlashedGenre) {
+ $genrestring = str_ireplace(str_replace('/', "\x00", $SlashedGenre), $SlashedGenre, $genrestring);
+ }
</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"> // some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal"
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (preg_match('#;#', $genrestring)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (strpos($genrestring, ';') !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $genrestring = str_replace(';', "\x00", $genrestring);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></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 2020-07-02 14:53:37 UTC (rev 48277)
+++ trunk/src/wp-includes/ID3/module.tag.lyrics3.php 2020-07-02 15:46:17 UTC (rev 48278)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,9 @@
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+ exit;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> class getid3_lyrics3 extends getid3_handler
</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">@@ -107,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GETID3_ERRORARRAY = &$info['warning'];
</span><span class="cx" style="display: block; padding: 0 10px"> getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_temp = new getID3();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $getid3_temp->openfile($this->getid3->filename);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
</ins><span class="cx" style="display: block; padding: 0 10px"> $getid3_apetag = new getid3_apetag($getid3_temp);
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
</span><span class="cx" style="display: block; padding: 0 10px"> $getid3_apetag->Analyze();
</span></span></pre>
</div>
</div>
</body>
</html>