Small change to make code validate better

atuyo60 - January 16, 2008 - 16:51
Project:Audio
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Although the embed tag will still cause your page to invalidate, you can add this line:

$flashvars = str_replace ('&','&',$flashvars);

below $flashvars = audio_query_string_encode($options); in the player include files for extended, slim and button

While you are at it, add a closing / to the line like this <param name="FlashVars" value="$flashvars" /> for the extended and button include files

#1

drewish - January 23, 2008 - 04:34

committed the attached to HEAD and DRUPAL-5

AttachmentSize
audio_210723.patch 1.35 KB

#2

drewish - January 23, 2008 - 04:38
Status:active» postponed (maintainer needs more info)

not sure what the $flashvars = str_replace ('&','&amp;',$flashvars); bit should do....

#3

atuyo60 - January 23, 2008 - 17:14

mm... it just replaces the & to &amp; as required by w3c standards..

#4

zirafa - January 23, 2008 - 19:14

The topic of ampersand usage is directly related to:

http://drupal.org/node/147888

The short of it is that when sending variables into flashvars, it gets tricky if one of those variables itself has a query string. You can see there would need to be some way to delineate between the ampersand separating the flash variables and the internal ampersand used in one of the variables (such as an URL to an audio file).

I think any patch that tries and fix w3c validation on that would also need to address the problem of internal ampersands.

#5

mgifford - December 11, 2008 - 22:16

Any more thoughts on getting this to validate better. Accessibility is becoming an increasingly important issue.

#6

mgifford - January 20, 2009 - 21:11

zirafa, should the URL be passed through audio_feeds_query_string_encode() to ensure that there are no hanging '&' characters? The missing '/' was easy to add, but I'm not sure that there has been much else here to go on.

How do we ensure that this module respects w3c validation? Seems to me that embed is a problem as are the use of height/width & flashvars attributes.

A quick view of the validation errors I see at the moment are here. This is just from our site's home page.

 
 

Drupal is a registered trademark of Dries Buytaert.