summaryrefslogtreecommitdiffstats
path: root/owncloud-9.0.4-further_htaccess_cleanup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'owncloud-9.0.4-further_htaccess_cleanup.patch')
-rw-r--r--owncloud-9.0.4-further_htaccess_cleanup.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/owncloud-9.0.4-further_htaccess_cleanup.patch b/owncloud-9.0.4-further_htaccess_cleanup.patch
new file mode 100644
index 0000000..b709102
--- /dev/null
+++ b/owncloud-9.0.4-further_htaccess_cleanup.patch
@@ -0,0 +1,81 @@
+commit a8c9a64d54bbf547017f58a943e04efcb3d8d6f5
+Author: James Hogarth <james.hogarth@gmail.com>
+Date: Tue Jul 19 12:34:06 2016 +0100
+
+ kill htaccess updates
+
+diff --git a/lib/private/setup.php b/lib/private/setup.php
+index a2f8fdd..f5be6e2 100644
+--- a/lib/private/setup.php
++++ b/lib/private/setup.php
+@@ -396,69 +396,7 @@ class Setup {
+ * Append the correct ErrorDocument path for Apache hosts
+ */
+ public static function updateHtaccess() {
+- $config = \OC::$server->getConfig();
+-
+- // For CLI read the value from overwrite.cli.url
+- if(\OC::$CLI) {
+- $webRoot = $config->getSystemValue('overwrite.cli.url', '');
+- if($webRoot === '') {
+- return;
+- }
+- $webRoot = parse_url($webRoot, PHP_URL_PATH);
+- $webRoot = rtrim($webRoot, '/');
+- } else {
+- $webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
+- }
+-
+- $setupHelper = new \OC\Setup($config, \OC::$server->getIniWrapper(),
+- \OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(),
+- \OC::$server->getSecureRandom());
+-
+- $htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
+- $content = "#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####\n";
+- $htaccessContent = explode($content, $htaccessContent, 2)[0];
+-
+- //custom 403 error page
+- $content.= "\nErrorDocument 403 ".$webRoot."/core/templates/403.php";
+-
+- //custom 404 error page
+- $content.= "\nErrorDocument 404 ".$webRoot."/core/templates/404.php";
+-
+- // Add rewrite rules if the RewriteBase is configured
+- $rewriteBase = $config->getSystemValue('htaccess.RewriteBase', '');
+- if($rewriteBase !== '') {
+- $content .= "\n<IfModule mod_rewrite.c>";
+- $content .= "\n Options -MultiViews";
+- $content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
+- $content .= "\n RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/remote.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/public.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/cron.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/status.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/updater/";
+- $content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
+- $content .= "\n RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*";
+- $content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
+- $content .= "\n RewriteBase " . $rewriteBase;
+- $content .= "\n <IfModule mod_env.c>";
+- $content .= "\n SetEnv front_controller_active true";
+- $content .= "\n <IfModule mod_dir.c>";
+- $content .= "\n DirectorySlash off";
+- $content .= "\n </IfModule>";
+- $content .= "\n </IfModule>";
+- $content .= "\n</IfModule>";
+- }
+-
+- if ($content !== '') {
+- //suppress errors in case we don't have permissions for it
+- @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content . "\n");
+- }
+-
++ return true;
+ }
+
+ public static function protectDataDirectory() {