Change regexp to detect base64 encoded contents on args

parent 3e8961b5
Pipeline #7090 failed with stages
......@@ -168,7 +168,7 @@ class ArchiveTransfer extends abstractMessage
break;
case is_string($messageFile) &&
preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $messageFile):
preg_match('%^[a-zA-Z0-9\\\\/+]*={0,2}$%', $messageFile):
$data = base64_decode($messageFile);
break;
......@@ -298,7 +298,7 @@ class ArchiveTransfer extends abstractMessage
} elseif (is_object($attachment)) {
if (filter_var($attachment->data, FILTER_VALIDATE_URL)) {
$data = stream_get_contents($attachment->data);
} elseif (preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $attachment->data)) {
} elseif (preg_match('%^[a-zA-Z0-9\\\\/+]*={0,2}$%', $attachment->data)) {
$data = base64_decode($attachment->data);
} elseif (is_file($attachment->data)) {
$data = file_get_contents($attachment->data);
......
......@@ -135,7 +135,7 @@ trait archiveEntryTrait
break;
case is_string($receivedHandler) &&
preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $receivedHandler):
preg_match('%^[a-zA-Z0-9\\\\/+]*={0,2}$%', $receivedHandler):
$handler = \laabs::createTempStream(base64_decode($receivedHandler));
break;
......
......@@ -674,7 +674,7 @@ trait archiveModificationTrait
break;
case is_string($contents) &&
preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $contents):
preg_match('%^[a-zA-Z0-9\\\\/+]*={0,2}$%', $contents):
$handler = \laabs::createTempStream(base64_decode($contents));
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment