mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Merge pull request #670 from Zankaria/remove-polyfill
Remove polyfills for php 5.4 and 5.6
This commit is contained in:
commit
acc284004f
@ -31,7 +31,6 @@
|
|||||||
"inc/mod/auth.php",
|
"inc/mod/auth.php",
|
||||||
"inc/lock.php",
|
"inc/lock.php",
|
||||||
"inc/queue.php",
|
"inc/queue.php",
|
||||||
"inc/polyfill.php",
|
|
||||||
"inc/functions.php"
|
"inc/functions.php"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// PHP 5.4
|
|
||||||
|
|
||||||
if (!function_exists('hex2bin')) {
|
|
||||||
function hex2bin($data) {
|
|
||||||
return pack("H*" , $hex_string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PHP 5.6
|
|
||||||
|
|
||||||
if (!function_exists('hash_equals')) {
|
|
||||||
function hash_equals($ours, $theirs) {
|
|
||||||
$ours = (string)$ours;
|
|
||||||
$theirs = (string)$theirs;
|
|
||||||
|
|
||||||
$tlen = strlen($theirs);
|
|
||||||
$olen = strlen($ours);
|
|
||||||
|
|
||||||
$answer = 0;
|
|
||||||
for ($i = 0; $i < $tlen; $i++) {
|
|
||||||
$answer |= ord($ours[$olen > $i ? $i : 0]) ^ ord($theirs[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $answer === 0 && $olen === $tlen;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user