Hey,
Following the steps detailed in the SEO Checklist module, I submitted my website to the markup validation service here: http://validator.w3.org/
I have some errors that seem related to the Facebook Oauth module. Since I am not a programmer at all, would you mind checking these errors, to see if they are actually related to your code or not?

reference to external entity in attribute value ✉
This is generally the sign of an ampersand that was not properly escaped for inclusion in an attribute, in a href for example. You will need to escape all instances of '&' into '&'.

Line 145, column 123: reference to external entity in attribute value
…client_id=4108XXXXXXXXXXXX&redirect_uri=http%3A//www.example.com/fboauth/con
Line 145, column 173: reference to external entity in attribute value
…w.example.com/fboauth/connect&scope=email%2Cpublish_stream%2Cpublish_stream…

Other error:

general entity X not defined and no default entity ✉
This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

Line 145, column 111: general entity "redirect_uri" not defined and no default entity
…ialog/oauth?client_id=4108XXXXXXXXXXX&redirect_uri=http%3A//www.example.com
Line 145, column 168: general entity "scope" not defined and no default entity
…A//www.example.com/fboauth/connect&scope=email%2Cpublish_stream%2Cpublish_s

Line 145 is here:
<a class="facebook-action-connect" href="https://www.facebook.com/dialog/oauth?client_id=4108XXXXXXXXXXXX&redirect_uri=http%3A//www.example.com/fboauth/connect&<strong>s</strong>cope=email%2Cpublish_stream%2Cpublish_stream"><img src="http://www.facebook.com/images/fbconnect/login-buttons/connect_light_medium_short.gif" alt="" /></a>ou <a href='/user'>Connexion</a> </div>

There are other errors, but for a start, I just wanted to know if it was related to Facebook Oauth module or not.

Comments

quicksketch’s picture

Title: HTML / markup compliance errors » HTML / markup compliance errors (ampersands not encoded properly)
Category: task » bug

Thanks for the report. I've confirmed this problem. While in development I struggled with trying to get all the characters to encode properly. The situation is messy because the query string is encoded, but then inside of that, the redirect location has to be url encoded. The combination of how to get these two different encodings working at the same time has eluded me.

quicksketch’s picture

Priority: Normal » Minor

Moving to minor since this doesn't affect the functionality of the module.

Soundvessel’s picture

I was about to report the issue myself until I found it was already reported. Two ampersands http://screencast.com/t/psVeRJ9tiikU

While functionality is fine remember that standards should be a starting point, not an afterthrought. We don't want these kinds of habits brewing because it is the same kind of slippery slope with IE in the early days that made our lives very difficult for the longest time.

quicksketch’s picture

While functionality is fine remember that standards should be a starting point, not an afterthrought.

If it makes you feel any better, I've spent at least two attempts of an hour each trying to get that URL to pass validation. Like I said in #1, there's multiple layers of encoding happening here. We already encode the URL twice, but apparently a 3rd time is needed somewhere. It's not an afterthought, it's a matter of the inability to get the URL encoded correctly and still have the module functional. Between proper encoding and not have a module at all, I'm sure everyone would prefer to have the module.

I'm sure this is a simple fix, but it's figuring out what that simple fix is that is the challenge. I'd be more than happy to review/commit a patch from anyone that can fix this problem.

revdsgn’s picture

Hi, I've made simple fix for this problem.
In fboauth.module file on line 423 just after the

function theme_fboauth_action__connect($variables) {
  $action = $variables['action'];
  $link = $variables['properties'];
  $url = url($link['href'], array('query' => $link['query']));

I've put simple string replace ;)

$url = preg_replace( "/&(?!amp;)/", "&amp;",  $url  );