The MU forums have moved to WordPress.org

Error trying to upload (3 posts)

  1. mrdon
    Member
    Posted 16 years ago #

    I have set WPMU to use separate domains, so not sure if that could be the problem, but....when trying to upload files from one of the blogs I get the error:

    "Warning: Invalid argument supplied for foreach() in /wp-includes/functions.php on line 1122"

    "File type does not meet security guidelines. Try another."

    Line 1122 of functions.php is:

    foreach ($mimes as $ext_preg => $mime_match) {
    $ext_preg = '!\.(' . $ext_preg . ')$!i';
    if ( preg_match($ext_preg, $filename, $ext_matches) ) {
    $type = $mime_match;
    $ext = $ext_matches[1];
    break;
    }
    }

    Any help would be greatly appreciated,
    Brandon

  2. thierryyyyyyy
    Member
    Posted 15 years ago #

    I have the same error uploading a file for my theme.
    I also have more than 1 domain.
    I used the plugin "MultiSiteManager".

    When I look to the code you gave, it means that "$mimes" is not a array.
    I looked more deep in the code :
    usually this part of code (wp_check_filetype function) is called without the "$mimes" argument, and the default value has the "jpg" extension I tested.
    The only way this "mimes" could not be an array, is from the wp-admin/includes/file.php

    line 139 : if ( $test_type ) {
    		$wp_filetype = wp_check_filetype( $file['name'], $mimes );

    I did not go further.
    What should I do ?
    directly modify this line 140, deleting the "$mime" ?

  3. thierryyyyyyy
    Member
    Posted 15 years ago #

    I resolved my problem quite simply :
    just validate the "site-admin=>options" where the list of allowed file-types has to be set.
    the default is already proposed, but it seems that it is not set in the database... so just validing the form is enough.
    (that's what I think, I didn't make all needed research to prove that)

About this Topic

  • Started 16 years ago by mrdon
  • Latest reply from thierryyyyyyy