Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
1bfceb99
Verified
Commit
1bfceb99
authored
6 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FIX #9198 remove file if it is unauthorized
parent
114e4370
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/content_management/applet_controller.php
+17
-16
17 additions, 16 deletions
modules/content_management/applet_controller.php
with
17 additions
and
16 deletions
modules/content_management/applet_controller.php
+
17
−
16
View file @
1bfceb99
...
...
@@ -282,33 +282,34 @@ if (!empty($_REQUEST['action'])
fwrite
(
$inF
,
$fileContent
);
fclose
(
$inF
);
//Récupération de la version pdf du document
if
(
$_SESSION
[
'modules_loaded'
][
'attachments'
][
'convertPdf'
]
==
"true"
&&
(
$objectType
==
'attachmentFromTemplate'
||
$objectType
==
'attachment'
||
$objectType
==
'attachmentUpVersion'
||
$objectType
==
'attachmentVersion'
||
$objectType
==
'attachmentMailing'
||
$objectType
==
'outgoingMail'
||
$objectType
==
'resourceEdit'
||
$objectType
==
'transmission'
||
$objectType
==
'newAttachment'
)
&&
isset
(
$_REQUEST
[
'pdfContent'
]))
{
$pdfEncodedContent
=
str_replace
(
' '
,
'+'
,
$_REQUEST
[
'pdfContent'
]
);
$pdfContent
=
base64_decode
(
$pdfEncodedContent
);
//copy file on Maarch tmp dir
$tmpFilePdfName
=
'cm_tmp_file_pdf_'
.
$_SESSION
[
'user'
][
'UserId'
]
.
'_'
.
rand
()
.
'.pdf'
;
$inFpdf
=
fopen
(
$_SESSION
[
'config'
][
'tmppath'
]
.
$tmpFilePdfName
,
'w'
);
fwrite
(
$inFpdf
,
$pdfContent
);
fclose
(
$inFpdf
);
}
$arrayIsAllowed
=
array
();
$arrayIsAllowed
=
Ds_isFileTypeAllowed
(
$_SESSION
[
'config'
][
'tmppath'
]
.
$tmpFileName
);
if
(
$arrayIsAllowed
[
'status'
]
==
false
)
{
unlink
(
$_SESSION
[
'config'
][
'tmppath'
]
.
$tmpFileName
);
$result
=
array
(
'ERROR'
=>
_WRONG_FILE_TYPE
.
' '
.
$arrayIsAllowed
[
'mime_type'
]
);
createXML
(
'ERROR'
,
$result
);
}
else
{
//Récupération de la version pdf du document
if
(
$_SESSION
[
'modules_loaded'
][
'attachments'
][
'convertPdf'
]
==
"true"
&&
(
$objectType
==
'attachmentFromTemplate'
||
$objectType
==
'attachment'
||
$objectType
==
'attachmentUpVersion'
||
$objectType
==
'attachmentVersion'
||
$objectType
==
'attachmentMailing'
||
$objectType
==
'outgoingMail'
||
$objectType
==
'resourceEdit'
||
$objectType
==
'transmission'
||
$objectType
==
'newAttachment'
)
&&
isset
(
$_REQUEST
[
'pdfContent'
]))
{
$pdfEncodedContent
=
str_replace
(
' '
,
'+'
,
$_REQUEST
[
'pdfContent'
]
);
$pdfContent
=
base64_decode
(
$pdfEncodedContent
);
//copy file on Maarch tmp dir
$tmpFilePdfName
=
'cm_tmp_file_pdf_'
.
$_SESSION
[
'user'
][
'UserId'
]
.
'_'
.
rand
()
.
'.pdf'
;
$inFpdf
=
fopen
(
$_SESSION
[
'config'
][
'tmppath'
]
.
$tmpFilePdfName
,
'w'
);
fwrite
(
$inFpdf
,
$pdfContent
);
fclose
(
$inFpdf
);
}
//depending on the type of object, the action is not the same (???)
if
(
$objectType
==
'resource'
)
{
include
'modules/content_management/save_new_version_from_cm.php'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment