You are here

function _seckit_ie_mime_check in Security Kit 6

Checks extensions variable set by Upload module.

Checks both Default Extensions list and Anonymous Users Extensions. Returns results for further extensions modification.

3 calls to _seckit_ie_mime_check()
seckit_admin_form in includes/seckit.form.inc
Forms administration page.
_seckit_ie_mime in ./seckit.module
Sets txt as allowed/restricted extension.
_seckit_ie_mime_js in ./seckit.module
Sends menu callback for AHAH, executes necessary functionality.

File

./seckit.module, line 285
Allows administrators to improve security of the website.

Code

function _seckit_ie_mime_check() {

  // if Upload module is enabled
  if (module_exists('upload')) {

    // default extensions check
    $default = variable_get('upload_extensions_default', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp');
    $default = preg_match(SECKIT_IE_MIME_REGEX, $default);

    // extensions for anonymous users check
    $anonymous = variable_get('upload_extensions_1', 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp');
    $anonymous = preg_match(SECKIT_IE_MIME_REGEX, $anonymous);
    if ($default == 0 || $anonymous == 0) {
      return SECKIT_IE_MIME_SECURE;
    }
    else {
      return SECKIT_IE_MIME_INSECURE;
    }
  }
  else {
    return SECKIT_IE_MIME_FAILED;
  }
}