CoreFiles by mySites.guru
htaccessbrotli.php36 lines, 1,107 bytes, from Joomla_5.4.3-Stable-Full_Package.zip
Raw History Compare with 5.4.2
md5
5ad9dc878ca102a6ee43bb3982118254
sha1
47e287741d863c26841a046e4fb42f8cff015d5f
sha256
b74bcdff9bc6ba57632dca23f05bad117f10b6043773cdd5bf6b592e81d96235
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 *
 * This file contains post-installation message handling for notifying users of a change
 * in the default .htaccess file regarding Brotli compression.
 */

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Notifies users of a change in the default .htaccess file regarding setting for brotli to prevent double compression
 *
 * This check returns true regardless of condition.
 *
 * @return  boolean
 *
 * @since   4.4.4
 */
function admin_postinstall_htaccessbrotli_condition()
{
    $htaccessContent = '';

    if (is_file(JPATH_ROOT . '/.htaccess') || is_file(JPATH_ROOT . '/htaccess.txt')) {
        $htaccessContent = file_get_contents(is_file(JPATH_ROOT . '/.htaccess') ? JPATH_ROOT . '/.htaccess' : JPATH_ROOT . '/htaccess.txt');
    }

    return !str_contains($htaccessContent, 'E=no-brotli:1');
}

The same content is in 131 releases, Joomla 5.1.0-rc1 to 6.2.1-rc1. See them all, or every version of this file.