mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-01 08:59:42 +02:00
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:
parent
43e27fd596
commit
ebce107d07
|
@ -278,8 +278,9 @@ class Geoip extends Object {
|
||||||
* @param boolean $codeOnly Returns just the country code
|
* @param boolean $codeOnly Returns just the country code
|
||||||
*/
|
*/
|
||||||
static function ip2country($address, $codeOnly = false) {
|
static function ip2country($address, $codeOnly = false) {
|
||||||
|
|
||||||
// Return if in CLI, or you'll get this error: "sh: geoiplookup: command not found"
|
// 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);
|
$cmd = 'geoiplookup ' . escapeshellarg($address);
|
||||||
exec($cmd, $result, $code);
|
exec($cmd, $result, $code);
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Security extends Controller {
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected static $wordlist = '/usr/share/silverstripe/wordlist.txt';
|
protected static $wordlist = './wordlist.txt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Template thats used to render the pages.
|
* Template thats used to render the pages.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user