[solved] Little bug in page_params plugin

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

[solved] Little bug in page_params plugin

Post by Holger » Thu Feb 25, 2010 9:27 am

Hi,

there's a little bug in page_params plugin:
If the /templates (root-)folder contains files, like a .htaccess, this files are listed as a selectable template in the dropdownlist within the plugin-tab.

The bug is in line 113 of page_params_view.php (latest version):

Code: Select all

if($file != "." && $file != "..") { 
Maybe it's enough to add a "is_dir($file)" to that line, since only subfolders are valid entrys.


Holger

BTW: Should I report issues/bugs here at the board or should I open a ticket on SF or maybe should I do both?
What's the best way?

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: Little bug in page_params plugin

Post by johnjdoe » Thu Feb 25, 2010 9:56 am

Holger wrote: there's a little bug in page_params plugin:
If the /templates (root-)folder contains files, like a .htaccess, this files are listed as a selectable template in the dropdownlist within the plugin-tab.

The bug is in line 113 of page_params_view.php (latest version):

Code: Select all

if($file != "." && $file != "..") { 
Yeap, I saw it too. Thanks for posting, Holger!

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: Little bug in page_params plugin

Post by Gert » Thu Feb 25, 2010 5:21 pm

Holger wrote:Maybe it's enough to add a "is_dir($file)" to that line, since only subfolders are valid entrys.
This line works (after some tests):

Code: Select all

        if($file != "." && $file != ".." && is_dir($pth['folder']['templates'].$file) == 'true') { 
is_dir() needs the path ...
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Little bug in page_params plugin

Post by Holger » Thu Feb 25, 2010 7:37 pm

Of course, but I think that's the right way:

Code: Select all

if(is_dir($pth['folder']['templates'].$file) && $file != "." && $file != "..") { 
Holger

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [solved] Little bug in page_params plugin

Post by Holger » Fri Feb 26, 2010 10:09 am

Fixed with CMSimple_XH 1.1.1

Holger

Post Reply