Verified Commit 798ad9e4 authored by quietone's avatar quietone
Browse files

Issue #3495778 by bramdriesen, smustgrave, cmlara, dawehner, drumm,...

Issue #3495778 by bramdriesen, smustgrave, cmlara, dawehner, drumm, effulgentsia, fabianx, catch, berdir, alexpott, amateescu, BarisW, benjifisher, gábor hojtsy, guypaddock, tim.plunkett, webchick, wim leers, quicksketch, xjm, tedbow, poker10, kim.pepper, jenlampton, larowlan, longwave, plach, mondrake: Update all references to file_save_htaccess()
parent 18071b07
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for composer/Plugin/VendorHardening/FileSecurity.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public static function writeHtaccess($directory, $deny_public_access = TRUE, $fo
   * @return string
   *   The desired contents of the .htaccess file.
   *
   * @see file_save_htaccess()
   * @see \Drupal\Component\FileSecurity\FileSecurity::writeHtaccess()
   */
  public static function htaccessLines($deny_public_access = TRUE) {
    $lines = static::htaccessPreventExecution();
+5 −5
Changes for core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
use Drupal\Tests\BrowserTestBase;

/**
 * Tests the log message added by file_save_htaccess().
 * Tests the log message added by the HtaccessWriter service.
 *
 * @group File
 */
@@ -25,15 +25,15 @@ class FileSaveHtaccessLoggingTest extends BrowserTestBase {
  protected $defaultTheme = 'stark';

  /**
   * Tests file_save_htaccess().
   * Tests the HtaccessWriter service write functionality.
   */
  public function testHtaccessSave(): void {
    // Prepare test directories.
    $private = $this->publicFilesDirectory . '/test/private';

    // Verify that file_save_htaccess() returns FALSE if .htaccess cannot be
    // written and writes a correctly formatted message to the error log. Set
    // $private to TRUE so all possible .htaccess lines are written.
    // Verify that HtaccessWriter service returns FALSE if .htaccess cannot be
    // written and writes a correctly formatted message to the error log.
    // Set $private to TRUE so all possible .htaccess lines are written.
    /** @var \Drupal\Core\File\HtaccessWriterInterface $htaccess */
    $htaccess = \Drupal::service('file.htaccess_writer');
    $this->assertFalse($htaccess->write($private, TRUE));