Bugs: Browse | Submit New | Admin

[#4163] 'include' command doesn't allow directory separator in the filename

Date:
2006-04-19 08:45
Priority:
3
Submitted By:
Brian Tarricone (kelnos)
Assigned To:
Brian Wisti (brianwisti)
Category:
None
State:
Open
Summary:
'include' command doesn't allow directory separator in the filename

Detailed description
So things like:
[%include global/header.html%]
won't work.

Changing line 382 of parser.rb to:
/^include (([\w\/\\]+)(?:\.\w+\??)*)$/i
seems to work (add both '/' and '\' so it'll work on win32 as well).

Though that doesn't completely fix the problem.  While filenames like 'globals/header.html' will work now, filenames
like 'foo.bar/file' won't work anymore, because it tries to match the 'extension' part, and doesn't like that there's
a '/' in there.  So maybe:
/^include (([\w\/\\]+)(?:\.[\w+\/\\]\??)*)$/i
will fix that properly, but I'm not sure as it's the right fix, as I'm not entirely sure what you're doing with the
latter half of that expression.

(BTW, I'm using version 2.2.0.)

Also, in htglossary.rb, there's:
/^tmpl_include (?:name=|file=)?"?((\w+)(?:\.\w+\??)*)"?$/i
I'm not sure if thie needs to be modified as well.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-06-21 00:10
Sender: Brian Wisti

Near as I can tell, this is working okay in CVS, maybe even in
2.2.2. Please let me know if this is still an issue for you.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
resolution_idNone2006-06-21 00:10brianwisti
assigned_tonone2006-06-21 00:10brianwisti