Example #1
0
 /**
  * If the comment contains a valid OpenID, skip the check for requiring a name and email address.  Even if
  * this data is provided in the form, we may get it through other methods, so we don't want to bail out
  * prematurely.  After OpenID authentication has completed (and $_SESSION['oid_skip'] is set), we don't
  * interfere so that this data can be required if desired.
  *
  * @param boolean $value existing value of flag, whether to require name and email
  * @return boolean new value of flag, whether to require name and email
  * @see get_user_data
  */
 function bypass_option_require_name_email($value)
 {
     global $openid;
     if ($_REQUEST['oid_skip']) {
         return $value;
     }
     if (array_key_exists('openid_url', $_POST)) {
         if (!empty($_POST['openid_url'])) {
             return false;
         }
     } else {
         if (!empty($_POST['url'])) {
             if (WordPressOpenID_Logic::late_bind()) {
                 // check if url is valid OpenID by forming an auth request
                 $auth_request = WordPressOpenID_Logic::begin_consumer($_POST['url']);
                 if (null !== $auth_request) {
                     return false;
                 }
             }
         }
     }
     return $value;
 }