Selaa lähdekoodia

Fix for Trac#627: Don't log the parameters in the call stack in case of exception to protect sensitive data.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2476 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 12 vuotta sitten
vanhempi
commit
5b0b28a95d
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      setup/applicationinstaller.class.inc.php

+ 9 - 2
setup/applicationinstaller.class.inc.php

@@ -373,8 +373,15 @@ class ApplicationInstaller
 				'percentage-completed' => 100,
 			);
 			
-			SetupPage::log_error('An exception occurred: '.$e->getMessage());
-			SetupPage::log("Stack trace:\n".$e->getTraceAsString());
+			SetupPage::log_error('An exception occurred: '.$e->getMessage().' at line '.$e->getLine().' in file '.$e->getFile());
+			$idx = 0;
+			// Log the call stack, but log the parameters since they may contain passwords or other sensitive data
+			SetupPage::log("Call stack:");
+			foreach($e->getTrace() as $aTrace)
+			{
+				SetupPage::log("#$idx {$aTrace['file']}({$aTrace['line']}): {$aTrace['function']}(...)");
+				$idx++;
+			}
 		}
 		return $aResult;
 	}