Remove the few instances of call-time pass-by-reference for PHP 5.4+ compatibility (http://php.net/manual/en/language.references.pass.php)

This commit is contained in:
moparisthebest 2014-07-01 00:56:09 -04:00
parent 5fc9f70a7d
commit b4dd94ead0
4 changed files with 6 additions and 6 deletions

View File

@ -67,7 +67,7 @@ function display_table($online, $where, $num_servers = null) {
close_mysql();
}
function getPageIndex($where, $start, $num_per_page, $num_servers, $online) {
function getPageIndex($where, $start, $num_per_page, &$num_servers, $online) {
if ($num_servers == null) {
global $g_mysqli;
$stmt = $g_mysqli->prepare("SELECT COUNT(*) FROM `servers` WHERE " . $where) or debug($g_mysqli->error);
@ -85,11 +85,11 @@ function getPageIndex($where, $start, $num_per_page, $num_servers, $online) {
elseif ($num_servers <= $num_per_page)
return null;
else
return ss_constructPageIndex($_SERVER['PHP_SELF'], &$start, $num_servers, $num_per_page, $online);
return ss_constructPageIndex($_SERVER['PHP_SELF'], $start, $num_servers, $num_per_page, $online);
}
function echoTable($class, $where, $order_by, $online = 1, $start = 0, $num_per_page = 30, $num_servers = null, $sponsHadRows = true) {
$pageindex = getPageIndex($where, $start, $num_per_page, &$num_servers, $online);
$pageindex = getPageIndex($where, $start, $num_per_page, $num_servers, $online);
// only echo table if there are results
if ($pageindex === 0 && $class == "Spons")
return false;

View File

@ -117,7 +117,7 @@ function register2() {
$rs_pass = randString($g_allowed_key);
$verified = 1;
if (!verifyIP($ip, &$resolved_ip, &$remote_ip)) {
if (!verifyIP($ip, $resolved_ip, $remote_ip)) {
$verified = 0;
global $thispage, $g_admin_contact;
$verify_url = $thispage . "?action=verify&amp;server=$ip&amp;key=$key";

View File

@ -118,7 +118,7 @@ function stripUnAllowed($s, $allowed) {
return str_replace(' ', '', $s);
}
function verifyIP($hostname, $ip, $remote_ip) {
function verifyIP($hostname, &$ip, &$remote_ip) {
$ip = gethostbyname($hostname);
$remote_ip = $_SERVER['REMOTE_ADDR'];
return $ip == $remote_ip;

View File

@ -36,7 +36,7 @@ function verify() {
writeToFile("server: $server key: $key");
if (verifyIP($server, &$ip, &$remote_ip)) {
if (verifyIP($server, $ip, $remote_ip)) {
echo "Success: $server resolves to $ip, which matches your ip, $remote_ip.\n";
writeToFile("Success: $server resolves to $ip, which matches your ip, $remote_ip.");
} else {