Remove version check out of .htaccess
This can now be achieved using the new code signing.
This commit is contained in:
parent
b15d77c934
commit
235094ab54
|
@ -1,4 +1,3 @@
|
||||||
# Version: 9.0.0
|
|
||||||
<IfModule mod_headers.c>
|
<IfModule mod_headers.c>
|
||||||
<IfModule mod_fcgid.c>
|
<IfModule mod_fcgid.c>
|
||||||
<IfModule mod_setenvif.c>
|
<IfModule mod_setenvif.c>
|
||||||
|
|
|
@ -394,33 +394,13 @@ class Setup {
|
||||||
return \OC::$SERVERROOT.'/.htaccess';
|
return \OC::$SERVERROOT.'/.htaccess';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the .htaccess contains the current version parameter
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function isCurrentHtaccess() {
|
|
||||||
$version = \OC_Util::getVersion();
|
|
||||||
unset($version[3]);
|
|
||||||
|
|
||||||
return !strpos(
|
|
||||||
file_get_contents($this->pathToHtaccess()),
|
|
||||||
'Version: '.implode('.', $version)
|
|
||||||
) === false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the correct ErrorDocument path for Apache hosts
|
* Append the correct ErrorDocument path for Apache hosts
|
||||||
*
|
|
||||||
* @throws \OC\HintException If .htaccess does not include the current version
|
|
||||||
*/
|
*/
|
||||||
public static function updateHtaccess() {
|
public static function updateHtaccess() {
|
||||||
$setupHelper = new \OC\Setup(\OC::$server->getConfig(), \OC::$server->getIniWrapper(),
|
$setupHelper = new \OC\Setup(\OC::$server->getConfig(), \OC::$server->getIniWrapper(),
|
||||||
\OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(),
|
\OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(),
|
||||||
\OC::$server->getSecureRandom());
|
\OC::$server->getSecureRandom());
|
||||||
if(!$setupHelper->isCurrentHtaccess()) {
|
|
||||||
throw new \OC\HintException('.htaccess file has the wrong version. Please upload the correct version. Maybe you forgot to replace it after updating?');
|
|
||||||
}
|
|
||||||
|
|
||||||
$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
|
$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
|
||||||
$content = '';
|
$content = '';
|
||||||
|
|
Loading…
Reference in New Issue