Bug #14972 [Asn->Csd]: Parsing known parameter types gives undefined offset
| From: | till@php.net | Date: | Thu, 17 Sep 2009 22:44:38 +0000 |
| Subject: | Bug #14972 [Asn->Csd]: Parsing known parameter types gives undefined offset | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-1669@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=14972&edit=1
ID: 14972
Updated by: till@php.net
Reported By: awhitehouse dot esq at googlemail dot com
Summary: Parsing known parameter types gives undefined offset
-Status: Assigned
+Status: Closed
Type: Bug
Package: Contact_Vcard_Parse
Operating System: Windows
Package Version: 1.31.0
PHP Version: 5.2.6
-Assigned To: doconnor
+Assigned To: till
Roadmap Versions:
New Comment:
-Status: Assigned
+Status: Closed
-Assigned To: doconnor
+Assigned To: till
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2009-07-01 01:28:57] till
-Status: No Feedback
+Status: Assigned
-Assigned To:
+Assigned To: doconnor
Wanna fix your patch?
1) testPropertyGroups(ContactVcardParseTest)
Failed asserting that two strings are equal.
expected string <FamilyName>
difference < ??????????????????????????????????????
????>
got string <FamilyName;GivenName;Additional
Names;Prefix.;Suffix>
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/Contac
tVcardParseTest.php:47
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/AllTest
s.php:14
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/AllTest
s.php:26
2) testParameters(ContactVcardParseTest)
--- Expected
+++ Actual
@@ -10,7 +10,7 @@
[0] => PARAMVALUE2
)
- [TYPE] => Array
+ [PARAMVALUE3] => Array
(
[0] => PARAMVALUE3
)
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/Contac
tVcardParseTest.php:64
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/AllTest
s.php:14
/usr/local/share/pear/tests/Contact_Vcard_Parse/tests/AllTest
s.php:26
FAILURES!
Tests: 2, Assertions: 2, Failures: 2.
TOTAL TIME: 00:00
1 PASSED TESTS
0 SKIPPED TESTS
------------------------------------------------------------------------
[2009-07-01 01:06:19] doconnor
-Status: Feedback
+Status: No Feedback
------------------------------------------------------------------------
[2008-12-27 21:32:06] doconnor
Thank you for taking the time to report a problem with the package.
This problem may have been already fixed by a previous change that
is in the CVS of the package. Please log into CVS with:
cvs -d :pserver:cvsread@cvs.php.net:/repository login
and check out the CVS repository of this package and upgrade
cvs -d :pserver:cvsread@cvs.php.net:/repository co
pear/Contact_Vcard_Parse
pear upgrade pear/Contact_Vcard_Parse/package2.xml
or
pear upgrade pear/Contact_Vcard_Parse/package.xml
If you are able to reproduce the bug with the latest CVS,
please change the status back to "Open".
Again, thank you for your continued support of PEAR.
I can't reproduce the e_notice with latest CVS versions.
I committed the test in #14969
------------------------------------------------------------------------
[2008-11-07 08:53:54] andreww
Attached PHPUnit test and potential patch.
------------------------------------------------------------------------
[2008-11-07 08:09:24] andreww
Description:
------------
Known parameter types use the shorthand notation that omits the TYPE=
prefix. e.g. TEL;CELL;PREF instead of TEL;TYPE=CELL;TYPE=PREF
This causes the "Undefined offset: 1" Notice to be generated.
Test script:
---------------
$familyName = "FamilyName";
$givenName = "GivenName";
$name = "N";
$param1Name = "PARAM1";
$param1Value = "PARAMVALUE1";
$param2Name = "PARAM2";
$param2Value = "PARAMVALUE2";
$param3Value = "PARAMVALUE3";
$vcard = "BEGIN:VCARD\n\r" .
$name .
";" . $param1Name . "=" . $param1Value .
";" . $param2Name . "=" . $param2Value .
";" . $param3Value .
":" . $familyName . ";" .
$givenName . "\n\r" .
"END:VCARD";
$parser = new Contact_Vcard_Parse();
$ret = $parser->fromText( $vcard );
Expected result:
----------------
No notices / warnings / errors.
Actual result:
--------------
There was 1 error:
1) testParameters(ContactVcardParseTest)
Undefined offset: 1
D:\php5.2.6\PEAR\Contact_Vcard_Parse.php:549
D:\php5.2.6\PEAR\Contact_Vcard_Parse.php:415
D:\php5.2.6\PEAR\Contact_Vcard_Parse.php:166
Z:\repos\php\tests\ContactVcardParseTest.php:68
Z:\repos\php\tests\ContactVcardParseTest.php:90
Z:\repos\php\tests\ContactVcardParseTest.php:100
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=14972&edit=1