FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18155&edit=1

ID: 18155
Updated by: till@php.net
Reported By: mmalone at nutshell dot com
Summary: Value strings inside arrays are not escaped
-Status: Open
+Status: Closed
Type: Bug
Package: File_IMC
Operating System: Mac OS X
Package Version: SVN
PHP Version: 5.3.3
-Assigned To:
+Assigned To: till
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+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.

Thanks for the test script and the report. I converted it into a test
and it's all fixed and committed.


Previous Comments:
------------------------------------------------------------------------

[2010-12-28 21:14:08] masonm

The last line of the test script should
var_dump($cardinfo['VCARD'][0]['ADR'][0]['value'][File_IMC::VCARD_ADR_STREET]);

------------------------------------------------------------------------

[2010-12-28 21:12:29] masonm

Added #patch bug:18155;patch:fix;revision:1293570749;.

------------------------------------------------------------------------

[2010-12-28 21:09:41] masonm

Description:
------------
The File_IMC_Parse_Vcard class is supposed to unescape strings inside
vCards, but it fails for strings inside arrays due to a due a bug in the
File_IMC_Parse->_unescape method.

Test script:
---------------
<?
$testVcard = '
BEGIN:VCARD
VERSION:3.0
N:Someone;Someone;;;
FN:Someone
ADR;type=WORK;type=pref:;;22221 W\, Unit 3;Somewhere;IL;60002;
END:VCARD
';
require_once 'File/IMC.php';
$parse = File_IMC::parse('vCard');
$cardinfo = $parse->fromText($testVcard);

var_dump($cardinfo['VCARD'][0]['ADR']);
?>

Expected result:
----------------
array(1) {
[0]=>
string(16) "22221 W, Unit 3"
}

Actual result:
--------------
array(1) {
[0]=>
string(16) "22221 W\, Unit 3"
}

------------------------------------------------------------------------

Search Discussions

  • Till at Mar 11, 2011 at 4:37 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18155&edit=1

    ID: 18155
    Updated by: till@php.net
    Reported By: mmalone at nutshell dot com
    Summary: Value strings inside arrays are not escaped
    Status: Closed
    Type: Bug
    Package: File_IMC
    Operating System: Mac OS X
    Package Version: SVN
    PHP Version: 5.3.3
    Assigned To: till
    -Roadmap Versions:
    +Roadmap Versions: 0.4.2
    New Comment:

    -Roadmap Versions:
    +Roadmap Versions: 0.4.2
    Roadmapped.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-03-11 17:40:05] till

    -Status: Open
    +Status: Closed
    -Assigned To:
    +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.

    Thanks for the test script and the report. I converted it into a test
    and it's all fixed and committed.

    ------------------------------------------------------------------------

    [2010-12-28 21:14:08] masonm

    The last line of the test script should
    var_dump($cardinfo['VCARD'][0]['ADR'][0]['value'][File_IMC::VCARD_ADR_STREET]);

    ------------------------------------------------------------------------

    [2010-12-28 21:12:29] masonm

    Added #patch bug:18155;patch:fix;revision:1293570749;.

    ------------------------------------------------------------------------

    [2010-12-28 21:09:41] masonm

    Description:
    ------------
    The File_IMC_Parse_Vcard class is supposed to unescape strings inside
    vCards, but it fails for strings inside arrays due to a due a bug in the
    File_IMC_Parse->_unescape method.

    Test script:
    ---------------
    <?
    $testVcard = '
    BEGIN:VCARD
    VERSION:3.0
    N:Someone;Someone;;;
    FN:Someone
    ADR;type=WORK;type=pref:;;22221 W\, Unit 3;Somewhere;IL;60002;
    END:VCARD
    ';
    require_once 'File/IMC.php';
    $parse = File_IMC::parse('vCard');
    $cardinfo = $parse->fromText($testVcard);

    var_dump($cardinfo['VCARD'][0]['ADR']);
    ?>

    Expected result:
    ----------------
    array(1) {
    [0]=>
    string(16) "22221 W, Unit 3"
    }

    Actual result:
    --------------
    array(1) {
    [0]=>
    string(16) "22221 W\, Unit 3"
    }

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 11, '11 at 4:37p
activeMar 11, '11 at 4:37p
posts2
users1
websitepear.php.net

1 user in discussion

Till: 2 posts

People

Translate

site design / logo © 2022 Grokbase