Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Invalid characters in included filename

Quote Reply
Invalid characters in included filename
I open in the category column new column for file that I want to make for it include, the problem is that when I try to call the include I get error that "Invalid characters in included filename", I find that the problem is for security purposes that I can not use / or – when I try to call for a template.
Is there a way to solve this problem?
Quote Reply
Re: [nir] Invalid characters in included filename In reply to
Hi,

Can you give an example?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid characters in included filename In reply to
Yes
I found this treade
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=298571;search_string=Invalid%20characters%20in%20included%20filename;#298571
Quote Reply
Re: [nir] Invalid characters in included filename In reply to
If you just wanna do "including" in a global - something like this should work:

do_custom_include
Code:
sub {
my $file = '/path/to/do/' . $_[0];
my $back;
open(READIT,$file) || die qq|cant find $file. Reason: $!|;
while (<READIT>) { $back .= $_; }
close(READIT);
return $back;
}

Then call with:

<%do_custom_include('filename.html')%>

Untested, but I think that should do what you want =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid characters in included filename In reply to
It's work, but it not run the template variables, I mean the template display the
<%if Contact_Email%><%escape_html Contact_Email%><%endif%>
and not run the command.
Quote Reply
Re: [nir] Invalid characters in included filename In reply to
Sorry, not sure what you mean :/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid characters in included filename In reply to
In the template there are variables like <%Title%><%if%><%else%>, when The template display it show the <%Title%><%if%><%else%> and not the action it need to do.
For example if this is the code in the template-
Name <%Title%>
It will show the same in the site.
Quote Reply
Re: [nir] Invalid characters in included filename In reply to
Hi,

That makes no sense still :/

<%Title%><%if%><%else%>

...is that the actual code you are using?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid characters in included filename In reply to
When you create a template you use Template Syntax to display your content, like for the name of the page you use <%Title%> for the content you use <%Description%>.
The problem is that it shows the Template Syntax on the site and not the actually content of the variables.

I see that in the global there is this code
open(READIT,$file), so it read the file and not compile it; it display the file as it is.
Quote Reply
Re: [nir] Invalid characters in included filename In reply to
Aaah - I think I understand now.

Not sure how that can be done without testing it a bit - but a little busy ATM, so won't be able to take a look today I would think.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!