diff options
author | Alpha <ngcoder@live.com> | 2015-07-23 15:53:54 -0400 |
---|---|---|
committer | Alpha <ngcoder@live.com> | 2015-07-23 15:53:54 -0400 |
commit | 8c5cddb9712a24eab606e4ed7c5affcdc8dac5c6 (patch) | |
tree | 953366b215cb32e7a983f61cb56af1face62b1e7 | |
parent | 82cd41b2a7f154a7ade5b01a62c30fb244ece4ac (diff) | |
parent | 6d8a60d0fb122b996c0291d466c80ff95fa5c104 (diff) | |
download | webgrind-8c5cddb9712a24eab606e4ed7c5affcdc8dac5c6.zip webgrind-8c5cddb9712a24eab606e4ed7c5affcdc8dac5c6.tar.gz webgrind-8c5cddb9712a24eab606e4ed7c5affcdc8dac5c6.tar.bz2 |
Merge pull request #59 from vlakoff/quotes
Add quotes around python and dot path if needed
-rw-r--r-- | index.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -157,6 +157,13 @@ try { $filename = Webgrind_Config::storageDir().$dataFile.'-'.$showFraction.Webgrind_Config::$preprocessedSuffix.'.'.Webgrind_Config::$graphImageType; if (!file_exists($filename)) { + // Add enclosing quotes if needed + foreach (array('pythonExecutable', 'dotExecutable') as $exe) { + $item =& Webgrind_Config::$$exe; + if (strpos($item, ' ') !== false && !preg_match('/^".+"$/', $item)) { + $item = '"'.$item.'"'; + } + } shell_exec(Webgrind_Config::$pythonExecutable.' library/gprof2dot.py -n '.$showFraction.' -f callgrind '.Webgrind_Config::xdebugOutputDir().''.$dataFile.' | '.Webgrind_Config::$dotExecutable.' -T'.Webgrind_Config::$graphImageType.' -o ' . $filename); } readfile($filename); |