dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2798bc6
)
Add wfGenerateToken function, to generate a random hex token. Used in CentralAuth...
author
Andrew Garrett
<werdna@users.mediawiki.org>
Fri, 11 Apr 2008 00:43:13 +0000
(
00:43
+0000)
committer
Andrew Garrett
<werdna@users.mediawiki.org>
Fri, 11 Apr 2008 00:43:13 +0000
(
00:43
+0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
f28d7cf
..
51d0749
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-2502,3
+2502,12
@@
function wfWaitForSlaves( $maxLag ) {
}
}
}
+
+/** Generate a random 32-character hexadecimal token.
+ * @param mixed $salt Some sort of salt, if necessary, to add to random characters before hashing.
+ */
+ function wfGenerateToken( $salt = '' ) {
+ $salt = serialize($salt);
+
+ return md5( mt_rand( 0, 0x7fffffff ) . $salt );
+ }
\ No newline at end of file