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

Improve file type extension check in check_upload_mimes() to fix loose check #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-includes/ms-functions.php
Expand Up @@ -1856,7 +1856,7 @@ function check_upload_mimes( $mimes ) {
$site_mimes = array();
foreach ( $site_exts as $ext ) {
foreach ( $mimes as $ext_pattern => $mime ) {
if ( '' !== $ext && false !== strpos( $ext_pattern, $ext ) ) {
if ( '' !== $ext && preg_match( '!^(' . $ext_pattern . ')$!i', $ext ) ) {
Nikschavan marked this conversation as resolved.
Show resolved Hide resolved
$site_mimes[ $ext_pattern ] = $mime;
}
}
Expand Down