Skip to content

Commit

Permalink
Merge pull request #254 from StudioMaX/2.0-with-1.9.20
Browse files Browse the repository at this point in the history
Sync 2.0 with 1.9.20-202006061653
  • Loading branch information
StudioMaX authored Jul 21, 2020
2 parents 8cf765e + 6d7b77b commit 5515a2d
Show file tree
Hide file tree
Showing 65 changed files with 1,996 additions and 804 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
/.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/.phpcs.xml export-ignore
/.travis.yml export-ignore
Doxyfile export-ignore
/composer.json export-ignore
/.phpcs.xml export-ignore
Doxyfile export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/phpstan.neon export-ignore
21 changes: 10 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
language: php
sudo: false

cache:
directories:
- $HOME/.composer/cache/files

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

matrix:
include:
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
env: PHPSTAN=1
- php: 7.4

before_script:
- travis_retry composer install --prefer-source --quiet --no-interaction
- if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.9; fi
- if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.12; fi

script:
- vendor/bin/phpunit
Expand Down
Binary file removed bin/md5sum.exe
Binary file not shown.
8 changes: 3 additions & 5 deletions bin/readme.helperapps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ Taken from http://www.cygwin.com/

Taken from http://unxutils.sourceforge.net/
* head.exe
* md5sum.exe
* tail.exe

Taken from http://ebible.org/mpj/software.htm
* sha1sum.exe

Taken from http://www.vorbis.com/download.psp
* vorbiscomment.exe
Expand All @@ -54,3 +49,6 @@ Changelog:

2003.12.29:
* Initial release

2019.07.24:
* Remove obsolete md5sum.exe, sha1sum.exe, tail.exe
Binary file removed bin/sha1sum.exe
Binary file not shown.
Binary file removed bin/tail.exe
Binary file not shown.
52 changes: 52 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,58 @@
Version History
===============

1.9.20: [2020-06-30] James Heinrich :: 1.9.20-202006061653
» add support for DSDIFF audio
» add support for TAK lossess audio
» add support for IVF video
» add detection support for EPUB files
» add detection support for HPK archives
» add demo.mysqli.php, remove demo.mysql.php
¤ QuickTime.uuid now returned as an array (may contain multiple entries)
¤ improved PDF support, including page count
* bugfix (G:247) array_min incorrect return value
* bugfix (G:242) filepointer analysis errors
* bugfix (G:238) comments_html may not match comments
* bugfix (G:235) prevent disclosing paths when accessing modules directly
* bugfix (G:233) Quicktime duplicate attached images
* bugfix (G:229) Quicktime timestamps easy access
* bugfix (G:228) master.zip did not contain demos
* bugfix (G:227) Quicktime check subatoms data length
* bugfix (G:226) uuid parsing based on UUID
* bugfix (G:225) use comments_html content already generated by modules
* bugfix (G:223) ID3v2 slashed genre names
* bugfix (G:222) demo.browse filesystem character encoding
* bugfix (G:221) option_tags_html=false ignored
* bugfix (G:219) Quicktime.UUID now parsed more discriminately for XML and other data types
* bugfix (G:218) QuickTime not copying covr to comments
* bugfix (G:217) mp3 array offsets of type bool
* bugfix (G:216) ID3v2.write allow WMP rating in POPM
* bugfix (G:210) PHP 7.4 deprecated get_magic_quotes
* bugfix: Quicktime detect null-terminated strings used where Pascal strings should be
* bugfix: Quicktime GPS uninitialized array keys

1.9.19: [2019-12-17] James Heinrich :: 1.9.19-201912131005
» add placeholder support for WTV (Windows Recorded TV Show)
* bugfix (G:210) PHP 7.4 deprecated get_magic_quotes
* bugfix (G:207) improved LAME version string parsing
* bugfix (G:206) inverted logic in CopyTagsToComments
* bugfix (G:203) use getimagesizefromstring if available
* Quicktime decode 'uuid' atom for 360fly cameras

1.9.18: [2019-07-24] James Heinrich :: 1.9.18-201907240906
* bugfix (G:198) use native hash functions instead of obsolete external binaries
* bugfix (G:194) PHP 7.4 compatibility: fix deprecated curly brace array access
* bugfix (G:191) unsupported operand types module.audio.ac3.php:763
* bugfix (G:189) false UTF-16 <BOM> and no termination strings
* bugfix (G:188) add support for DS2 v8
* bugfix (G:187) RIFF.WAVE.scot parsing
* bugfix (G:184) invalid regex pattern (ID3v1)
* bugfix (G:183) reduced information for GIF files with $option_extra_info=false
* bugfix (G:175) mp4 max buffer size
* bugfix (G:174) TIFF parsing improvements
* bugfix (G:121) trailing nulls in ID3v2 strings
* standardize "track" -> "track_number"

