Permalink
Browse files

v2.3 - Add support for m4a, m4p, m4v files.

-v2.3.
-Add support for m4a, m4p, and m4v input files.
  • Loading branch information...
zelon88 committed Oct 24, 2018
1 parent 3038159 commit 96593cc4318a590e892b5ea37114bf3fc6a0a592
Showing with 41 additions and 31 deletions.
  1. +7 −0 CHANGELOG.txt
  2. +6 −6 convertCore.php
  3. +3 −0 convertGui1.php
  4. +24 −24 sanitizeCore.php
  5. +1 −1 versionInfo.php
@@ -1,3 +1,10 @@
COMMIT 10/23/2018
v2.3 - Add support for m4a, m4p, m4v files.
-v2.3.
-Add support for m4a, m4p, and m4v input files.
--------------------
COMMIT 9/25/2018
v2.2 - Fix typos in comments.
@@ -51,7 +51,7 @@
// / -----------------------------------------------------------------------------------
// / The following code sets the global variables for the session.
$HRConvertVersion = 'v2.2';
$HRConvertVersion = 'v2.3';
$Date = date("m_d_y");
$Time = date("F j, Y, g:i a");
$JanitorFile = 'janitor.php';
@@ -75,7 +75,7 @@
$defaultApps = array('.', '..');
$RequiredDirs = array($ConvertDir0, $ConvertDir, $ConvertTemp, $ConvertTempDir0, $ConvertTempDir);
$RequiredIndexes = array($ConvertTemp, $ConvertTempDir0, $ConvertTempDir);
$DangerousFiles = array('js', 'php', 'html', 'css');
$DangerousFiles = array('js', 'php', 'html', 'css', 'phar');
$DangerousFiles1 = array('.', '..', 'index.php', 'index.html');
$ArchiveArray = array('zip', 'rar', 'tar', 'bz', 'gz', 'bz2', '7z', 'iso', 'vhd', 'vdi', 'tar.bz2', 'tar.gz');
$DearchiveArray = array('zip', 'rar', 'tar', 'bz', 'gz', 'bz2', '7z', 'iso', 'vhd');
@@ -85,13 +85,13 @@
$PresentationArray = array('ppt', 'xps', 'potx', 'potm', 'pot', 'ppa', 'odp');
$ImageArray = array('jpeg', 'jpg', 'png', 'bmp', 'gif');
$ImageArray1 = array('jpeg', 'jpg', 'png', 'bmp', 'gif');
$MediaArray = array('mp3', 'aac', 'oog', 'wma', 'mp2', 'flac');
$VideoArray = array('3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv', 'mov');
$MediaArray = array('mp3', 'aac', 'oog', 'wma', 'mp2', 'flac', 'm4a', 'm4p');
$VideoArray = array('3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv', 'mov', 'm4v');
$DrawingArray = array('svg', 'dxf', 'vdx', 'fig');
$ModelArray = array('3ds', 'obj', 'collada', 'off', 'ply', 'stl', 'ptx', 'dxf', 'u3d', 'vrml');
$convertArr = array('zip', 'rar', 'tar', 'bz', 'gz', 'bz2', '7z', 'iso', 'vhd', 'vdi', 'tar.bz2', 'tar.gz', 'txt', 'doc', 'docx', 'rtf', 'xls', 'xlsx', 'odf', 'ods',
'pptx', 'ppt', 'xps', 'potx', 'potm', 'pot', 'ppa', 'odp', 'jpeg', 'jpg', 'png', 'bmp', 'gif', 'pdf','mp3', 'mp4', 'mov', 'aac', 'oog', 'wma', 'mp2', 'flac',
'3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv', 'svg', 'dxf', 'vdx', 'fig', '3ds', 'obj', 'collada', 'off', 'ply', 'stl', 'ptx', 'dxf', 'u3d', 'vrml');
'pptx', 'ppt', 'xps', 'potx', 'potm', 'pot', 'ppa', 'odp', 'jpeg', 'jpg', 'png', 'bmp', 'gif', 'pdf','mp3', 'mp4', 'mov', 'aac', 'oog', 'wma', 'mp2', 'flac', 'm4a',
'3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv', 'svg', 'dxf', 'vdx', 'fig', '3ds', 'obj', 'collada', 'off', 'ply', 'stl', 'ptx', 'dxf', 'u3d', 'vrml', 'm4v', 'm4p');
$pdfWorkArr = array('pdf', 'jpg', 'jpeg', 'png', 'bmp', 'gif');
$imgArr = array('jpg', 'jpeg', 'png', 'bmp', 'gif');
$fileArray1 = array();
@@ -38,6 +38,8 @@
<li>Ogg</li>
<li>Wav</li>
<li>Wma</li>
<li>M4a</li>
<li>M4p</li>
</ol>
<strong>Video Formats</strong>
<ol>
@@ -49,6 +51,7 @@
<li>Mpeg</li>
<li>Wmv</li>
<li>Mov</li>
<li>M4v</li>
</ol>
<strong>Document Formats</strong>
<ol>
@@ -37,66 +37,66 @@
// / -----------------------------------------------------------------------------------
// / Sanitize the Token GET variable.
if (isset($_POST['Token1'])) {
$Token1 = str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['Token1']); }
$Token1 = str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['Token1']); }
if (isset($_POST['Token2'])) {
$Token2 = str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['Token2']); }
$Token2 = str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['Token2']); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / Sanitize the noGui GET variable to disable the descriptive header text.
// / Good for usage in a small iframe.
if (isset($_POST['noGui'])) {
$_GET = str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_GET['noGui']); }
$_GET = str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_GET['noGui']); }
// / -----------------------------------------------------------------------------------
// / Can be used to automatically download and install the latest HRConvert2 update from Github.
// / Will perform "AutoDownload", "AutoInstall", "AutoClean", and "CompatCheck" consecutively.
// / Accepts a value of '1' or 'true'.
// / ONLY ADMINISTRATORS CAN AUTO-UPDATE HRC2 !!!
if (isset($_POST['AutoUpdate'])) {
$AutoUpdatePOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['AutoUpdate']), ENT_QUOTES, 'UTF-8'); }
$AutoUpdatePOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['AutoUpdate']), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / Can be used to automatically download the latest HRConvert2 package from Github.
// / DOES NOT INSTALL OR REPLACE ANYTHING !!!
// / ONLY ADMINISTRATORS CAN DOWNLOAD HRC2 UPDATES !!!
if (isset($_POST['AutoDownload'])) {
$AutoDownloadPOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['AutoDownload']), ENT_QUOTES, 'UTF-8'); }
$AutoDownloadPOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['AutoDownload']), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / Can be used to automatically install an official HRC2 update package that was download manually.
// / WILL EXTRACT AND OVER-WRITE HRC2 SYSTEM FILES WITH ONES FROM /Resources/TEMP
if (isset($_POST['AutoInstall'])) {
$AutoInstallPOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['AutoInstall']), ENT_QUOTES, 'UTF-8'); }
$AutoInstallPOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['AutoInstall']), ENT_QUOTES, 'UTF-8'); }
// / Can be used to clean up the HRC2 temp directories and perform compatibility adjustments after a manual update.
// / ONLY ADMINISTRATORS CAN DOWNLOAD HRC2 UPDATES !!!
if (isset($_POST['AutoClean'])) {
$AutoCleanPOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['AutoClean']), ENT_QUOTES, 'UTF-8'); }
$AutoCleanPOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['AutoClean']), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / Can be used to automatically check for and repair compatibility bugs and known issues.
// / Accepts a value of '1' or 'true'.
if (isset($_POST['CheckCompatibility'])) {
$CheckCompatPOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['CheckCompatibility']), ENT_QUOTES, 'UTF-8'); }
$CheckCompatPOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['CheckCompatibility']), ENT_QUOTES, 'UTF-8'); }
if (isset($_POST['CheckCompat'])) {
$CheckCompatPOST = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['CheckCompat']), ENT_QUOTES, 'UTF-8'); }
$CheckCompatPOST = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['CheckCompat']), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / Can be used to download multiple files.
// / must specify download as a POST variable.
// / Must specify $_POST['filesToDownload'] as a string or an array of filenames in the CloudLoc.
if (isset($_POST['download'])) {
$download = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<'), '', $_POST['download']), ENT_QUOTES, 'UTF-8');
$download = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<'), '', $_POST['download']), ENT_QUOTES, 'UTF-8');
if (isset($_POST['filesToUpload'])) {
$_POST['filesToDownload'] = htmlentities(str_replace(str_split('\\/~#[](){};:$!#^&%@>*<"\''), '', $_POST['filesToDownload']), ENT_QUOTES, 'UTF-8');
$_POST['filesToDownload'] = htmlentities(str_replace(str_split('\\/~#[]{};:$!#^&%@>*<"\''), '', $_POST['filesToDownload']), ENT_QUOTES, 'UTF-8');
if (!is_array($_POST['filesToDownload'])) {
$_POST['filesToDownload'] = array($_POST['filesToDownload']);
$_POST['filesToDownload'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['filesToDownload']), ENT_QUOTES, 'UTF-8'); } } }
$_POST['filesToDownload'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['filesToDownload']), ENT_QUOTES, 'UTF-8'); } } }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -106,12 +106,12 @@
// / Must specify "archextension" and "userfilename" POST variables.
// / The filename should NOT contain an extension.
if (isset($_POST['archive'])) {
$_POST['archive'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['archive']), ENT_QUOTES, 'UTF-8');
$_POST['archive'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['archive']), ENT_QUOTES, 'UTF-8');
if (!is_array($_POST['filesToArchive'])) {
$_POST['filesToArchive'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['filesToArchive']), ENT_QUOTES, 'UTF-8');
$_POST['filesToArchive'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['filesToArchive']), ENT_QUOTES, 'UTF-8');
$_POST['filesToArchive'] = array($_POST['filesToArchive']);
$_POST['archextension'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['archextension']), ENT_QUOTES, 'UTF-8');
$_POST['userfilename'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['userfilename']), ENT_QUOTES, 'UTF-8'); } }
$_POST['archextension'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['archextension']), ENT_QUOTES, 'UTF-8');
$_POST['userfilename'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['userfilename']), ENT_QUOTES, 'UTF-8'); } }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -123,13 +123,13 @@
// / OPTIONAL: Audio Files Only. Specify either pure integer to select a bitrate or "auto" for automatic (no quotes) .
// / The userconvertfilename should NOT contain an extension.
if (isset($_POST['convertSelected'])) {
$_POST['convertSelected'] = str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['convertSelected']);
$_POST['convertSelected'] = str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['convertSelected']);
if (!is_array($_POST['convertSelected'])) {
$_POST['convertSelected'] = array($_POST['convertSelected']); }
$_POST['extension'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['extension']), ENT_QUOTES, 'UTF-8');
$_POST['userconvertfilename'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['userconvertfilename']), ENT_QUOTES, 'UTF-8');
$_POST['extension'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['extension']), ENT_QUOTES, 'UTF-8');
$_POST['userconvertfilename'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['userconvertfilename']), ENT_QUOTES, 'UTF-8');
if (isset($_POST['bitrate'])) {
$_POST['bitrate'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['bitrate']), ENT_QUOTES, 'UTF-8'); } }
$_POST['bitrate'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['bitrate']), ENT_QUOTES, 'UTF-8'); } }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -142,12 +142,12 @@
// / Method 1 is advanced. This is best for advanced format support and multi-page .pdf to document conversions.
// / Method 1 requires unoconv. If conversions fail make sure to run "unoconv -l" or "unoconv --listen" in a terminal window.
if (isset($_POST['pdfworkSelected'])) {
$_POST['pdfworkSelected'] = str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['pdfworkSelected']);
$_POST['pdfworkSelected'] = str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['pdfworkSelected']);
if (!is_array($_POST['pdfworkSelected'])) {
$_POST['pdfworkSelected'] = array($_POST['pdfworkSelected']); }
$_POST['pdfextension'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['pdfextension']), ENT_QUOTES, 'UTF-8');
$_POST['userpdfconvertfilename'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['userpdfconvertfilename']), ENT_QUOTES, 'UTF-8');
$_POST['method'] = htmlentities(str_replace(str_split('~#[](){};:$!#^&%@>*<"\''), '', $_POST['method']), ENT_QUOTES, 'UTF-8'); }
$_POST['pdfextension'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['pdfextension']), ENT_QUOTES, 'UTF-8');
$_POST['userpdfconvertfilename'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['userpdfconvertfilename']), ENT_QUOTES, 'UTF-8');
$_POST['method'] = htmlentities(str_replace(str_split('~#[]{};:$!#^&%@>*<"\''), '', $_POST['method']), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -1,4 +1,4 @@
<?php
// / This file contains the current HRConvert2 version for auto-update purposes.
$Version = 'v2.2';
$Version = 'v2.3';

0 comments on commit 96593cc

Please sign in to comment.