]> git.p6c8.net - jirafeau/pcanterino.git/blobdiff - lib/functions.php
Check if ref string is a valid hex string
[jirafeau/pcanterino.git] / lib / functions.php
index 948a436de4843bd28f1b1210e1fcc3f379a8923f..07e5c02f7b3bb7a05667df4d433e2a9b3b6e3075 100644 (file)
@@ -947,6 +947,7 @@ function jirafeau_admin_bug_report($cfg)
     $out .= "- version: " . JIRAFEAU_VERSION . "<br/>";
     $jirafeau_options = [
         'debug',
+        'debug_enforce_classic_upload',
         'file_hash',
         'litespeed_workaround',
         'store_uploader_ip',
@@ -1119,6 +1120,11 @@ function jirafeau_async_init($filename, $type, $one_time, $key, $time, $ip)
   */
 function jirafeau_async_push($ref, $data, $code, $max_file_size)
 {
+    /* Validate ref string. */
+    if (!ctype_xdigit(trim($ref))) {
+        return "Error: Malformed ref string";
+    }
+
     /* Get async infos. */
     $a = jirafeau_get_async_ref($ref);
 
@@ -1192,6 +1198,11 @@ function jirafeau_async_push($ref, $data, $code, $max_file_size)
   */
 function jirafeau_async_end($ref, $code, $crypt, $link_name_length, $file_hash_method)
 {
+    /* Validate ref string. */
+    if (!ctype_xdigit(trim($ref))) {
+        return "Error: Malformed ref string";
+    }
+
     /* Get async infos. */
     $a = jirafeau_get_async_ref($ref);
     if (count($a) == 0

patrick-canterino.de