Framework Bug: $_GET variables

Feed 4 posts, 3 voices

Aug 18, 2008 15:17
Avatar
1 posts

I noticed a possible bug in the Framework.

I was trying to pass $_GET variables in the url and my application kept blowing saying it couldn't load CController. The url I was calling was /chat/message?message=test.

I went to checkout Framework.php and in line 108 I found if ($pos = strpos($_SERVER['QUERY_STRING'], '&') !== false) {

which I think needs to be

        if (($pos = strpos($_SERVER['QUERY_STRING'], '&')) !== false) {

or else $pos variable will only get true or false and the folling operations will end up bad.

 
Aug 20, 2008 16:31
Avatar
37 posts

Hi pheres,

You are right. I think you can open a ticket on the Frog's issue tracking system.

Thanks for the report.

 
Aug 20, 2008 17:16
Avatar
396 posts

You are both correct sirs... I've created issue 43 for registration purposes. I have also corrected the problem and uploaded the revised code to SVN.

Description of issue:

  In Framework.php, line 108, the following code can be found:

  if ($pos = strpos($_SERVER['QUERY_STRING'], '&') !== false) {

  This an accidental assignment of true/false due to missing parentheses.
  To increase readability and make sure this doesn't happen again, I've split
  the assignment and if statement into two lines.

  (yes I know it can be done in one line... that is not the point) :-)

  New code became:

              $pos = strpos($_SERVER['QUERY_STRING'], '&');
              if ($pos !== false) {

Issue closed. Get new code from SVN of fix it yourself until the next release.

 
Aug 20, 2008 17:42
Avatar
396 posts

Just for kicks... I quickly scanned through all of Frog's code and didn't find any similar problems along the way.

I did find to small bugs in DoPgsql.php which people trying to use Postgresql will find interesting... it's this issue which was subsequently corrected.

 
Aug 21, 2008 07:55
Avatar
396 posts

"I did find to small bugs..." should have been "I did find two small bugs..."

where was the edit button hiding again? ;-)