Hi, i've got a similar problem like user Fish.666. When i try to install this mod there's an error with ./Sources/QueryString.php. Any ideas?
Code: (Find) [Select]
?>
Code: (Add Before) [Select]
// Working with them as if they where IPv4 numbers, makes it SMF compatible.
function smf_ipv6_to_ints($ip)
{
// Expand the IP out.
$ip = explode(':', smf_ipv6_expand($ip));
$new_ip = array();
foreach ($ip as $int)
$new_ip[] = hexdec($int);
return implode($new_ip, '-');
}
/**
* IPv6 Address Functions for PHP
*
* Functions to manipulate IPv6 addresses for PHP
*
* Copyright (C) 2009 Ray Patrick Soucy
*
* LICENSE:
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package inet6
* @author Ray Soucy <
rps@soucy.org>
* @version 1.0.1
* @copyright 2009 Ray Patrick Soucy
* @link
http://www.soucy.org/ [nofollow] * @license GNU General Public License version 3 or later
* @since File available since Release 1.0.1
*/
function smf_ipv6_expand($addr, $strict_check = true)
{
/* Check if there are segments missing, insert if necessary */
if (strpos($addr, '::') !== false)
{
$part = explode('::', $addr);
$part[0] = explode(':', $part[0]);
$part[1] = explode(':', $part[1]);
$missing = array();
for ($i = 0; $i < (8 - (count($part[0]) + count($part[1]))); $i++)
array_push($missing, '0000');
$missing = array_merge($part[0], $missing);
$part = array_merge($missing, $part[1]);
}
else
$part = explode(":", $addr);
/* Pad each segment until it has 4 digits */
foreach ($part as &$p)
while (strlen($p) < 4)
$p = '0' . $p;
unset($p);
/* Join segments */
$result = implode(':', $part);
/* Quick check to make sure the length is as expected */
if (!$strict_check || strlen($result) == 39)
return $result;
else
return false;
}