Possible bug? Or just situational weirdness...

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 6, 2009   (RSS)

By InHouse - May 5, 2009 - edited: May 6, 2009

A client using CMSB 2.28 has a list of articles as content. The URL to call up a specific article in full on the page looks like...

domain.com/tips.php?Getting your [three] dots in a row… -7

Note the ellipses at the end of the title which is used in the URL. Have tried replacing these with middots and horizontal ellipse special strings. All results are the same. The correct article loads but throws an error at the top of the page (where the SQL is parsed):

Warning: urlencode() expects parameter 1 to be string, array given in /home/accountname/public_html/cmsAdmin/lib/viewer_functions.php on line 442
Warning: urlencode() expects parameter 1 to be string, array given in /home/accountname/public_html/cmsAdmin/lib/viewer_functions.php on line 442
Warning: urlencode() expects parameter 1 to be string, array given in /home/accountname/public_html/cmsAdmin/lib/viewer_functions.php on line 442
Warning: urlencode() expects parameter 1 to be string, array given in /home/accountname/public_html/cmsAdmin/lib/viewer_functions.php on line 442


The title is a bare text field in the Section Editor. I realize this is weird situation but if anyone has a suggestion to address this then I'm all ears!

Cheers,
J.

Re: [InHouse] Possible bug? Or just situational weirdness...

By Dave - May 6, 2009

Hi J,

Good find! It's happening because PHP treats input in a special way when it sees square brackets [] in the url. It turns the input into an array which CMSB isn't expending.

Here's a fix (and I'll include this in the next version):
- Open lib/viewer_functions.php
- Backup this file first
- Then search for this: $_REQUEST as
- and add the line in red after every instance you find:

foreach ($_REQUEST as $key => $value) {
if (is_array($value)) { continue; } // skip multi value php fields


Hope that helps! Let me know if that fixes it for you or if you have any other problems with it.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Possible bug? Or just situational weirdness...

By InHouse - May 6, 2009

Got it in one as ever Dave!

That appears to have solved the problem. Found four instances of the $_REQUEST string and appended the new line. Problem gone.

I also appreciate the explanation of the issue. It helps me understand the product that much better.

Many thanks!

J.