@itarato tweeted this validation URL which shows we have 50 errors and 42 warnings on the drupal.org front page, mostly due to the contributor links block URLs not being properly escaped. http://validator.w3.org/check?uri=http%3A%2F%2Fdrupal.org&charset=%28det...
Looking at the drupalorg_project code, it does indeed not run check_url() on URLs when they are about to be printed to HTML output. Patch for HEAD, DRUPAL-6--1 needs a similar patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | drupalorg-HEAD-invalid-html-704376-12.patch | 8.41 KB | mikey_p |
| #11 | invalid_html-704376-11.patch | 7.49 KB | mikey_p |
| #10 | invalid_html-704376-10.patch | 6.74 KB | mikey_p |
| check-url.patch | 3.5 KB | gábor hojtsy |
Comments
Comment #1
Coornail commentedSubscribe!
Comment #2
gábor hojtsyOh, and for the record, I wrote this code generating the buggy URLs.
Comment #3
dwwA) Why not just add the check_url() inside drupalorg_project_issue_url() instead of duplicating it at all the call sites? Do we ever need these URLs *not* escaped?
B) We also need a patch for DRUPAL-6--1 branch (which has totally different code organization and function names) since HEAD is just for the redesign and D6--1 is for d.o production.
Comment #4
damien tournoud commentedThis code is very ugly. Could we use theme('item_list') *and* l() here, instead of hard-coding the HTML? :)
Comment #5
gábor hojtsy@dww: yes, we use those URLs as HTTP redirects as well, in which case this escaping would not be desirable. I've explore that path, and run into this problem.
@dww: so you'd like to see both patches at once?
Comment #6
dww@Gabor: re: always escaping -- duly noted, thanks. re: both patches: yes, definitely. since this project is branched, we definitely need to keep both branches in sync to avoid regressions. I'm sure you're familiar with the concept. ;)
@DamZ: agreed, this code is pretty nuts. ;) Cleaning it to properly use our APIs would solve the escaping problems, too. There are a bunch of issues relating to this same block that would be nice to fix once the fundamentals were sound:
#703662: Configurable issue counts
#483848: Core Bug Bingo brought me to an 'access denied' page
#383356: Fix core-related issue counts and links to use the version=7.x views filter
#335828: Bug Bingo for specific versions if the user specifies it (I care less about this one)
So, I suggest we re-write the block to be built in a more sane way, get that into both branches, and then go through and quickly fix the rest of these (most of which are tiny patches, but all of which are going to conflict like crazy with this issue).
Thanks,
-Derek
Comment #7
gábor hojtsy@dww: I'm familiar with committing to HEAD first and then working on backport patches.
I don't have capacity to work on rewriting the block code in the branches though, I was interested in fixing the bug at hand.
Comment #8
dww@Gabor: please lighten up. ;) I know you're familiar with the process, that's why I made the joke in the first place (partly to point out the fallacy of that whole policy in general).
Anyway, the "bug at hand" is d.o production, which is DRUPAL-6--1. It wasn't my choice to radically fork the code for this module by reorganizing everything after we branched for D6 production on d.o. I would have much preferred to do all that before branching production from the redesign work. But alas, no one asked me, so now we're stuck with basically doing twice as much work for 95% of the changes in this module. Such is the price to pay for these sorts of decisions... So, if you don't want to bother with the HEAD patch and leave this issue as "to be ported", that's fine, but to fix the current bug, we need a patch for DRUPAL-6--1.
Comment #9
mikey_p commentedLooks like we don't want to change the behavior of drupalorg_project_issue_url since it's used to generate the location for some redirects, such as http://drupal.org/node/9730, http://drupal.org/node/9731, and http://drupal.org/node/9732. This means we can either use static HTML in some of the places, such as the contributor block, or add another function for generating links.
Comment #10
mikey_p commentedHere's a patch for HEAD (DRUPAL-6--1 patch on the way) that cleans this up and adds a new function for links vs. urls. Note that this depends on the patch from #853092: Add new links for Drupal 7 issues to HEAD to be applied first.
Comment #11
mikey_p commentedHere's the same patch against DRUPAL-6--1.
Comment #12
mikey_p commentedHere's a fix for the patch against HEAD that didn't apply.
Comment #13
hunmonk commentedfixed up some small issues with both patches, commited each to the appropriate branch.