You are here

function acquia_spi_security_review_check_private_files in Acquia Connector 7.3

Same name and namespace in other branches
  1. 6.2 acquia_spi/security_review.inc \acquia_spi_security_review_check_private_files()
  2. 7.2 acquia_spi/security_review.inc \acquia_spi_security_review_check_private_files()

If private files is enabled check that the directory is not under web root.

There is ample room for the user to get around this check.

@TODO get more sophisticated?

1 string reference to 'acquia_spi_security_review_check_private_files'
_acquia_spi_security_review_security_checks in acquia_spi/security_review.inc
Checks for acquia_spi_security_review_get_checks().

File

acquia_spi/security_review.inc, line 350
Stand-alone security checks and review system.

Code

function acquia_spi_security_review_check_private_files() {
  $file_directory_path = variable_get('file_private_path', '');
  if (empty($file_directory_path)) {

    // Ignore this check.
    $result = NULL;
  }
  elseif (strpos(realpath($file_directory_path), DRUPAL_ROOT) === 0) {

    // Path begins at root.
    $result = FALSE;
  }
  else {
    $result = TRUE;
  }
  return array(
    'result' => $result,
    'value' => $file_directory_path,
  );
}