Google Groups Home
Help | Sign in
Message from discussion #4610: ErrorHandler does not check the lowercase method name specifically, which can lead to undefined variable notice
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
CakePHP : The Rapid Development Framework for PHP  
View profile
 More options May 9, 11:27 am
From: "CakePHP : The Rapid Development Framework for PHP" <tick...@cakephp.org>
Date: Fri, 09 May 2008 15:27:47 -0000
Local: Fri, May 9 2008 11:27 am
Subject: Re: [CakePHP : The Rapid Development Framework for PHP] #4610: ErrorHandler does not check the lowercase method name specifically, which can lead to undefined variable notice
#4610: ErrorHandler does not check the lowercase method name specifically, which
can lead to undefined variable notice
-----------------------------------------------------------------+--------- -
    Reporter:  RainChen                                          |         Owner:                
        Type:  Bug                                               |        Status:  new          
    Priority:  Very Low                                          |     Milestone:  1.2.x.x      
   Component:  Error Handling                                    |       Version:  1.2.x.x      
    Severity:  Trivial                                           |    Resolution:                
    Keywords:  ErrorHandler lowercase undefined notice rainchen  |   Php_version:  PHP 4 >= 4.3.2
Cake_version:  1.2.0.6311                                        |  
-----------------------------------------------------------------+--------- -
Changes (by Sliv):

  * keywords:  => ErrorHandler lowercase undefined notice rainchen
  * summary:  ErrorHandler should check low case method name =>
              ErrorHandler does not check the lowercase
              method name specifically, which can lead to
              undefined variable notice
  * cake_version:  1.2.0.6311 beta => 1.2.0.6311

Old description:

> source code download from
> http://cakephp.org/files/nightly/1.2.x.x/1.2.x.x_09.05.2008.tar.gz

> type a none exists action in the url, then the page display some
> Undefined variable error notice as bellow:

> Notice (8): Undefined variable:  code [CORE\cake\libs\error.php, line
> 102]

> Notice (8): Undefined variable:  name [CORE\cake\libs\error.php, line
> 103]

> Notice (8): Undefined variable:  message [CORE\cake\libs\error.php, line
> 104]

> Notice (8): Undefined variable:  code [CORE\cake\libs\error.php, line
> 105]

> Notice (8): Undefined variable:  name [CORE\cake\libs\error.php, line
> 105]

> the bug is in the cake/libs/error.php (line 77) :

>                 if (!in_array($method, get_class_methods($this))) {
>                         $method = 'error';
>                 }

> should be :

>                 if (!in_array(low($method), get_class_methods($this))) {
>                         $method = 'error';
>                 }

New description:

 source code download from:[[BR]]
 http://cakephp.org/files/nightly/1.2.x.x/1.2.x.x_09.05.2008.tar.gz
 [[BR]]
 Navigate to a non-existent action URL and the page will display some
 undefined variable error notices as shown below:
 {{{
 Notice (8): Undefined variable:  code [CORE\cake\libs\error.php, line 102]

 Notice (8): Undefined variable:  name [CORE\cake\libs\error.php, line 103]

 Notice (8): Undefined variable:  message [CORE\cake\libs\error.php, line
 104]

 Notice (8): Undefined variable:  code [CORE\cake\libs\error.php, line 105]

 Notice (8): Undefined variable:  name [CORE\cake\libs\error.php, line 105]
 }}}
 The bug appears to be in cake/libs/error.php (line 77):
 {{{
 if (!in_array($method, get_class_methods($this))) {
         $method = 'error';
 }
 }}}
 I think it should be:
 {{{
 if (!in_array(low($method), get_class_methods($this))) {
         $method = 'error';
 }
 }}}

Comment:

 Updated for clarity and formatting

--
Ticket URL: <https://trac.cakephp.org/ticket/4610#comment:1>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google