From 85eca32e16427eb5a28ce17c99de6cae23217161 Mon Sep 17 00:00:00 2001 From: Palma Solutions LTD Date: Mon, 7 May 2018 10:41:21 +0200 Subject: [PATCH] it was not a bug with Drupal7, it was with docroot -fixed --- cms-vss.php | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/cms-vss.php b/cms-vss.php index b2e9b3b..30a743d 100644 --- a/cms-vss.php +++ b/cms-vss.php @@ -222,6 +222,25 @@ foreach(glob("/home/".$argv[1]."/public_html/{**/*,*}".$row[1], GLOB_BRACE) as $ print_r ("location:".$trim); + } + } + +// scripts installed in docroot +foreach(glob("/home/".$argv[1]."/public_html/".$row[1], GLOB_BRACE) as $versionfile){ + + $file = file_get_contents($versionfile); + $pattern = preg_quote($row[2], '/'); + $pattern = "/^.*$pattern.*\$/m"; + if(preg_match_all($pattern, $file, $matches)){ + echo "\n"; + echo "\n".$row[0]." found - (".$row[3]."):\n"; + echo implode("\n", $matches[0]); + echo "\n"; + $location = $versionfile; + $trim = str_replace($row[1], '', $location); + print_r ("location:".$trim); + + } } } @@ -258,6 +277,25 @@ foreach(glob("/home/".$argv[1]."/public_html/{**/*,*}".$raw[1], GLOB_BRACE) as $ } } + + foreach(glob("/home/".$argv[1]."/public_html/".$raw[1], GLOB_BRACE) as $versionfiles){ + + $file = file_get_contents($versionfiles); + $pattern1 = preg_quote($raw[2], '/'); + $pattern2 = preg_quote($raw[3], '/'); + $pattern = "/^.*$pattern1.*\$|^.*$pattern2.*\$/m"; + if(preg_match_all($pattern, $file, $matches)){ + echo "\n"; + echo "\n".$raw[0]." found - (".$raw[4]."):\n"; + echo implode("\n", $matches[0]); + echo "\n"; + $location = $versionfiles; + $trim = str_replace($raw[1], '', $location); + print_r ("location:".$trim); + + } + } + } $versiontriple = array ( array("Joomla 3.8.x", "/libraries/src/Version.php", "const MAJOR_VERSION =", "const MINOR_VERSION =", "const PATCH_VERSION =", "Maintained"), @@ -291,4 +329,24 @@ foreach(glob("/home/".$argv[1]."/public_html/{**/*,*}".$rxw[1], GLOB_BRACE) as $ } } + + foreach(glob("/home/".$argv[1]."/public_html/".$rxw[1], GLOB_BRACE) as $versionfilex){ + + $file = file_get_contents($versionfilex); + $pattern1 = preg_quote($rxw[2], '/'); + $pattern2 = preg_quote($rxw[3], '/'); + $pattern3 = preg_quote($rxw[4], '/'); + $pattern = "/^.*$pattern1.*\$|^.*$pattern2.*\$|^.*$pattern3.*\$/m"; + if(preg_match_all($pattern, $file, $matches)){ + echo "\n"; + echo "\n".$rxw[0]." found - (".$rxw[5]."):\n"; + echo implode("\n", $matches[0]); + echo "\n"; + $location = $versionfilex; + $trim = str_replace($rxw[1], '', $location); + print_r ("location:".$trim); + + } + } + }