Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
f9022924
Commit
f9022924
authored
Feb 24, 2016
by
Daniel Ruf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added hash_equals polyfill for old PHP versions
parent
2e1f5aa3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
qa-base.php
qa-include/qa-base.php
+14
-0
No files found.
qa-include/qa-base.php
View file @
f9022924
...
@@ -203,6 +203,20 @@
...
@@ -203,6 +203,20 @@
require_once
QA_INCLUDE_DIR
.
'vendor/password_compat.php'
;
require_once
QA_INCLUDE_DIR
.
'vendor/password_compat.php'
;
}
}
// http://php.net/manual/en/function.hash-equals.php#115635
if
(
!
function_exists
(
'hash_equals'
))
{
function
hash_equals
(
$str1
,
$str2
)
{
if
(
strlen
(
$str1
)
!=
strlen
(
$str2
))
{
return
false
;
}
else
{
$res
=
$str1
^
$str2
;
$ret
=
0
;
for
(
$i
=
strlen
(
$res
)
-
1
;
$i
>=
0
;
$i
--
)
$ret
|=
ord
(
$res
[
$i
]);
return
!
$ret
;
}
}
}
// http://stackoverflow.com/a/18277167
// http://stackoverflow.com/a/18277167
function
ipv6_numeric
(
$ip
)
{
function
ipv6_numeric
(
$ip
)
{
$binNum
=
''
;
$binNum
=
''
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment