Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
205a1be9
Verified
Commit
205a1be9
authored
Mar 03, 2020
by
Cyril Vazquez
Browse files
Read chunks of 6 for base64 decode
parent
8743dc70
Pipeline
#7151
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/Encoding/Base64.php
View file @
205a1be9
...
...
@@ -41,7 +41,8 @@ class Base64
if
(
is_resource
(
$value
))
{
$stream
=
fopen
(
'php://temp'
,
'w+'
);
while
(
!
feof
(
$value
))
{
$chunk
=
fread
(
$value
,
1024
*
1024
*
2
);
// Chunk size 1024*1024*2 (2Mo binary)
$chunk
=
fread
(
$value
,
2097152
);
fwrite
(
$stream
,
base64_decode
(
$chunk
));
}
...
...
@@ -64,7 +65,8 @@ class Base64
if
(
is_resource
(
$value
))
{
$stream
=
fopen
(
'php://temp'
,
'w+'
);
while
(
!
feof
(
$value
))
{
$chunk
=
fread
(
$value
,
1024
*
1024
*
2
);
// Chunk size 48*48*48/2 (2M of base64 6 bytes words)
$chunk
=
fread
(
$value
,
2654208
);
fwrite
(
$stream
,
base64_encode
(
$chunk
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment