Skip to content

Commit

Permalink
Fix for IP Class that assumes a table name and IP address not getting…
Browse files Browse the repository at this point in the history
… set for session created at end of install

For issue #1130
  • Loading branch information
eSilverStrike committed Jun 17, 2022
1 parent ac6d364 commit a85f812
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions public_html/lib-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
global $_DB_dbms; // Needed for when Geeklog Core language file is included by lib-common
global $LANG32; // Some Plugin language files include a reference to this array
global $LANG27; // Some lib-topic and TOPIC_buildTree. It needs this language file

// *********************************************************
}

Expand Down Expand Up @@ -241,9 +240,7 @@
$_PAGE_TIMER->startTimer();

// Initialize IP class
if (!defined('GL_INSTALL_ACTIVE')) {
\Geeklog\IP::init($_TABLES['ip_addresses'], $_CONF['ip_anonymization']);
}
\Geeklog\IP::init($_TABLES['ip_addresses'], $_CONF['ip_anonymization']);

/**
* This provides optional URL rewriting functionality.
Expand Down Expand Up @@ -9754,9 +9751,7 @@ function COM_simpleOptionList(array $pairs, $selectedValue, $asArray = false)
DB_query("UPDATE {$_TABLES['vars']} SET value=UNIX_TIMESTAMP() WHERE name='last_scheduled_run'");
PLG_runScheduledTask();

if (!defined('GL_INSTALL_ACTIVE')) {
\Geeklog\IP::updateIPAddressesTable();
}
\Geeklog\IP::updateIPAddressesTable();
}
}

Expand Down
4 changes: 2 additions & 2 deletions system/classes/IP.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class IP
/**
* @var string
*/
private static $ipAddressTable = 'gl_ip_addresses';
private static $ipAddressTable = '';

/**
* @var int
Expand All @@ -52,7 +52,7 @@ abstract class IP
* @param string $ipAddressTable
* @param int $anonymizationPolicy
*/
public static function init($ipAddressTable = 'gl_ip_addresses', $anonymizationPolicy = self::POLICY_NEVER_ANONYMIZE)
public static function init($ipAddressTable, $anonymizationPolicy = self::POLICY_NEVER_ANONYMIZE)
{
if (!self::$isInitialized) {
self::$ipAddressTable = $ipAddressTable;
Expand Down

0 comments on commit a85f812

Please sign in to comment.