diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f83d4b1..fb1b0b0 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,48 @@
+COMMIT - 4/11/2020
+v2.7 - Improve sanitization per Issue #4.
+
+-v2.7.
+-Update documentation.
+ -Update installation docs to reflect latest PHP.
+ -Remove mySQL requirements.
+-Remove 'odf' support, change to 'odt' support.
+-Specifically define $URLEcho to fix undefined variable warnings.
+-Added $ShowGUI config variable for determining whether to show a full or minimal GUI.
+ -Detects if the variable is set and manually defines $_GET['noGUI'].
+ -Has the same function as $_GET['noGUI'].
+ -If users don't have this variable set in their config.php file then a full GUI will be shown.
+-HRConvert2 looks best when you use it in an iframe on your website.
+-Fixed some if/while/foreach statements not having whitespace before the opening '('.
+-Removed reference to $UserID in logs.
+-Verified that all PDFWork is capable of functioning.
+-Verified that all document conversions are capable of functioning.
+-Reworked the way archives are extracted & compressed.
+-Improved logging during dearchiving.
+-Added $ApplicationName & $ApplicationTitle config entries in config.php.
+ -If these are not set; defaults are used instead.
+-Upgraded to JQuery 3.6.0 from 3.3.1.
+ -Remove 3.3.1 & 3.1.0 legacy versions as they are no longer required.
+-Added $ShowFinePrint config entry to config.php for showing or hiding the TOS & PP links.
+ -If this is not set; a default is used instead.
+-Fixed noGUI mode so that the divs are centered & the produced HTML is valid.
+-Cleaned up some sloppy assignments in dearch/rearch code.
+-Move temporary archive location to ConvertDir from ConvertTempDir.
+-Improved consistency of UI elements.
+-Switched dearchive code from using the 7z e switch to the 7z x switch to preserve paths.
+-Fixed a bug in rar archive output paths.
+-Changed the rar archiving arguments from "rar a -ep " to "rar a -ep1 -r" to preserve folder structure.
+-Verified that all extraction / rearchiving operations work.
+-Remove $Thorough & $HighPerformanceAV from config.php as they were no longer applicable.
+-Reworked the way sanitizeCore.php converts strings into arrays.
+-Changed $VirusScan config entry default value from '1' to TRUE.
+ -The core will still recognize '1' as a valid entry to support legacy config files.
+-Remove tar.bz2 option from archiveAll menu.
+-Rework the way archiveAll feature is accomplished.
+-Improve logging consistencies.
+-Remove old iPhone code from index.html.
+ -This is easier to accomplish with screen size anyway.
+
+--------------------
COMMIT - 2/11/2020
v2.6 - Improve sanitization per Issue #4.
diff --git a/How_To_Install_HRConvert2.txt b/How_To_Install_HRConvert2.txt
index cbac228..3d58312 100644
--- a/How_To_Install_HRConvert2.txt
+++ b/How_To_Install_HRConvert2.txt
@@ -7,15 +7,15 @@ HRConvert2 requires a Debian Linux-based operating system w/3rd party audio lice
For this guide, it is assumed that the user is installing HRConvert2
on a PC which meets the above conditions. This guide will walk
a new user through the installation of HRConvert2 on a freshly installed
-version of Lubuntu 16.04 LTS with no pre-existing dependencies.
+version of Lubuntu 21.04 LTS with no pre-existing dependencies.
For a walkthrough of installing a Ubuntu distro, visit.....
http://www.ubuntu.com/download/desktop/install-ubuntu-desktop
IMPORTANT NOTE: During this guide we will be setting-up a fully
functional, yet somewhat customized, LAMP stack including
-linux, Apache2.4, MySQL, and PHP7.0. If you DO NOT want to have
-a LAMP stack installed on your local machine DO NOT install this software.
+linux, Apache2.4, and PHP8.0. If you DO NOT want to have
+a server stack installed on your local machine DO NOT install this software.
This software was designed to be run on a dedicated server setup for NAS
duties.
@@ -39,56 +39,59 @@ https://github.com/dwaaan/HRConvert2-Docker
-sudo apt-get install curl
--------------------------------------------------
------STEP 2 - INSTALL PHP7 & PLUGINS-----
--sudo apt-get install php libapache2-mod-php php-mysql
--sudo apt-get install php-all-dev
-**YOU MAY NEED TO CHANGE THE VERSIONS BELOW DEPENDING ON YOUR UBUNTU/PHP VERSION**
--sudo apt-get install php7.1-zip (Replace version number with whatever version you want)
--sudo apt-get install php7.1-gd (Replace version number with whatever version you want)
--sudo apt-get install php-curl
-**EDIT THE "php.ini" FILE LOCATED IN "/etc/php/7.1/apache2/php.ini"**
--sudo leafpad /etc/php/7.1/apache2/php.ini
-**SEARCH FOR AND MODIFY THE FOLLOWING VALUES CAREFULLY**
- max_execution_time = 90
- max_input_time = 90
- memory_limit = 512M
- ;Use 256 - 384M for Raspberry Pis
- display_errors = On
- ;Leave display errors = Off if you're not debugging HRConvert2 youself
- post_max_size = 3000M
- upload_max_filesize = 3000M
- max_file_uploads = 100
- zlib.output_compression = On
-**SAVE THE MODIFIED "php.ini" FILE AND EXIT LEAFPAD**
+-----STEP 2 - INSTALL FEATHERPAD, LIBREOFFICE, PHP & PLUGINS-----
+-sudo apt-get install featherpad && sudo apt-get install libreoffice-common && sudo apt-get install libreoffice-java-common && sudo apt-get install php libapache2-mod-php php-mysql && sudo apt-get install php-all-dev
+**YOU MAY NEED TO CHANGE THE PHP VERSIONS BELOW DEPENDING ON YOUR UBUNTU/PHP VERSION**
+-sudo apt-get install php8.0-zip && sudo apt-get install php8.0-gd && sudo apt-get install php-curl
+**EDIT THE "php.ini" FILE LOCATED IN "/etc/php/8.0/apache2/php.ini"**
+-sudo featherpad /etc/php/8.0/apache2/php.ini
+ **SEARCH FOR AND MODIFY THE FOLLOWING VALUES CAREFULLY**
+ max_execution_time = 90
+ max_input_time = 90
+ memory_limit = 512M
+ ;Use 256 - 384M for Raspberry Pis
+ display_errors = On
+ ;Leave display errors = Off if you're not debugging HRCloud2 youself
+ post_max_size = 3000M
+ upload_max_filesize = 3000M
+ max_file_uploads = 100
+ zlib.output_compression = On
+**SAVE THE MODIFIED "php.ini" FILE AND EXIT FEATHERPAD**
-sudo service apache2 restart
--------------------------------------------------
------STEP 4 - INSTALL BASIC FEATURE DEPENDENCIES-----
--sudo apt-get install clamav && sudo apt-get install libreoffice-common && sudo apt-get install unoconv && sudo apt-get install default-jre
+-----STEP 3 - INSTALL BASIC FEATURE DEPENDENCIES-----
+-sudo apt-get install clamav && sudo apt-get install unoconv && sudo apt-get install default-jre
-sudo chown -R www-data:www-data /var/www
--sudo leafpad /etc/rc.local
-**ADD THE FOLLOWING LINE TO THE "rc.local" FILE **ABOVE** THE "exit 0" LINE**
- /usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=$soffice_port;urp;" --nofirststartwizard &
-**IF YOU DO NOT HAVE AN rc.local FILE, COPY AND PASTE THE INCLUDED ONE**
+-sudo featherpad /etc/rc.local
+ **ADD THE FOLLOWING LINE TO THE "rc.local" FILE **ABOVE** THE "exit 0" LINE**
+ /usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=$soffice_port;urp;" --nofirststartwizard &
+**IF YOU DO NOT HAVE AN "rc.local" FILE, OR IF THE FILE IS BLANK THEN COPY AND PASTE THE INCLUDED ONE**
-sudo chmod +x /etc/rc.local
-sudo systemctl enable rc-local.service
--sudo apt-get install rar && sudo apt-get install unrar && sudo apt-get install p7zip-full && sudo apt-get install imagemagick && sudo apt-get install ffmpeg && sudo apt-get install tesseract-ocr && sudo apt-get install meshlab && sudo apt-get install dia && sudo apt-get install pandoc && sudo apt-get install poppler-utils
+**IF YOU GET ERRORS WHEN ENABLING THE SERVICE**
+ **COPY AND PASTE THE INCLUDED "rc-local.service" FILE TO "/etc/systemd/system/rc-local.service"**
+ **-sudo chmod +x /etc/rc.local**
+ **-sudo systemctl enable rc-local.service**
+-sudo apt-get install rar && sudo apt-get install unrar && sudo apt-get install p7zip-full && sudo apt-get install imagemagick && sudo apt-get install ffmpeg && sudo apt-get install tesseract-ocr && sudo apt-get install meshlab && sudo apt-get install dia && sudo apt-get install pandoc && sudo apt-get install poppler-utils && sudo apt-get install nodejs && sudo apt-get install winetricks
+-sudo apt install libnode-dev && sudo apt install node-gyp && sudo apt install npm && sudo apt-get install acpi
+-sudo npm install nativefier -g
**REBOOT THE SERVER**
**IF DOCUMENT CONVERSIONS DONT WORK...**
**-unoconv --listen**
**OR -unoconv -l**
**OR create a daemon to run unoconv --listen**
- **OR adjust the shebang at the top of /usr/bin/unoconv to #!/usr/bin/env python3
+**OR adjust the shebang at the top of /usr/bin/unoconv to #!/usr/bin/env python3
--------------------------------------------------
------STEP 5 - INSTALL HRConvert2-----
+-----STEP 4 - INSTALL HRConvert2-----
**CREATE A DIRECTORY IN "/var/www/html" NAMED "HRProprietary"**
**CREATE ANOTHER DIRECTORY IN "/var/www/html/HRProprietary" NAMED "HRConvert2"**
**VISIT "http://github.com/zelon88/HRConvert2" AND DOWNLOAD THE LATEST HRConvert2 .zip FILE
TO YOUR DOWNLOADS FOLDER**
**EXTRACT HRConvert2.zip TO YOUR DOWNLOADS FOLDER**
**COPY THE CONTENTS OF THE "HRConvert2-master" FOLDER TO "/var/www/html/HRProprietary/HRConvert2"*
--sudo leafpad /var/www/html/HRProprietary/HRConvert2/config.php
+-sudo featherpad /var/www/html/HRProprietary/HRConvert2/config.php
**CAREFULLY READ AND COMPLETELY FILL OUT THE CONFIG.PHP FILE!!!**
**HRConvert2 REQUIRES A SAFE LOCATION TO CREATE USER CONVERT DIRECTORIES. TO FACILITATE
THIS YOU MUST CREATE A !!!NEW!!! DIRECTORY AND ENTER IS AS THE "$ConvertLoc"**
@@ -113,13 +116,13 @@ IMPORTANT NOTE: If you need to correct permissions later, perform the following
-sudo chgrp -R www-data /var/www/html
--------------------------------------------------
------STEP 6 - VISIT YOUR CONVERTER!!!-----
+-----STEP 5 - VISIT YOUR CONVERTER!!!-----
Go to http://localhost/HRProprietary/HRConvert2/convertCore.php to view your Converter! The computer you install HRConvert2 onto
should be considered a staitionary server that you can safely point your "Static NAT" at and access from anywhere. To accomplish
these things, follow the additional steps below.
--------------------------------------------------
------STEP 7 - ADD FIREWALL EXCEPTIONS AND SETUP STATIC NAT ON YOUR ROUTER-----
+-----STEP 6 - ADD FIREWALL EXCEPTIONS AND SETUP STATIC NAT ON YOUR ROUTER-----
-According to the manual for the manufacturer of your broadband router, find the local IP address where you can make changes to it's
configuration. Try entering "192.168.1.1" into a browser. If you are greeted with a login screen, check the bottom of your router or your
system administrator for the required information. If you are not greeted with any tangible login screen other than an error message,
diff --git a/README.md b/README.md
index 6bcf700..03674c9 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ Supports specific bitrate through the API.
- Docx
- Txt
- Rtf
-- Odf
+- Odt
- Pdf
#### Spreadsheet Formats
- Xls
@@ -102,7 +102,7 @@ OCR Operations support the following output formats...
- Docx
- Txt
- Rtf
-- Odf
+- Odt
- Pdf
---
# Screenshots
diff --git a/Resources/jquery-3.6.0.min.js b/Resources/jquery-3.6.0.min.js
new file mode 100644
index 0000000..c4c6022
--- /dev/null
+++ b/Resources/jquery-3.6.0.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"
","
"],col:[2,"
","
"],tr:[2,"
","
"],td:[3,"
","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 ($Delete_Threshold * 60)) { // Time to keep files.
if (is_dir($DFilePath)) {
@@ -174,7 +173,7 @@ function cleanFiles($path) {
$now = time();
foreach ($DFiles as $DFile) {
if (in_array($DFile, $defaultApps)) continue;
- $DFilePath = $ConvertLoc.'/'.$DFile;
+ $DFilePath = $ConvertLoc.DIRECTORY_SEPARATOR.$DFile;
if ($now - fileTime($DFilePath) > ($Delete_Threshold * 60)) { // Time to keep files.
if (is_dir($DFilePath)) {
@chmod ($DFilePath, 0755);
@@ -198,25 +197,25 @@ function cleanFiles($path) {
// / -----------------------------------------------------------------------------------
// / The following code is performed when a user initiates a file upload.
-if(!empty($_FILES)) {
+if (!empty($_FILES)) {
$txt = ('OP-Act: Initiated Uploader on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
if (!is_array($_FILES['file']['name'])) $_FILES['file']['name'] = array($_FILES['file']['name']);
- foreach ($_FILES['file']['name'] as $key=>$file) {
+ foreach ($_FILES['file']['name'] as $key => $file) {
if ($file == '.' or $file == '..' or $file == 'index.html') continue;
foreach ($DangerousFiles as $DangerousFile) {
if (strpos($file, $DangerousFile) == TRUE) continue 2; }
$file = htmlentities(str_replace('..', '', str_replace(str_split('\\/[](){};:$!#^&%@>*<'), '', $file)), ENT_QUOTES, 'UTF-8');
$F0 = pathinfo($file, PATHINFO_EXTENSION);
if (in_array($F0, $DangerousFiles)) {
- $txt = ("ERROR!!! HRConvert2103, Unsupported file format, $F0 on $Time.");
+ $txt = ('ERROR!!! HRConvert2103, Unsupported file format, '.$F0.' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
echo nl2br($txt."\n");
continue; }
$F2 = pathinfo($file, PATHINFO_BASENAME);
- $F3 = str_replace('..', '', str_replace(' ', '_', str_replace('//', '/', $ConvertDir.'/'.$F2)));
- if($file == "") {
- $txt = ("ERROR!!! HRConvert2160, No file specified on $Time.");
+ $F3 = str_replace('..', '', str_replace(' ', '_', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.DIRECTORY_SEPARATOR.$F2)));
+ if ($file == "") {
+ $txt = ('ERROR!!! HRConvert2160, No file specified on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
echo nl2br($txt."\n");
die(); }
@@ -230,13 +229,11 @@ function cleanFiles($path) {
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
@chmod($F3, 0755);
// / The following code checks the Cloud Location with ClamAV after copying, just in case.
- if ($VirusScan == '1') {
- shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$F3.' | grep FOUND >> '.$ClamLogFile)));
+ if ($VirusScan or $VirusScan === '1') {
+ shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$F3.' | grep FOUND >> '.$ClamLogFile)));
$ClamLogFileDATA = @file_get_contents($ClamLogFile);
if (strpos($ClamLogFileDATA, 'Virus Detected') == 'true' or strpos($ClamLogFileDATA, 'FOUND') == 'true') {
- $txt = ('WARNING HRConvert2338, There were potentially infected files detected. The file
- transfer could not be completed at this time. Please check your file for viruses or
- try again later.'."\n");
+ $txt = ('WARNING HRConvert2338, There were potentially infected files detected. The file transfer could not be completed at this time. Please check your file for viruses or try again later.'."\n");
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
@unlink($F3);
die($txt); }
@@ -249,7 +246,7 @@ function cleanFiles($path) {
// / -----------------------------------------------------------------------------------
// / The following code is performed when a user downloads a selection of files.
if (isset($download)) {
- $download = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $download));
+ $download = trim(str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $download)), DIRECTORY_SEPARATOR);
$txt = ('OP-Act: Initiated Downloader with input '.$download.' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
if (!is_array($download)) $download = array($download);
@@ -258,15 +255,14 @@ function cleanFiles($path) {
if ($file == '.' or $file == '..' or $file == 'index.html') continue;
foreach ($DangerousFiles as $DangerousFile) {
if (strpos($file, $DangerousFile) == TRUE) continue 2; }
- $file1 = trim($file, '/');
- $file = $ConvertDir.'/'.$file;
+ $file = $ConvertDir.$file;
if (!file_exists($file) or $file == "") {
- $txt = ("ERROR!!! HRConvert2260, $file1 doesn't exist on $Time".'.');
+ $txt = ('ERROR!!! HRConvert2260, '.$file.' doesn\'t exist on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
echo ($txt."\n");
continue; }
$F2 = pathinfo($file, PATHINFO_BASENAME);
- $F3 = $ConvertTempDir.'/'.$F2;
+ $F3 = $ConvertTempDir.$F2;
if (file_exists($F3)) {
@touch($F3); }
if (!is_dir($file) or !file_exists($file)) {
@@ -286,98 +282,87 @@ function cleanFiles($path) {
else {
@symlink($item, $F4); } } } }
// / Free un-needed memory.
- $txt = $_POST['filesToDownload'] = $file = $file1 = $F2 = $F3 = $F4 = $COPY_TEMP = $iterator = $item = $MAKELogFile = null;
- unset ($txt, $_POST['filesToDownload'], $file, $file1, $F2, $F3, $F4, $COPY_TEMP, $iterator, $item, $MAKELogFile); }
+ $txt = $_POST['filesToDownload'] = $file = $F2 = $F3 = $F4 = $COPY_TEMP = $iterator = $item = $MAKELogFile = null;
+ unset ($txt, $_POST['filesToDownload'], $file, $F2, $F3, $F4, $COPY_TEMP, $iterator, $item, $MAKELogFile); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code is performed when a user selects files for archiving.
-if (isset($_POST['archive'])) {
- $txt = ('OP-Act: Initiated Archiver on '.$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+if (isset($_POST['filesToArchive'])) {
$_POST['archive'] = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['archive']));
if (!is_array($_POST['filesToArchive'])) {
- $_POST['filesToArchive'] = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['filesToArchive']));
$_POST['filesToArchive'] = array($_POST['filesToArchive']); }
- foreach ($_POST['filesToArchive'] as $key=>$TFile1) {
+ $txt = ('OP-Act: Initiated Archiver on '.$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ foreach ($_POST['filesToArchive'] as $key => $TFile1) {
$TFile1 = str_replace('..', '', str_replace(' ', '\ ', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $TFile1)));
- foreach ($DangerousFiles as $DangerousFile) {
- if (strpos($TFile1, $DangerousFile) == TRUE) continue 2; }
- $allowed = array('mov', 'mp4', 'mkv', 'flv', 'ogv', 'wmv', 'mpg', 'mpeg', 'm4v', '3gp', 'dat', 'cfg', 'txt', 'doc', 'docx', 'rtf', 'xls', 'xlsx', 'csv', 'ods', 'odf', 'odt', 'jpg', 'mp3',
- 'avi', 'wma', 'wav', 'ogg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw', 'zip', '7z', 'rar', 'tar', 'tar.gz', 'tar.bz2', 'iso', 'vhd');
+ foreach ($DangerousFiles as $DangerousFile) if (strpos($TFile1, $DangerousFile) == TRUE) continue 2;
+ $allowed = array('mov', 'mp4', 'mkv', 'flv', 'ogv', 'wmv', 'mpg', 'mpeg', 'm4v', '3gp', 'dat', 'cfg', 'txt', 'doc', 'docx', 'rtf', 'xls', 'xlsx', 'csv', 'ods', 'odt', 'odt', 'jpg', 'mp3', 'avi', 'wma', 'wav', 'ogg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw', 'zip', '7z', 'rar', 'tar', 'tar.gz', 'tar.bz2', 'iso', 'vhd');
$archarray = array('zip', '7z', 'rar', 'tar', 'tar.gz', 'tar.bz2', 'iso', 'vhd');
$rararr = array('rar');
$ziparr = array('zip');
$tararr = array('7z', 'tar', 'tar.gz', 'tar.bz2', 'iso', 'vhd');
- $filename = str_replace('..', '', str_replace('//', '/', $ConvertDir.$TFile1));
+ $filename = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$TFile1));
$filename1 = pathinfo($filename, PATHINFO_BASENAME);
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$_POST['archextension'] = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['archextension']));
$UserExt = $_POST['archextension'];
$_POST['userfilename'] = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userfilename']));
- $UserFileName = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $_POST['userfilename'])));
- $archSrc = str_replace('..', '', str_replace('//', '/', $ConvertTempDir.$TFile1));
- $archDst = str_replace('..', '', str_replace('//', '/', $ConvertDir.$UserFileName));
- if (!is_dir($filename)) {
- if(!in_array($ext, $allowed)) {
- echo nl2br("ERROR!!! HRConvert2290, Unsupported File Format\n");
- die(); } }
+ $UserFileName = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $_POST['userfilename'])));
+ $archSrc = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertTempDir.$TFile1));
+ $archDst = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$UserFileName));
+ if (!is_dir($filename)) if (!in_array($ext, $allowed)) {
+ $txt = ("ERROR!!! HRConvert2290, Unsupported File Format\n");
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ die($txt); }
// / Check the Cloud Location with ClamAV before archiving, just in case.
- if ($VirusScan == '1') {
- shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$archSrc.' | grep FOUND >> '.$ClamLogDir)));
- $ClamLogFileDATA = file_get_contents($ClamLogDir);
- if (strpos($ClamLogFileDATA, 'Virus Detected') == 'true' or strpos($ClamLogFileDATA, 'FOUND') == 'true') {
- $txt = ('Warning!!! HRConvert2338, There were potentially infected files detected. The file
- transfer could not be completed at this time. Please check your file for viruses or
- try again later.'."\n");
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- die($txt); } }
- // / Handle archiving of rar compatible files.
- if(in_array($UserExt, $rararr)) {
- copy ($filename, $ConvertTempDir.$TFile1);
- shell_exec('rar a -ep '.$archDst.' '.$archSrc);
- $txt = ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt in $CloudUsrDir on $Time".'.');
- echo nl2br ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt on $Time".'.'."\n".''."\n");
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
- // / Handle archiving of .zip compatible files.
- if(in_array($UserExt, $ziparr)) {
- copy ($filename, $ConvertTempDir.$TFile1);
- shell_exec('zip -j '.$archDst.'.zip '.$archSrc);
- $txt = ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt in $CloudUsrDir on $Time".'.');
- echo nl2br ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt on $Time".'.'."\n".''."\n");
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
- // / Handle archiving of 7zipper compatible files.
- if(in_array($UserExt, $tararr)) {
- copy ($filename, $ConvertTempDir.$TFile1);
- shell_exec('7z a '.$archDst.'.'.$UserExt.' '.$archSrc);
- $txt = ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt in $CloudUsrDir on $Time".'.');
- echo nl2br ('OP-Act: '."Archived $filename to $UserFileName".'.'."$UserExt on $Time".'.'."\n".''."\n");
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
- // / Free un-needed memory.
- $_POST['archive'] = $txt = $filesToArchive = $key = $TFile1 = $allowed = $archarray = $rararr = $ziparr = $tararr = $filename = $filename1
- = $ext = $_POST['archextension'] = $UserExt = $_POST['userfilename'] = $UserFileName = $archSrc = $archDst = $ClamLogFileDATA = $MAKELogFile = null;
- unset ($_POST['archive'], $filesToArchive, $key, $TFile1, $allowed, $archarray, $rararr, $ziparr, $tararr, $filename, $filename1, $ext,
- $_POST['archextension'], $UserExt, $_POST['userfilename'], $UserFileName, $archSrc, $archDst, $ClamLogFileDATA, $MAKELogFile); }
+ if ($VirusScan or $VirusScan === '1') {
+ shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$archSrc.' | grep FOUND >> '.$ClamLogFile)));
+ $ClamLogFileDATA = file_get_contents($ClamLogFile);
+ if (strpos($ClamLogFileDATA, 'Virus Detected') == 'true' or strpos($ClamLogFileDATA, 'FOUND') == 'true') {
+ $txt = ('Warning!!! HRConvert2338, There were potentially infected files detected. The file
+ transfer could not be completed at this time. Please check your file for viruses or
+ try again later.'."\n");
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ die($txt); } }
+ // / Handle archiving of rar compatible files.
+ if (in_array($UserExt, $rararr)) {
+ copy ($filename, $ConvertTempDir.$TFile1);
+ shell_exec('rar a -ep '.$archDst.' '.$archSrc); }
+ // / Handle archiving of .zip compatible files.
+ if (in_array($UserExt, $ziparr)) {
+ copy ($filename, $ConvertTempDir.$TFile1);
+ shell_exec('zip -j '.$archDst.'.zip '.$archSrc); }
+ // / Handle archiving of 7zipper compatible files.
+ if (in_array($UserExt, $tararr)) {
+ copy ($filename, $ConvertTempDir.$TFile1);
+ shell_exec('7z a '.$archDst.'.'.$UserExt.' '.$archSrc); }
+ $txt = ('OP-Act: Archived '.$filename.' to '.$ConvertTempDir.$TFile.' on '.$Time.'.');
+ echo nl2br ('OP-Act: '."Archived $filename to $ConvertTempDir.$TFile".' on '.$Time.'.'."\n".''."\n");
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
+ // / Free un-needed memory.
+ $_POST['archive'] = $txt = $filesToArchive = $key = $TFile1 = $allowed = $archarray = $rararr = $ziparr = $tararr = $filename = $filename1
+ = $ext = $_POST['archextension'] = $UserExt = $_POST['userfilename'] = $UserFileName = $archSrc = $archDst = $ClamLogFileDATA = $MAKELogFile = null;
+ unset ($_POST['archive'], $filesToArchive, $key, $TFile1, $allowed, $archarray, $rararr, $ziparr, $tararr, $filename, $filename1, $ext,
+ $_POST['archextension'], $UserExt, $_POST['userfilename'], $UserFileName, $archSrc, $archDst, $ClamLogFileDATA, $MAKELogFile); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code is performed when a user selects files to convert to other formats.
if (isset($_POST['convertSelected'])) {
- $_POST['convertSelected'] = str_replace('..', '', str_replace('//', '/', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['convertSelected'])));
+ $_POST['convertSelected'] = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['convertSelected'])));
$txt = ('OP-Act: Initiated HRConvert2 on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
if (!is_array($_POST['convertSelected'])) $_POST['convertSelected'] = array($_POST['convertSelected']);
foreach ($_POST['convertSelected'] as $key => $file) {
- $file = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $file));
+ $file = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $file));
foreach ($DangerousFiles as $DangerousFile) {
if (strpos($file, $DangerousFile) == TRUE) continue 2; }
- $txt = ('OP-Act: User '.$UserID.' selected to Convert file '.$file.'.');
+ $txt = ('OP-Act: User selected to Convert file '.$file.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- $allowed = array('svg', 'dxf', 'vdx', 'fig', '3ds', 'obj', 'collada', 'off', 'ply', 'stl', 'ptx', 'dxf', 'u3d', 'vrml', 'mov', 'mp4', 'mkv', 'flv', 'ogv', 'wmv', 'mpg', 'mpeg', 'm4v', '3gp', 'flac', 'aac', 'dat',
- 'cfg', 'txt', 'doc', 'docx', 'rtf' ,'xls', 'xlsx', 'ods', 'odf', 'odt', 'jpg', 'mp3', 'zip', 'rar', 'tar', 'tar.gz', 'tar.bz', 'tar.bZ2', '3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv',
- 'avi', 'aac', 'mp2', 'wma', 'wav', 'ogg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw', 'iso', 'vhd', 'vdi', 'pages', 'pptx', 'ppt', 'xps', 'potx', 'pot', 'ppa', 'ppa', 'odp');
- $file1 = str_replace('..', '', str_replace('//', '/', $ConvertDir.$file));
- $file2 = str_replace('..', '', str_replace('//', '/', $ConvertTempDir.$file));
+ $allowed = array('svg', 'dxf', 'vdx', 'fig', '3ds', 'obj', 'collada', 'off', 'ply', 'stl', 'ptx', 'dxf', 'u3d', 'vrml', 'mov', 'mp4', 'mkv', 'flv', 'ogv', 'wmv', 'mpg', 'mpeg', 'm4v', '3gp', 'flac', 'aac', 'dat', 'cfg', 'txt', 'doc', 'docx', 'rtf' ,'xls', 'xlsx', 'ods', 'odt', 'odt', 'jpg', 'mp3', 'zip', 'rar', 'tar', 'tar.gz', 'tar.bz', 'tar.bZ2', '3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv', 'avi', 'aac', 'mp2', 'wma', 'wav', 'ogg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw', 'iso', 'vhd', 'vdi', 'pages', 'pptx', 'ppt', 'xps', 'potx', 'pot', 'ppa', 'ppa', 'odp');
+ $file1 = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$file));
+ $file2 = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertTempDir.$file));
copy($file1, $file2);
if (file_exists($file2)) {
$txt = ('OP-Act: '."Copied $file1 to $file2 on $Time".'.');
@@ -389,13 +374,13 @@ function cleanFiles($path) {
Please rename your file or try again later.'."\n"); }
$convertcount = 0;
$extension = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['extension']));
- $pathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertTempDir.$file)));
- $oldPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertDir.$file)));
+ $pathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertTempDir.$file)));
+ $oldPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$file)));
$filename = pathinfo($pathname, PATHINFO_FILENAME);
$oldExtension = pathinfo($pathname, PATHINFO_EXTENSION);
- $newFile = str_replace('..', '', str_replace('//', '/', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userconvertfilename'].'.'.$extension)));
- $newPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertDir.$newFile)));
- $docarray = array('txt', 'doc', 'xls', 'xlsx', 'docx', 'rtf', 'odf', 'ods', 'odt', 'dat', 'cfg', 'pages', 'pptx', 'ppt', 'xps', 'potx', 'pot', 'ppa', 'odp', 'odf');
+ $newFile = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userconvertfilename'].'.'.$extension)));
+ $newPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$newFile)));
+ $docarray = array('txt', 'doc', 'xls', 'xlsx', 'docx', 'rtf', 'ods', 'odt', 'dat', 'cfg', 'pages', 'pptx', 'ppt', 'xps', 'potx', 'pot', 'ppa', 'odp', 'odt');
$imgarray = array('jpg', 'jpeg', 'bmp', 'png', 'gif');
$audioarray = array('mp3', 'wma', 'wav', 'ogg', 'mp2', 'flac', 'aac');
$videoarray = array('3gp', 'mkv', 'avi', 'mp4', 'flv', 'mpeg', 'wmv');
@@ -411,15 +396,12 @@ function cleanFiles($path) {
$arraytaro = array('tar.gz', 'tar.bz2', 'tar');
$arrayraro = array('rar',);
$abwstd = array('doc', 'abw');
- $abwuno = array('docx', 'pdf', 'txt', 'rtf', 'odf', 'dat', 'cfg');
- // / Code to increment the conversion in the event that an output file already exists.
- while(file_exists($newPathname)) {
+ $abwuno = array('docx', 'pdf', 'txt', 'rtf', 'odt', 'dat', 'cfg');
+ // / Code to increment the conversion in the event that an output file already exists.
+ while (file_exists($newPathname)) {
$newFile = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userconvertfilename'].'.'.$extension));
$newPathname = $ConvertDir.$newFile; }
// / Code to convert document files.
- // / Note: Some servers may experience a delay between the script finishing and the
- // / converted file being placed into their Cloud drive. If your files do not immediately
- // / appear, simply refresh the page.
if (in_array($oldExtension, $docarray)) {
// / The following code performs several compatibility checks before copying or converting anything.
if (!file_exists('/usr/bin/unoconv')) {
@@ -440,20 +422,20 @@ function cleanFiles($path) {
$txt = ('OP-Act, The document conversion engine PID is '.$DocEnginePID[0]);
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
$txt = ("OP-Act, Executing \"unoconv -o $newPathname -f $extension $pathname\" on ".$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
exec("unoconv -o $newPathname -f $extension $pathname", $returnDATA);
if (!is_array($returnDATA)) {
$txt = ('OP-Act, Unoconv returned '.$returnDATA.' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
if (is_array($returnDATA)) {
$txt = ('OP-Act, Unoconv returned the following on '.$Time.':');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
- foreach($returnDATA as $returnDATALINE) {
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
+ foreach ($returnDATA as $returnDATALINE) {
$txt = ($returnDATALINE);
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
// / For some reason files take a moment to appear after being created with Unoconv.
$stopper = 0;
- while(!file_exists($newPathname)) {
+ while (!file_exists($newPathname)) {
exec("unoconv -o $newPathname -f $extension $pathname");
$stopper++;
if ($stopper == 10) {
@@ -496,7 +478,7 @@ function cleanFiles($path) {
if (isset($_POST['bitrate'])) {
$bitrate = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['bitrate'])); }
if (!isset($_POST['bitrate'])) {
- $bitrate = 'auto'; }
+ $bitrate = 'auto'; }
if ($bitrate = 'auto') {
$br = ' '; }
elseif ($bitrate != 'auto' ) {
@@ -504,87 +486,67 @@ function cleanFiles($path) {
$txt = ("OP-Act, Executing \"ffmpeg -i $pathname$ext$br$newPathname\" on ".$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
shell_exec("ffmpeg -y -i $pathname$ext$br$newPathname"); }
- // / Code to detect and extract an archive, and then re-archive the extracted
- // / files using a different method.
+ // / Code to detect and extract an archive.
if (in_array($oldExtension, $archarray)) {
- $safedir1 = $ConvertTempDir;
- $safedirTEMP = $ConvertTempDir.$filename;
- $safedirTEMP2 = pathinfo($safedirTEMP, PATHINFO_EXTENSION);
- $safedirTEMP3 = $ConvertTempDir.pathinfo($safedirTEMP, PATHINFO_BASENAME);
- $safedir2 = $ConvertTempDir.$safedirTEMP3;
+ $safedir2 = $ConvertDir.$filename;
+ $safedir3 = $safedir2.'.7z';
+ $safedir4 = $safedir2.'.zip';
+ // / Create a folder to contain extracted files.
mkdir("$safedir2", 0755);
- $safedir3 = ($safedir2.'.7z');
- $safedir4 = ($safedir2.'.zip');
- if(in_array($oldExtension, $arrayzipo)) {
- shell_exec("unzip $pathname -d $safedir2"); }
- if(in_array($oldExtension, $array7zo)) {
- shell_exec("7z e $pathname -o$safedir2"); }
- if(in_array($oldExtension, $array7zo2)) {
- shell_exec("7z e $pathname -o$safedir2"); }
- if(in_array($oldExtension, $arrayraro)) {
- shell_exec("unrar e $pathname $safedir2"); }
- if(in_array($oldExtension, $arraytaro)) {
- shell_exec("7z e $pathname -o$safedir2"); }
- if (in_array($extension,$array7zo)) {
- $txt = ("OP-Act, Executing \"7z a -t$extension $safedir3 $safedir2\" on ".$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- shell_exec('7z a -t'.$extension.' '.$safedir3.' '.$safedir2);
- copy($safedir3, $newPathname); }
- if (file_exists($safedir3)) {
- @chmod($safedir3, 0755);
- @unlink($safedir3);
+ // / Code to Extract the selected archive using 7z.
+ // / The code exists so we can change extraction methods granularly.
+ if (in_array($oldExtension, $arrayzipo)) {
+ shell_exec("7z x $pathname -o$safedir2"); }
+ if (in_array($oldExtension, $array7zo)) {
+ shell_exec("7z x $pathname -o$safedir2"); }
+ if (in_array($oldExtension, $array7zo2)) {
+ shell_exec("7z x $pathname -o$safedir2"); }
+ if (in_array($oldExtension, $arrayraro)) {
+ shell_exec("7z x $pathname -o$safedir2"); }
+ if (in_array($oldExtension, $arraytaro)) {
+ shell_exec("7z x $pathname -o$safedir2"); }
+ $txt = ("OP-Act, Executing \"7z x $pathname -o$safedir2\" on ".$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ // / Code to rearchive files using 7z.
+ if (in_array($extension,$array7zo)) {
+ $txt = ("OP-Act, Executing \"7z a -t$extension $safedir3 $safedir2\" on ".$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ shell_exec('7z a -t'.$extension.' '.$safedir3.' '.$safedir2);
+ copy($safedir3, $newPathname);
+ // / Code to cleanup temporary files created using 7z.
+ if (file_exists($safedir3)) {
+ @chmod($safedir3, 0755);
+ @unlink($safedir3); } }
+ // / Code to rearchive files using zip.
+ if (in_array($extension,$arrayzipo)) {
+ $txt = ("OP-Act, Executing \"zip -r -j $safedir4 $safedir2\" on ".$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ shell_exec('zip -r -j '.$safedir4.' '.$safedir2);
+ @copy($safedir4, $newPathname);
+ // / Code to cleanup temporary files created using zip.
+ if (file_exists($safedir4)) {
+ @chmod($safedir4, 0755);
+ @unlink($safedir4); } }
+ // / Code to rearachive files using tar.
+ if (in_array($extension, $arraytaro)) {
+ $txt = ("OP-Act, Executing \"tar -cjf '.$newPathname -C $safedir2 ".'. on '.$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ shell_exec('tar -cjf '.$newPathname.' -C '.$safedir2.' .'); }
+ // / Code to rearchive files using rar.
+ if (in_array($extension, $arrayraro)) {
+ $txt = ("OP-Act, Executing \"rar a -ep1 -r $newPathname $safedir2\" on ".$Time.'.');
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
+ shell_exec('rar a -ep1 -r '.$newPathname.' '.$safedir2); }
+ // / Code to clean up temporary files & directories.
$delFiles = glob($safedir2 . '/*');
- foreach($delFiles as $delFile) {
- if(is_file($delFile) ) {
- @chmod($delFile, 0755);
+ foreach ($delFiles as $delFile) {
+ if (is_file($delFile)) {
+ @chmod($delFile, 0755);
@unlink($delFile); }
- elseif(is_dir($delFile) ) {
+ elseif (is_dir($delFile)) {
@chmod($delFile, 0755);
- @rmdir($delFile); } }
- @rmdir($safedir2); }
- elseif (in_array($extension,$arrayzipo)) {
- $txt = ("OP-Act, Executing \"zip -r -j $safedir4 $safedir2\" on ".$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- shell_exec('zip -r -j '.$safedir4.' '.$safedir2);
- @copy($safedir4, $newPathname); }
- if (file_exists($safedir4)) {
- @chmod($safedir4, 0755);
- @unlink($safedir4);
- $delFiles = glob($safedir2 . '/*');
- foreach($delFiles as $delFile){
- if(is_file($delFile)) {
- @chmod($delFile, 0755);
- @unlink($delFile); }
- elseif(is_dir($delFile)) {
- @chmod($delFile, 0755);
- @rmdir($delFile); } }
- @rmdir($safedir2); }
- elseif (in_array($extension, $arraytaro)) {
- $txt = ("OP-Act, Executing \"tar czf $newPathname $safedir2\" on ".$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- shell_exec('tar czf '.$newPathname.' '.$safedir2);
- $delFiles = glob($safedir2 . '/*');
- foreach($delFiles as $delFile){
- if(is_file($delFile)) {
- @chmod($delFile, 0755);
- @unlink($delFile); }
- elseif(is_dir($delFile)) {
- @chmod($delFile, 0755);
- @rmdir($delFile); } }
- @rmdir($safedir2); }
- elseif(in_array($extension, $arrayraro)) {
- $txt = ("OP-Act, Executing \"rar a -ep $pathname $newPathname\" on ".$Time.'.');
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- shell_exec('rar a -ep '.$newPathname.' '.$safedir2);
- $delFiles = glob($safedir2 . '/*');
- foreach($delFiles as $delFile){
- if(is_file($delFile)) {
- @chmod($delFile, 0755);
- unlink($delFile); }
- elseif(is_dir($delFile) ) {
- @chmod($delFile, 0755);
- @rmdir($delFile); } }
- @rmdir($safedir2); } }
+ @rmdir($delFile); } }
+ @rmdir($safedir2); }
// / Error handler and logger for converting files.
if (!file_exists($newPathname)) {
echo nl2br('ERROR!!! HRConvert2524, There was an error during the file conversion process and your file was not copied.'."\n");
@@ -595,16 +557,8 @@ function cleanFiles($path) {
$txt = ('OP-Act: File '.$newPathname.' was created on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
// / Free un-needed memory.
- $_POST['convertSelected'] = $txt = $key = $file = $allowed = $file1 = $file2 = $convertcount = $extension = $pathname = $oldPathname = $filename = $oldExtension
- = $newFile = $newPathname = $docarray = $imgarray = $audioarray = $videoarray = $ModelArray = $drawingarray = $pdfarray = $abwarray = $archarray = $array7z = $array7zo
- = $arrayzipo = $arraytaro = $arrayraro = $abwstd = $abwuno = $_POST['userconvertfilename'] = $returnDATA = $returnDATALINE = $stopper = $height
- = $width = $_POST['height'] = $_POST['width'] = $rotate = $_POST['rotate'] = $wxh = $bitrate = $_POST['bitrate'] = $safedir1 = $safedirTEMP = $safedirTEMP2 = $safedirTEMP3
- = $safedir2 = $safedir3 = $safedir4 = $delFiles = $delFile = $MAKELogFile = null;
- unset ($_POST['convertSelected'], $txt, $key, $file, $allowed, $file1, $file2, $convertcount, $extension, $pathname, $oldPathname, $filename, $oldExtension,
- $newFile, $newPathname, $docarray, $imgarray, $audioarray, $videoarray, $ModelArray, $drawingarray, $pdfarray, $abwarray, $archarray, $array7z, $array7zo,
- $arrayzipo, $arraytaro, $arrayraro, $abwstd, $abwuno, $_POST['userconvertfilename'], $returnDATA, $returnDATALINE, $stopper, $height,
- $width, $_POST['height'], $_POST['width'], $rotate, $_POST['rotate'], $wxh, $bitrate, $_POST['bitrate'], $safedir1, $safedirTEMP, $safedirTEMP2, $safedirTEMP3,
- $safedir2, $safedir3, $safedir4, $delFiles, $delFile, $MAKELogFile ); }
+ $_POST['convertSelected'] = $txt = $key = $file = $allowed = $file1 = $file2 = $convertcount = $extension = $pathname = $oldPathname = $filename = $oldExtension = $newFile = $newPathname = $docarray = $imgarray = $audioarray = $videoarray = $ModelArray = $drawingarray = $pdfarray = $abwarray = $archarray = $array7z = $array7zo = $arrayzipo = $arraytaro = $arrayraro = $abwstd = $abwuno = $_POST['userconvertfilename'] = $returnDATA = $returnDATALINE = $stopper = $height = $width = $_POST['height'] = $_POST['width'] = $rotate = $_POST['rotate'] = $wxh = $bitrate = $_POST['bitrate'] = $safedir2 = $safedir3 = $safedir4 = $delFiles = $delFile = $MAKELogFile = null;
+ unset ($_POST['convertSelected'], $txt, $key, $file, $allowed, $file1, $file2, $convertcount, $extension, $pathname, $oldPathname, $filename, $oldExtension, $newFile, $newPathname, $docarray, $imgarray, $audioarray, $videoarray, $ModelArray, $drawingarray, $pdfarray, $abwarray, $archarray, $array7z, $array7zo, $arrayzipo, $arraytaro, $arrayraro, $abwstd, $abwuno, $_POST['userconvertfilename'], $returnDATA, $returnDATALINE, $stopper, $height, $width, $_POST['height'], $_POST['width'], $rotate, $_POST['rotate'], $wxh, $bitrate, $_POST['bitrate'], $safedir2, $safedir3, $safedir4, $delFiles, $delFile, $MAKELogFile ); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -619,9 +573,9 @@ function cleanFiles($path) {
$file = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $file));
foreach ($DangerousFiles as $DangerousFile) {
if (strpos($file, $DangerousFile) == TRUE) continue 2; }
- $txt = ('OP-Act: User '.$UserID.' selected to PDFWork file '.$file.' on '.$Time.'.');
+ $txt = ('OP-Act: User selected to PDFWork file '.$file.' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- $allowedPDFw = array('txt', 'doc', 'docx', 'rtf' ,'xls', 'xlsx', 'ods', 'odf', 'odt', 'jpg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw');
+ $allowedPDFw = array('txt', 'doc', 'docx', 'rtf' ,'xls', 'xlsx', 'ods', 'odt', 'odt', 'jpg', 'jpeg', 'bmp', 'png', 'gif', 'pdf', 'abw');
$file1 = $ConvertDir.$file;
$file2 = $ConvertTempDir.$file;
copy($file1, $file2);
@@ -631,7 +585,7 @@ function cleanFiles($path) {
if (!file_exists($file2)) {
$txt = ('ERROR!!! HRConvert2551, '."Could not copy $file1 to $file2 on $Time".'!');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
- echo nl2br('ERROR!!! HRConvert2551, There was a problem copying your file between internal HRCloud directories.
+ echo nl2br('ERROR!!! HRConvert2551, There was a problem copying your file between internal HRConvert directories.
Please rename your file or try again later.'."\n");
die(); }
// / If no output format is selected the default of PDF is used instead.
@@ -639,20 +593,20 @@ function cleanFiles($path) {
$extension = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['pdfextension'])); }
if (!isset($_POST['pdfextension'])) {
$extension = 'pdf'; }
- $pathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertTempDir.$file)));
- $oldPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertDir.$file)));
+ $pathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertTempDir.$file)));
+ $oldPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$file)));
$filename = pathinfo($pathname, PATHINFO_FILENAME);
$oldExtension = pathinfo($pathname, PATHINFO_EXTENSION);
$newFile = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userpdfconvertfilename'].'.'.$extension));
- $newPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace('//', '/', $ConvertDir.$newFile)));
- $doc1array = array('txt', 'pages', 'doc', 'xls', 'xlsx', 'docx', 'rtf', 'odf', 'ods', 'odt');
+ $newPathname = str_replace('..', '', str_replace(' ', '\ ', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$newFile)));
+ $doc1array = array('txt', 'pages', 'doc', 'xls', 'xlsx', 'docx', 'rtf', 'odt', 'ods', 'odt');
$img1array = array('jpg', 'jpeg', 'bmp', 'png', 'gif');
$pdf1array = array('pdf');
if (in_array($oldExtension, $allowedPDFw)) {
- while(file_exists($newPathname)) {
+ while (file_exists($newPathname)) {
$pdfworkcount++;
$newFile = str_replace('..', '', str_replace(str_split('[](){};:$!#^&%@>*<'), '', $_POST['userpdfconvertfilename'].'.'.$extension));
- $newPathname = str_replace('..', '', str_replace('//', '/', $ConvertDir.$newFile)); } }
+ $newPathname = str_replace('..', '', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $ConvertDir.$newFile)); } }
// / Code to convert a PDF to a document.
if (in_array($oldExtension, $pdf1array)) {
if (in_array($extension, $doc1array)) {
@@ -671,7 +625,7 @@ function cleanFiles($path) {
$_POST['method1'] = '1';
$txt = ('Notice!!! HRC2601, Attempting PDFWork conversion "method 2" on '.$Time.'.'."\n");
echo ($txt."\n".'--------------------'."\n");
- $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
+ $MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
if ($_POST['method1'] == '1') {
$pathnameTEMP1 = str_replace('..', '', str_replace('.'.$oldExtension, '.jpg' , $pathname));
shell_exec("convert $pathname $pathnameTEMP1");
@@ -686,7 +640,7 @@ function cleanFiles($path) {
$CleanPathnamePages = str_replace('.jpg', '', $PagedFile);
$CleanPathnamePages = str_replace('.txt', '', $CleanPathnamePages);
$CleanPathnamePages = str_replace('.pdf', '', $CleanPathnamePages);
- $CleanPathnamePages = str_replace($CleanFilname, '', $CleanPathnamePages);
+ $CleanPathnamePages = str_replace($CleanFilname, '', $CleanPathnamePages);
$CleanPathnamePages = str_replace('..', '', str_replace('-', '', $CleanPathnamePages));
$PageNumber = $CleanPathnamePages;
if (is_numeric($PageNumber)) {
@@ -713,7 +667,7 @@ function cleanFiles($path) {
echo ($txt."\n".'--------------------'."\n");
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } } } }
// / Code to convert a document to a PDF.
- if (in_array($oldExtension, $doc1array)) {
+ if (in_array($oldExtension, $doc1array)) {
if (in_array($extension, $pdf1array)) {
system("/usr/bin/unoconv -o $newPathname -f pdf $pathname");
$txt = ('OP-Act: '."Converted $pathname to $newPathname on $Time".' using method 2.');
@@ -739,7 +693,7 @@ function cleanFiles($path) {
echo('ERROR!!! HRConvert2667, '."An internal error occured your file on $Time".' using method '.$imgmethod.'.'."\n".'--------------------'."\n");
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
// / If the output file is a txt file we leave it as-is.
- if (!file_exists($newPathname)) {
+ if (!file_exists($newPathname)) {
if ($extension == 'txt') {
if (file_exists($pathnameTEMP)) {
rename($pathnameTEMP, $newPathname);
@@ -753,37 +707,30 @@ function cleanFiles($path) {
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); } }
// / Error handler for if the output file does not exist.
if (!file_exists($newPathname)) {
- echo nl2br('ERROR!!! HRConvert2620, There was a problem converting your file! Please rename your file or try again later.'."\n".'--------------------'."\n");
$txt = ('ERROR!!! HRConvert2620, '."Could not convert $pathname to $newPathname on $Time".'!');
+ echo nl2br('ERROR!!! HRConvert2620, There was a problem converting your file! Please rename your file or try again later.'."\n".'--------------------'."\n");
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
die(); } }
// / Free un-needed memory.
$_POST['pdfworkSelected'] = $txt = $MAKELogFile = $pdfworkcount = $file = $allowedPDFw = $file1 = $file2 = $_POST['pdfextension'] = $extension = $pathname
- = $oldPathname = $filename = $oldExtension = $newFile = $newPathname = $doc1array = $img1array = $pdf1array = $pathnameTEMP = $_POST['method']
- = $_POST['method1'] = $pathnameTEMP1 = $PagedFilesArrRAW = $PagedFile = $CleanFilname = $CleanPathnamePages = $PageNumber = $READPAGEDATA = $WRITEDOCUMENT = $multiple
- = $pathnameTEMP0 = $pathnameTEMPTesseract = $pathnameTEMP0 = $imgmethod = $pathnameTEMP3 = null;
- unset ($_POST['pdfworkSelected'], $txt, $MAKELogFile, $pdfworkcount, $file, $allowedPDFw, $file1, $file2, $_POST['pdfextension'], $extension, $pathname,
- $oldPathname , $filename, $oldExtension, $newFile, $newPathname, $doc1array, $img1array, $pdf1array, $pathnameTEMP, $_POST['method'],
- $_POST['method1'], $pathnameTEMP1, $PagedFilesArrRAW, $PagedFile, $CleanFilname, $CleanPathnamePages, $PageNumber, $READPAGEDATA, $WRITEDOCUMENT, $multiple,
- $pathnameTEMP0, $pathnameTEMPTesseract, $pathnameTEMP0, $imgmethod, $pathnameTEMP3); }
+ = $oldPathname = $filename = $oldExtension = $newFile = $newPathname = $doc1array = $img1array = $pdf1array = $pathnameTEMP = $_POST['method'] = $_POST['method1'] = $pathnameTEMP1 = $PagedFilesArrRAW = $PagedFile = $CleanFilname = $CleanPathnamePages = $PageNumber = $READPAGEDATA = $WRITEDOCUMENT = $multiple = $pathnameTEMP0 = $pathnameTEMPTesseract = $pathnameTEMP0 = $imgmethod = $pathnameTEMP3 = null;
+ unset ($_POST['pdfworkSelected'], $txt, $MAKELogFile, $pdfworkcount, $file, $allowedPDFw, $file1, $file2, $_POST['pdfextension'], $extension, $pathname, $oldPathname , $filename, $oldExtension, $newFile, $newPathname, $doc1array, $img1array, $pdf1array, $pathnameTEMP, $_POST['method'], $_POST['method1'], $pathnameTEMP1, $PagedFilesArrRAW, $PagedFile, $CleanFilname, $CleanPathnamePages, $PageNumber, $READPAGEDATA, $WRITEDOCUMENT, $multiple, $pathnameTEMP0, $pathnameTEMPTesseract, $pathnameTEMP0, $imgmethod, $pathnameTEMP3); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
-// / The following code sync's the users AppData between the CloudLoc and the InstLoc.
+// / The following code sync's the users AppData between the ConvertLoc and the InstLoc.
foreach ($iterator = new \RecursiveIteratorIterator (
new \RecursiveDirectoryIterator ($ConvertDir, \RecursiveDirectoryIterator::SKIP_DOTS),
\RecursiveIteratorIterator::SELF_FIRST) as $item) {
@chmod($item, 0755);
if (is_dir($item)) {
- if (!file_exists($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName())) {
- mkdir($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); } }
- else {
- if (!is_link($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()) or !file_exists($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName())) {
- symlink($item, $ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); } } }
+ if (!file_exists($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName())) mkdir($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); }
+ else if (!is_link($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()) or !file_exists($ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName())) symlink($item, $ConvertTempDir.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
-// / The following code loads the GUI.
+// / The following code prepares & loads the GUI.
+if (isset($ShowGUI)) if (!$ShowGUI) $_GET['noGui'] = TRUE;
if (isset($_GET['showFiles']) or isset($_POST['showFiles'])) {
require_once('convertGui2.php'); }
if (!isset($_GET['showFiles'])) {
diff --git a/convertGui1.php b/convertGui1.php
index cbcb135..30f944b 100644
--- a/convertGui1.php
+++ b/convertGui1.php
@@ -1,17 +1,19 @@
+if (!isset($ApplicationName)) $ApplicationName = 'HRConvert2';
+if (!isset($ApplicationTitle)) $ApplicationTitle = 'Convert Anything!';
+if (!isset($ShowFinePrint)) $ShowFinePrint = TRUE; ?>
-
HRConvert2
+
Online File Converter, Extractor, Compressor
-
HRConvert2 is an open-source web-app that converts files without tracking users across the net or infringing on your intellectual property.
+
is based off the open-source web-app HRConvert2 by Zelon88 that converts files without tracking users across the net or infringing on your intellectual property.
-
-
+
+
+
Select files by clicking, tapping, or dropping files into the box below.
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/convertGui2.php b/convertGui2.php
index 59f72bc..bba8277 100644
--- a/convertGui2.php
+++ b/convertGui2.php
@@ -9,14 +9,17 @@
$fcPlural1 = '';
$fcPlural2 = ' is'; }
include ('header.php');
+if (!isset($ApplicationName)) $ApplicationName = 'HRConvert2';
+if (!isset($ApplicationTitle)) $ApplicationTitle = 'Convert Anything!';
+if (!isset($ShowFinePrint)) $ShowFinePrint = TRUE;
?>
-
+
-
HRConvert2
+
File Conversion Options
-
You have uploaded valid file to HRConvert2.
+
You have uploaded valid file to .
Your file now ready to convert using the options below.
@@ -38,15 +41,13 @@
-
@@ -250,7 +250,7 @@
-
+
diff --git a/sanitizeCore.php b/sanitizeCore.php
index 94b1d69..7c7d91d 100644
--- a/sanitizeCore.php
+++ b/sanitizeCore.php
@@ -93,10 +93,9 @@
if (isset($_POST['download'])) {
$download = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|'), '', $_POST['download'])), ENT_QUOTES, 'UTF-8');
if (isset($_POST['filesToDownload'])) {
- $_POST['filesToDownload'] = htmlentities(str_replace('..', '', 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_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['filesToDownload'])), ENT_QUOTES, 'UTF-8'); } } }
+ if (is_array($_POST['filesToDownload'])) foreach ($_POST['filesToDownload'] as $key => $item) $_POST['filesToDownload'][$key] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $item)), ENT_QUOTES, 'UTF-8');
+ else $_POST['filesToDownload'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['filesToDownload'])), ENT_QUOTES, 'UTF-8');
+ $_POST['download'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['download'])), ENT_QUOTES, 'UTF-8'); } }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -106,12 +105,11 @@
// / Must specify "archextension" and "userfilename" POST variables.
// / The filename should NOT contain an extension.
if (isset($_POST['archive'])) {
+ if (is_array($_POST['filesToArchive'])) foreach ($_POST['filesToArchive'] as $key => $item) $_POST['filesToArchive'][$key] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $item)), ENT_QUOTES, 'UTF-8');
+ else $_POST['filesToArchive'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['filesToArchive'])), ENT_QUOTES, 'UTF-8');
$_POST['archive'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['archive'])), ENT_QUOTES, 'UTF-8');
- if (!is_array($_POST['filesToArchive'])) {
- $_POST['filesToArchive'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['filesToArchive'])), ENT_QUOTES, 'UTF-8');
- $_POST['filesToArchive'] = array($_POST['filesToArchive']);
- $_POST['archextension'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['archextension'])), ENT_QUOTES, 'UTF-8');
- $_POST['userfilename'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['userfilename'])), ENT_QUOTES, 'UTF-8'); } }
+ $_POST['archextension'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['archextension'])), ENT_QUOTES, 'UTF-8');
+ $_POST['userfilename'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['userfilename'])), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
@@ -123,9 +121,8 @@
// / 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_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['convertSelected']));
- if (!is_array($_POST['convertSelected'])) {
- $_POST['convertSelected'] = array($_POST['convertSelected']); }
+ if (is_array($_POST['convertSelected'])) foreach ($_POST['convertSelected'] as $key => $item) $_POST['convertSelected'][$key] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $item)), ENT_QUOTES, 'UTF-8');
+ else $_POST['convertSelected'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['convertSelected'])), ENT_QUOTES, 'UTF-8');
$_POST['extension'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['extension'])), ENT_QUOTES, 'UTF-8');
$_POST['userconvertfilename'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['userconvertfilename'])), ENT_QUOTES, 'UTF-8');
if (isset($_POST['bitrate'])) {
@@ -142,15 +139,17 @@
// / 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_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['pdfworkSelected']));
- if (!is_array($_POST['pdfworkSelected'])) {
- $_POST['pdfworkSelected'] = array($_POST['pdfworkSelected']); }
+ if (is_array($_POST['pdfworkSelected'])) foreach ($_POST['pdfworkSelected'] as $key => $item) $_POST['pdfworkSelected'][$key] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $item)), ENT_QUOTES, 'UTF-8');
+ else $_POST['pdfworkSelected'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['pdfworkSelected'])), ENT_QUOTES, 'UTF-8');
$_POST['pdfextension'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['pdfextension'])), ENT_QUOTES, 'UTF-8');
$_POST['userpdfconvertfilename'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['userpdfconvertfilename'])), ENT_QUOTES, 'UTF-8');
$_POST['method'] = htmlentities(str_replace('..', '', str_replace(str_split('~#[]{};:$!#^&%@>*<|"\''), '', $_POST['method'])), ENT_QUOTES, 'UTF-8'); }
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
+// / Free unneeded memory.
+$key = $item = null;
+unset($key, $item);
set_time_limit(0);
// / -----------------------------------------------------------------------------------
?>
\ No newline at end of file
diff --git a/versionInfo.php b/versionInfo.php
index c3e26d0..21ed4c6 100644
--- a/versionInfo.php
+++ b/versionInfo.php
@@ -1,4 +1,4 @@