php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22628 getAttribute case sensitivity
Submitted: 2003-03-10 17:36 UTC Modified: 2003-04-15 11:48 UTC
From: ianh at hardersoft dot com Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-03-10 17:36 UTC] ianh at hardersoft dot com
I have been working with PEAR and find it excellent for development of web-based apps.

Currently I am working on a dbgrid that inherits from the latest HTML_Common, and am storing all its attributes using the standard attribute store/retrieve methods.

I found an inconsistency in the way that an attribute is stored and retrieved. I couldn't find it anywhere in the bug database. The following code replicates the problem:

------

<?php
require_once "HTML/Common.php";

$htmlObj = new HTML_Common;
$htmlObj->updateAttributes(array("someAttribute" => "someValue"));
$htmlObj->updateAttributes(array("anotherattribute" => "anotherValue"));

$result = "someAttribute: " . $htmlObj->getAttribute("someAttribute") . "<BR>";
$result .= "anotherattribute: " . $htmlObj->getAttribute("anotherattribute");

echo $result;
?>

------

Output:

someAttribute:
anotherattribute: anotherValue

------

The problem is during storage of the array element, where the attribute name is not set to lowercase.  The mixed case name appears to be stored in the updateAttributes method, but during the getAttribute method it is set to lowercase.

This appears to be a bug.  If not, it is an odd feature :-)

I have not included a list of modules because I don't believe it is relevant.

Please contact me if I can provide any more details or be of help in any other way.

Best regards,
Ian Harder

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-15 11:45 UTC] mansion@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 [2003-04-15 11:48 UTC] mansion@php.net
Sorry, I was using the automated message generation and 
it gave that result. I meant it is fixed in release 1.1 
of this package.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC