]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Confirm_address::getByAddress not getAddress
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 29 Apr 2017 12:48:46 +0000 (14:48 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 29 Apr 2017 12:48:46 +0000 (14:48 +0200)
Also fixed the error handling to match the function call.

scripts/resend_confirm_address.php

index 1e5bcc1555434b92b5a2266375c877dad3430120..b73246d6ef2450dacfab6bc1797269de3aaaf9e6 100755 (executable)
@@ -33,9 +33,10 @@ $ca = null;
 
 if (have_option('e', 'email')) {
     $email = get_option_value('e', 'email');
-    $ca = Confirm_address::getAddress($email, 'email');
-    if (!$ca instanceof Confirm_address) {
-        print "Can't find email $email in confirm_address table.\n";
+    try {
+        $ca = Confirm_address::getByAddress($email, 'email');
+    } catch (NoResultException $e) {
+        print sprintf("Can't find %s address %s in %s table.\n", $e->obj->address_type, $e->obj->address, $e->obj->tableName());
         exit(1);
     }
 } elseif (have_option('a', 'all')) {