summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-30 01:33:17 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-30 01:33:17 +0000
commita724915f82a0c25cabe60561cd9b4f7f72541734 (patch)
tree6601c55abe4005404aec5ef7f3aa94e74fd93411 /includes
parentd97f4bdba3e29ea63f488e56f5141a203b7b2171 (diff)
downloadbrdo-a724915f82a0c25cabe60561cd9b4f7f72541734.tar.gz
brdo-a724915f82a0c25cabe60561cd9b4f7f72541734.tar.bz2
#551658 by pwolanin, aaron, drewish: Move private files to an opt-in system, and no longer force private files to live within web-accessible directory.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/file.inc7
-rw-r--r--includes/stream_wrappers.inc4
3 files changed, 7 insertions, 6 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5aff8f11c..b1ed5ada2 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -19,7 +19,7 @@ define('DRUPAL_CORE_COMPATIBILITY', '7.x');
/**
* Minimum supported version of PHP.
*/
-define('DRUPAL_MINIMUM_PHP', '5.2.0');
+define('DRUPAL_MINIMUM_PHP', '5.2.1');
/**
* Minimum recommended value of PHP memory_limit.
diff --git a/includes/file.inc b/includes/file.inc
index 96da7ad4e..da47b3590 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -409,7 +409,9 @@ function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS)
*/
function file_ensure_htaccess() {
file_create_htaccess('public://', FALSE);
- file_create_htaccess('private://', TRUE);
+ if (variable_get('file_private_path', FALSE)) {
+ file_create_htaccess('private://', TRUE);
+ }
file_create_htaccess('temporary://', TRUE);
}
@@ -1586,8 +1588,7 @@ function file_download() {
$scheme = array_shift($args);
$target = implode('/', $args);
$uri = $scheme . '://' . $target;
-
- if (file_exists($uri)) {
+ if (file_stream_wrapper_valid_scheme($scheme) && file_exists($uri)) {
// Let other modules provide headers and controls access to the file.
$headers = module_invoke_all('file_download', $uri);
if (in_array(-1, $headers)) {
diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc
index 288c3979d..87acc5440 100644
--- a/includes/stream_wrappers.inc
+++ b/includes/stream_wrappers.inc
@@ -657,7 +657,7 @@ class DrupalPrivateStreamWrapper extends DrupalLocalStreamWrapper {
* Implements abstract public function getDirectoryPath()
*/
public function getDirectoryPath() {
- return variable_get('file_private_path', conf_path() . '/private/files');
+ return variable_get('file_private_path', '');
}
/**
@@ -684,7 +684,7 @@ class DrupalTemporaryStreamWrapper extends DrupalLocalStreamWrapper {
* Implements abstract public function getDirectoryPath()
*/
public function getDirectoryPath() {
- return variable_get('file_temporary_path', conf_path() . '/private/temp');
+ return variable_get('file_temporary_path', sys_get_temp_dir());
}
/**