]> source.dussan.org Git - nextcloud-server.git/commitdiff
Limit blacklist to php files
authorRichard Clarkson <robert@trash-mail.com>
Thu, 27 Nov 2014 19:26:45 +0000 (20:26 +0100)
committerRichard Clarkson <robert@trash-mail.com>
Thu, 27 Nov 2014 19:26:45 +0000 (20:26 +0100)
During performance optimization I have discovered that the installer scans all files for the blacklisted words. This greatly impacts speed on lower end devices such as the raspberry pie. This commit limits it to PHP files which seems to achieve the desired effect.

I have used the --include option to achieve this, see http://stackoverflow.com/questions/1987926/how-do-i-grep-recursively

This contribution is MIT licensed

lib/private/installer.php

index f43969691c7bfec319000734afd79933877ed821..60ed06ae352efd02e31e91c8d1373364a1880c0d 100644 (file)
@@ -568,7 +568,7 @@ class OC_Installer{
 
                        // iterate the bad patterns
                        foreach($blacklist as $bl) {
-                               $cmd = 'grep -ri '.escapeshellarg($bl).' '.$folder.'';
+                               $cmd = 'grep --include \\*.php -ri '.escapeshellarg($bl).' '.$folder.'';
                                $result = exec($cmd);
                                // bad pattern found
                                if($result<>'') {