summaryrefslogtreecommitdiff
path: root/www/gpg.php
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-01-20 22:35:35 +0100
committerBenny Baumann <BenBE@geshi.org>2015-01-20 22:35:35 +0100
commitff20ab4b121be49c53da3b53aa09f87e0e14cb1f (patch)
treea2fd7d5e131182731c176654025fa3a32ffd4e17 /www/gpg.php
parent8b0230a357ffdd904457b408aa1f4621b4b5a9e7 (diff)
parent1b84a19e599e5cf311a7950f955ae61fbff8a015 (diff)
downloadcacert-devel-ff20ab4b121be49c53da3b53aa09f87e0e14cb1f.tar.gz
cacert-devel-ff20ab4b121be49c53da3b53aa09f87e0e14cb1f.tar.xz
cacert-devel-ff20ab4b121be49c53da3b53aa09f87e0e14cb1f.zip
Merge branch 'bug-1354' into testserver-stable
Diffstat (limited to 'www/gpg.php')
-rw-r--r--www/gpg.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/www/gpg.php b/www/gpg.php
index b3a4787..4e05a88 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -455,11 +455,16 @@ function verifyName($name)
{
if($name == "") return 0;
- $q = mysql_query("SELECT CONVERT(fname USING UTF8), CONVERT(mname USING UTF8), CONVERT(lname USING UTF8), CONVERT(suffix USING UTF8) FROM users WHERE id='" . intval($_SESSION["profile"]["id"]) . "'");
+ $q = mysql_query("SELECT HEX(CONVERT(users.fname USING utf8)) as fname, HEX(CONVERT(users.mname USING utf8)) as mname, HEX(CONVERT(users.lname USING utf8)) as lname, HEX(CONVERT(users.suffix USING UTF8)) as suffix FROM users WHERE id='" . intval($_SESSION["profile"]["id"]) . "'");
if( false === ($row = mysql_fetch_assoc($q)) ) {
return 0;
}
+ $row['fname'] = hex2bin($row['fname']);
+ $row['mname'] = hex2bin($row['mname']);
+ $row['lname'] = hex2bin($row['lname']);
+ $row['suffix'] = hex2bin($row['suffix']);
+
if(compareName($name, $row['fname']." ".$row['lname'])) return 1; // John Doe
if(compareName($name, $row['fname']." ".$row['mname']." ".$row['lname'])) return 1; // John Joseph Doe
if(compareName($name, $row['fname']." ".$row['mname'][0]." ".$row['lname'])) return 1; // John J Doe