MINOR: added check for exec() and fixed the path for the wordlist file. Ticket #4428

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85701 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2009-09-03 23:36:45 +00:00
parent 43e27fd596
commit ebce107d07
2 changed files with 3 additions and 2 deletions

View File

@ -278,8 +278,9 @@ class Geoip extends Object {
* @param boolean $codeOnly Returns just the country code
*/
static function ip2country($address, $codeOnly = false) {
// Return if in CLI, or you'll get this error: "sh: geoiplookup: command not found"
if(Director::is_cli()) return false;
if(Director::is_cli() || !function_exists('exec')) return false;
$cmd = 'geoiplookup ' . escapeshellarg($address);
exec($cmd, $result, $code);

View File

@ -65,7 +65,7 @@ class Security extends Controller {
*
* @var string
*/
protected static $wordlist = '/usr/share/silverstripe/wordlist.txt';
protected static $wordlist = './wordlist.txt';
/**
* Template thats used to render the pages.