mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
create_date function needs to use gmdate in order to output a correct date.
git-svn-id: file:///svn/phpbb/trunk@177 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5654680b5b
commit
4952eb77d0
1 changed files with 51 additions and 50 deletions
|
@ -394,18 +394,19 @@ function generate_activation_key()
|
|||
function encode_ip($dotquad_ip)
|
||||
{
|
||||
$ip_sep = explode(".", $dotquad_ip);
|
||||
// return sprintf("%02x%02x%02x%02x", $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
|
||||
$return = sprintf("%02x%02x%02x%02x", $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
|
||||
|
||||
return (( $ip_sep[0] * 0xFFFFFF + $ip_sep[0] ) + ( $ip_sep[1] * 0xFFFF + $ip_sep[1] ) + ( $ip_sep[2] * 0xFF + $ip_sep[2] ) + ( $ip_sep[3] ) );
|
||||
//return (( $ip_sep[0] * 0xFFFFFF + $ip_sep[0] ) + ( $ip_sep[1] * 0xFFFF + $ip_sep[1] ) + ( $ip_sep[2] * 0xFF + $ip_sep[2] ) + ( $ip_sep[3] ) );
|
||||
return($return);
|
||||
}
|
||||
|
||||
function decode_ip($int_ip)
|
||||
{
|
||||
$hexipbang = explode(".",chunk_split($int_ip, 2, "."));
|
||||
|
||||
// return hexdec($hexipbang[0]).".".hexdec($hexipbang[1]).".".hexdec($hexipbang[2]).".".hexdec($hexipbang[3]);
|
||||
return hexdec($hexipbang[0]).".".hexdec($hexipbang[1]).".".hexdec($hexipbang[2]).".".hexdec($hexipbang[3]);
|
||||
|
||||
return sprintf( "%d.%d.%d.%d", ( ( $int_ip >> 24 ) & 0xFF ), ( ( $int_ip >> 16 ) & 0xFF ), ( ( $int_ip >> 8 ) & 0xFF ), ( ( $int_ip ) & 0xFF ) );
|
||||
//return sprintf( "%d.%d.%d.%d", ( ( $int_ip >> 24 ) & 0xFF ), ( ( $int_ip >> 16 ) & 0xFF ), ( ( $int_ip >> 8 ) & 0xFF ), ( ( $int_ip ) & 0xFF ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -414,6 +415,6 @@ function decode_ip($int_ip)
|
|||
//
|
||||
function create_date($format, $gmepoch, $tz)
|
||||
{
|
||||
return (date($format, $gmepoch + (3600 * $tz)));
|
||||
return (gmdate($format, $gmepoch + (3600 * $tz)));
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue