]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/openidlogin.php
debugging for addopenid problem
[quix0rs-gnu-social.git] / actions / openidlogin.php
index a9fbf7a26dda7b6813f3a86bdc5a0c6fbfa6464e..9b0b1793ca850684f68b3375183468f1c8debb0c 100644 (file)
@@ -55,10 +55,6 @@ class OpenidloginAction extends Action {
                # XXX: form token in $_SESSION to prevent XSS
                # XXX: login throttle
                $openid_url = $this->trimmed('openid_url');
-               if (!common_valid_http_url($openid_url)) {
-                       $this->show_form(_t('OpenID must be a valid URL.'));
-                       return;
-               }
 
                $consumer = oid_consumer();
 
@@ -113,7 +109,12 @@ class OpenidloginAction extends Action {
                        $form_id = 'openid_message';
                        $form_html = $auth_request->formMarkup($trust_root, $process_url,
                                                                                                   false, array('id' => $form_id));
-
+                       
+                       # XXX: This is cheap, but things choke if we don't escape ampersands
+                       # in the HTML attributes
+                       
+                       $form_html = preg_replace('/&/', '&', $form_html);
+                       
                        // Display an error if the form markup couldn't be generated;
                        // otherwise, render the HTML.
                        if (Auth_OpenID::isFailure($form_html)) {
@@ -128,7 +129,7 @@ class OpenidloginAction extends Action {
                                common_element('script', NULL,
                                                           '$(document).ready(function() { ' .
                                                           '    $("#'. $form_id .'").submit(); '.
-                                                          '}');
+                                                          '});');
                                common_show_footer();
                        }
                }