Missing quotation mark in .htaccess line

plates - July 10, 2008 - 22:14
Project:Drupal
Version:7.x-dev
Component:base system
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

In the .htaccess file provided with 6.3 (and also 6.x-dev and 7.x-dev, but not 5.8), there is a line that reads:

<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

As you can see, it's missing the ending quotation mark. I'm not sure if this makes a difference or not, but it's throwing the color syntax highlighter of my text editor off.

#1

-Anti- - July 10, 2008 - 22:47

I've got a default htaccess from 6.2 and 6.3, and they don't have that line.
A module must have added it?

#2

plates - July 10, 2008 - 23:45

No, a module did not add it. This is straight from the download page off of drupal.org, and you can see it here:

http://cvs.drupal.org/viewvc.py/drupal/drupal/.htaccess?revision=1.94&vi...

#3

BENNYSOFT - July 12, 2008 - 15:23
Status:active» by design

It's not a bug.

Apache 1.3:

ErrorDocument 403 "Sorry can't allow you access today

Messages in this context begin with a single double-quote character (") ...

Apache 2.0

ErrorDocument 403 "Sorry can't allow you access today"

Prior to version 2.0, messages were indicated by prefixing them with a single unmatched double quote character.

#4

gpk - August 19, 2008 - 10:52

#5

Ognyan Kulev - August 19, 2008 - 13:21
Status:by design» needs review

I propose the following lines to be added after this ErrorDocument. Fixes vim highlighting and probably others. Patch is attached.

#" This quote makes editors syntax highlighting happy
# and ErrorDocument of both Apache 1.3 and 2.x is still supported.

AttachmentSize
htaccess-errordocument-quote.diff 451 bytes
Testbed results
htaccess-errordocument-quote.diffpassedPassed: 7386 passes, 0 fails, 0 exceptions a href=http://testing.drupal.org/pifr/file/1/htaccess-errordocument-quote.diffDetailed results/a

#6

Junyor - September 23, 2008 - 04:51
Status:needs review» reviewed & tested by the community

Proposed fix works for me in TextMate. Patch applies cleanly, too.

#7

Gábor Hojtsy - September 23, 2008 - 10:57
Version:6.3» 7.x-dev

I'd guess that an editor with a better parser would not consider a quotation mark in a comment as ending one before the comment (unless .htaccess allows for multiline text, in which case the #line might as well be part of the message). I am passing this on to 7.x for debate.

#8

webchick - September 23, 2008 - 23:50

I'm not real eager to commit this, personally. It's a minor annoyance that only applies to a few select text editors out there, in a file that is hardly ever opened by anyone.

Though we could probably use a comment there that says "This is not a bug" since this has come up at least twice now.

#9

Dries - September 27, 2008 - 20:14
Status:reviewed & tested by the community» needs work

Yep, let's just add a comment explaining that this is not a bug.

#10

Gábor Hojtsy - September 28, 2008 - 08:36

Also note that the less changes we make to the .htaccess, robots.txt, etc. files in a stable version, the less hassle for our users. Lots of our users make custom modifications to these files, and releasing a new .htaccess just to add a syntax highlight fix for vim does not seem like the best idea to me to bother people to diff with .htaccess files while updating their Drupal 6. One more thing to think about.

#11

Damien Tournoud - September 28, 2008 - 10:06

I silently marked #291336: ErrorDocument in .htaccess is missing closing quote, #297024: htacces missing dbl quote in string and #290356: Add end quote to ErrorDocument 404 for favicon.ico as a duplicate of this one during the last few weeks. I'm a little fed up by the issue, so let's add a comment for this.

#12

gpk - September 28, 2008 - 15:18

@10 - I've been thinking for a while that it would be really useful on each Drupal release page to make clear which of the customisable files in core (.htaccess, robots.txt, settings.php ... are there any others?) have actually changed (or if any changes are substantive). Frequently these don't change between minor releases so you can use an existing modified copy from the previous version if necessary. I think that being absolutely clear to users about whether .htaccess etc. from their current installation can be used, or not, would greatly reduce confusion and potentially make upgrading easier, therefore we would see fewer sites running old versions. Personally, I use cvs.d.o to check for any changes in these files but I doubt most people do that.

Any thoughts (apart from the fact that this needs a new issue somewhere, not sure where!)?

#13

arhak - November 27, 2008 - 16:17

I recall reading upgrade paths stating no htaccess change is required so I can keep the modified old one
with that being clear on each release would be enough (even it might be stated that there were minor changes, but only aesthetic ones)

it seems to me that being an infrequently visited file is not a valid argument, since it might be otherwise a pro argument, visiting the file should be clean and self-explanatory and with the most common editors

if adding such a comment would fix some editors' highlighting I think it should be added
is just a comment that will not harm and will document a backward compatibility issue (two birds in one shot)

those who have customized htaccess will keep their versions
those who complained about the unmatching quote would have an explanation
those who doesn't care about Apache 1.3 might simply close the quote
those with highlighting problems will be happy

no harm, all pros, right?

#14

webchick - November 27, 2008 - 17:53

No, we don't include workarounds in core for various text editors' quirks. If we did, we'd also include vim modelines and stuff like that... it would be a giant mess.

Still awaiting a patch that explains this is by design, to help cut down on future duplicate bug reports.

#15

Damien Tournoud - November 27, 2008 - 18:51
Status:needs work» needs review

Ok, lets get this committed, I'm fed up of having to mark duplicate issues.

AttachmentSize
281131-missing-quotation-mark.patch 1.04 KB
Testbed results
281131-missing-quotation-mark.patchpassedPassed: 7386 passes, 0 fails, 0 exceptions Detailed results

#16

keith.smith - November 27, 2008 - 19:22
Status:needs review» needs work

The patch also ups the PostgeSQL version.

+  # There is voluntary no end quote below, for compatibility with Apache 1.3

I'm not sure "voluntary" is needed; seems like this line would be fine without that word.

#17

Damien Tournoud - November 27, 2008 - 19:25

Oups.

AttachmentSize
281131-missing-quotation-mark.patch 566 bytes
Testbed results
281131-missing-quotation-mark.patchpassedPassed: 7431 passes, 0 fails, 0 exceptions Detailed results

#18

keith.smith - November 27, 2008 - 19:29
Status:needs work» reviewed & tested by the community

Looks good.

#19

Dries - November 28, 2008 - 09:40
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD and DRUPAL-6. Thanks.

#20

System Message - December 12, 2008 - 09:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.