1.9.17: [2019-02-07] James Heinrich :: 1.9.17-201902071234
* bugfix (G:178) HandleAllTags should skip "picture"
* bugfix (G:177) error checking for reading more than PHP memory_limit
Expand Down
2 changes: 1 addition & 1 deletion demos/demo.basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
metadata is all available in one location for all tag formats
metainformation is always available under [tags] even if this is not called
*/
GetID3\Utils::CopyTagsToComments($ThisFileInfo);
$getID3->CopyTagsToComments($ThisFileInfo);

/*
Output desired information in whatever format you want
Expand Down
27 changes: 16 additions & 11 deletions demos/demo.browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
define('GETID3_DEMO_BROWSE_ALLOW_MD5_LINK', false); // if enabled, shows "enable" link for MD5 hashes for file/data/source

$PageEncoding = 'UTF-8';

$FileSystemEncoding = ((GetID3\Utils::isWindows() && version_compare(PHP_VERSION, '7.1.0', '<')) ? 'Windows-1252' : 'UTF-8');
$writescriptfilename = 'demo.write.php';

// Needed for windows only. Leave commented-out to auto-detect, only define here if auto-detection does not work properly
Expand Down Expand Up @@ -75,7 +75,7 @@
if (isset($_REQUEST['filename'])) {

if (!file_exists($_REQUEST['filename']) || !is_file($_REQUEST['filename'])) {
die(GetID3\Utils::iconv_fallback('ISO-8859-1', $PageEncoding, $_REQUEST['filename'].' does not exist'));
die(GetID3\Utils::iconv_fallback($FileSystemEncoding, $PageEncoding, $_REQUEST['filename'].' does not exist'));
}
$starttime = microtime(true);

Expand All @@ -92,7 +92,7 @@
}


GetID3\Utils::CopyTagsToComments($ThisFileInfo);
$getID3->CopyTagsToComments($ThisFileInfo);

$listdirectory = dirname($_REQUEST['filename']);
$listdirectory = realpath($listdirectory); // get rid of /../../ references
Expand All @@ -106,7 +106,7 @@
if (preg_match('#^(ht|f)tp://#', $_REQUEST['filename'])) {
echo '<i>Cannot browse remote filesystems</i><br>';
} else {
echo 'Browse: <a href="'.htmlentities($_SERVER['PHP_SELF'].'?listdirectory='.urlencode($listdirectory), ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'">' . GetID3\Utils::iconv_fallback('ISO-8859-1', $PageEncoding, $listdirectory) . '</a><br>';
echo 'Browse: <a href="'.htmlentities($_SERVER['PHP_SELF'].'?listdirectory='.urlencode($listdirectory), ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'">' . GetID3\Utils::iconv_fallback($FileSystemEncoding, $PageEncoding, $listdirectory) . '</a><br>';
}

GetID3\Utils::ksort_recursive($ThisFileInfo);
Expand Down Expand Up @@ -172,7 +172,7 @@
$getID3->setOption(array('option_md5_data' => (isset($_REQUEST['ShowMD5']) && GETID3_DEMO_BROWSE_ALLOW_MD5_LINK)));
$fileinformation = $getID3->analyze($currentfilename);

GetID3\Utils::CopyTagsToComments($fileinformation);
$getID3->CopyTagsToComments($fileinformation);

$TotalScannedFilesize += (isset($fileinformation['filesize']) ? $fileinformation['filesize'] : 0);

Expand All @@ -196,6 +196,11 @@
if (isset($fileinformation['bitrate']) && ($fileinformation['bitrate'] > 0)) {
$TotalScannedBitrateFiles++;
}

} else {

echo '<div style="color: red;">Unknown filesystem entry: "'.htmlentities($currentfilename, ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'"</div>';

}
}
$endtime = microtime(true);
Expand All @@ -207,7 +212,7 @@
$columnsintable = 14;
echo '<table class="table" cellspacing="0" cellpadding="3">';

echo '<tr bgcolor="#'.$getID3checkColor_Head.'"><th colspan="'.$columnsintable.'">Files in ' . GetID3\Utils::iconv_fallback('ISO-8859-1', $PageEncoding, $currentfulldir) . '</th></tr>';
echo '<tr bgcolor="#'.$getID3checkColor_Head.'"><th colspan="'.$columnsintable.'">Files in ' . GetID3\Utils::iconv_fallback($FileSystemEncoding, $PageEncoding, $currentfulldir) . '</th></tr>';
$rowcounter = 0;
foreach ($DirectoryContents as $dirname => $val) {
if (isset($DirectoryContents[$dirname]['dir']) && is_array($DirectoryContents[$dirname]['dir'])) {
Expand All @@ -227,8 +232,7 @@
echo '"> <input type="submit" value="Go">';
echo '</form></td>';
} else {
//$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, $PageEncoding); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, 'ISO-8859-1'); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, $FileSystemEncoding); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = ($escaped_filename ? $escaped_filename : rawurlencode($filename));
echo '<td colspan="'.$columnsintable.'"><a href="'.htmlentities($_SERVER['PHP_SELF'].'?listdirectory='.urlencode($dirname.$filename), ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'"><b>'.$escaped_filename.'</b></a></td>';
}
Expand Down Expand Up @@ -261,8 +265,7 @@
uksort($DirectoryContents[$dirname]['known'], 'MoreNaturalSort');
foreach ($DirectoryContents[$dirname]['known'] as $filename => $fileinfo) {
echo '<tr bgcolor="#'.(($rowcounter++ % 2) ? $getID3checkColor_FileDark : $getID3checkColor_FileLight).'">';
//$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, $PageEncoding); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, 'ISO-8859-1'); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = htmlentities($filename, ENT_SUBSTITUTE, $FileSystemEncoding); // do filesystems always return filenames in ISO-8859-1?
$escaped_filename = ($escaped_filename ? $escaped_filename : rawurlencode($filename));
echo '<td><a href="'.htmlentities($_SERVER['PHP_SELF'].'?filename='.urlencode($dirname.$filename), ENT_QUOTES | ENT_SUBSTITUTE, $PageEncoding).'" title="View detailed analysis">'.$escaped_filename.'</a></td>';
echo '<td align="right">&nbsp;'.number_format($fileinfo['filesize']).'</td>';
Expand Down Expand Up @@ -449,7 +452,9 @@ function string_var_dump($variable) {
return $dumpedvariable;
}

function table_var_dump($variable, $wrap_in_td=false, $encoding='ISO-8859-1') {
function table_var_dump($variable, $wrap_in_td=false, $encoding='') {
global $FileSystemEncoding;
$encoding = ($encoding ? $encoding : $FileSystemEncoding);
$returnstring = '';
switch (gettype($variable)) {
case 'array':
Expand Down
21 changes: 2 additions & 19 deletions demos/demo.mp3header.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ function ID3v1matchesID3v2($id3v1, $id3v2) {
if (trim($id3v1['genre']) != trim($id3v2['genre'])) {
return false;
}
if (isset($id3v1['track'])) {
if (!isset($id3v1['track']) || (trim($id3v1['track']) != trim($id3v2['track']))) {
if (isset($id3v1['track_number'])) {
if (!isset($id3v1['track_number']) || (trim($id3v1['track_number']) != trim($id3v2['track_number']))) {
return false;
}
if (trim($id3v1['comment']) != trim(substr($id3v2['comment'], 0, 28))) {
Expand Down Expand Up @@ -1080,23 +1080,6 @@ function CreateDeepArray($ArrayPath, $Separator, $Value) {
}
}

if (!function_exists('md5_file')) {
// Allan Hansen <[email protected]>
// md5_file() exists in PHP 4.2.0.
// The following works under UNIX only, but dies on windows
function md5_file($file) {
if (substr(php_uname(), 0, 7) == 'Windows') {
die('PHP 4.2.0 or newer required for md5_file()');
}

$file = str_replace('`', '\\`', $file);
if (preg_match("#^([0-9a-f]{32})[ \t\n\r]#i", `md5sum "$file"`, $r)) {
return $r[1];
}
return false;
}
}

if (!function_exists('md5_data')) {
// Allan Hansen <[email protected]>
// md5_data() - returns md5sum for a file from startuing position to absolute end position
Expand Down
Loading

0 comments on commit 5515a2d

Please sign in to comment.