BUGFIX Fail silently on shell_exec() in CSSContentParser to avoid unit test failures because of missing optional libraries like tidy (merged from branches/2.3-nzct)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82056 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-16 23:46:24 +00:00
parent f512347e33
commit 25544b1f42

View File

@ -34,7 +34,7 @@ class CSSContentParser extends Object {
$tidy->cleanRepair(); $tidy->cleanRepair();
$tidy = str_replace('xmlns="http://www.w3.org/1999/xhtml"','',$tidy); $tidy = str_replace('xmlns="http://www.w3.org/1999/xhtml"','',$tidy);
$tidy = str_replace(' ','',$tidy); $tidy = str_replace(' ','',$tidy);
} elseif(`which tidy`) { } elseif(@shell_exec('which tidy')) {
// using tiny through cli // using tiny through cli
$CLI_content = escapeshellarg($content); $CLI_content = escapeshellarg($content);
$tidy = `echo $CLI_content | tidy -n -q -utf8 -asxhtml 2> /dev/null`; $tidy = `echo $CLI_content | tidy -n -q -utf8 -asxhtml 2> /dev/null`;