Projet

Général

Profil

Révision 5587145e

Ajouté par Assos Assos il y a presque 7 ans

Update to 7.56

Voir les différences:

drupal7/includes/file.inc
535 535
EOF;
536 536

  
537 537
  if ($private) {
538
    $lines = "Deny from all\n\n" . $lines;
538
    $lines = <<<EOF
539
# Deny all requests from Apache 2.4+.
540
<IfModule mod_authz_core.c>
541
  Require all denied
542
</IfModule>
543

  
544
# Deny all requests from Apache 2.0-2.2.
545
<IfModule !mod_authz_core.c>
546
  Deny from all
547
</IfModule>
548
EOF
549
    . "\n\n" . $lines;
539 550
  }
540 551

  
541 552
  return $lines;
......
889 900
 */
890 901
function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
891 902
  $original_source = $source;
892
  $original_destination = $destination;
893 903

  
894 904
  // Assert that the source file actually exists.
895 905
  if (!file_exists($source)) {
......
1604 1614

  
1605 1615
  // If we made it this far it's safe to record this file in the database.
1606 1616
  if ($file = file_save($file)) {
1617
    // Track non-public files in the session if they were uploaded by an
1618
    // anonymous user. This allows modules such as the File module to only
1619
    // grant view access to the specific anonymous user who uploaded the file.
1620
    // See file_file_download().
1621
    // The 'file_public_schema' variable is used to allow other publicly
1622
    // accessible file schemes to be treated the same as the public:// scheme
1623
    // provided by Drupal core and to avoid adding unnecessary data to the
1624
    // session (and the resulting bypass of the page cache) in those cases. For
1625
    // security reasons, only schemes that are completely publicly accessible,
1626
    // with no download restrictions, should be added to this variable. See
1627
    // file_managed_file_value().
1628
    if (!$user->uid && !in_array($destination_scheme, variable_get('file_public_schema', array('public')))) {
1629
      $_SESSION['anonymous_allowed_file_ids'][$file->fid] = $file->fid;
1630
    }
1607 1631
    // Add file to the cache.
1608 1632
    $upload_cache[$form_field_name] = $file;
1609 1633
    return $file;
......
2553 2577
 *   An associative array of headers, as expected by file_transfer().
2554 2578
 */
2555 2579
function file_get_content_headers($file) {
2556
  $name = mime_header_encode($file->filename);
2557 2580
  $type = mime_header_encode($file->filemime);
2558 2581

  
2559 2582
  return array(

Formats disponibles : Unified diff