Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #20716 #31853

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

FIX #20716 #31853

wants to merge 3 commits into from

Conversation

IC-Victorien
Copy link
Contributor

@IC-Victorien IC-Victorien commented Nov 15, 2024

FIX #20716

@IC-Victorien IC-Victorien changed the title FIX_#20716 FIX #20716 Nov 15, 2024
@@ -137,7 +137,7 @@
$arrayofimages = array('logo', 'logo_squarred');
//var_dump($_FILES); exit;
foreach ($arrayofimages as $varforimage) {
if ($_FILES[$varforimage]["name"] && !preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
if ($_FILES[$varforimage]["name"] && !preg_match('/(\.jpeg|\.jpg|\.png'.($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES?"|\.svg":"").')$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest a better fix:
Replace preg_replace with !image_format_supported($_FILES[$varforimage]["name"], 1)

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: Devcamp 2024 Nancy PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

while Uploading SVG image in doleditor/Ckeditor it shows "Invalid file (Bad extension)".
3 participants