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

ID: 16383
Updated by: [email protected]
Reported By: scottprive at gmail dot com
Summary: getDetails() returns no results if 1 result
Status: Open
Type: Bug
Package: Net_DNSBL
Operating System: 2.6.28 (Ubuntu 9.04)
Package Version: 1.3.3
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

If I change line 11 from:
$result['details'] = $dnsbl->getDetails($ip);
to:
$result['details'] = $dnsbl->results;

I get the expected results set.

That is to say, I alternated between the above two line 11's, and
getDetails would return nothing, but $dnsbl->$results returned correct.


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

[2009-06-26 19:48:55] scottp

Description:
------------
getDetails can return no results/listings, when the dnsbl object's
public variables clearly show there are listings.

In my testing this seems to happen when querying multiple RBLs and that
IP is not listed on all of them. If the IP is listed on all RBLs I get
all results back from getDetails().

Not 100% sure but it seems to happen if the checked IP is only on 1 RBL
and that RBL is Barracuda's.

[email protected]:~$ uname -a
Linux int.scott.tzo.com 2.6.28-12-generic #43-Ubuntu SMP Fri May 1
19:27:06 UTC 2009 i686 GNU/Linux
[email protected]:~$ php --version
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23
2009 14:35:05)


Test script:
---------------
<?php
require_once 'Net/DNSBL.php';

function get_dnsbl_array2($ip) {
$dnsbl = new Net_DNSBL();
$rbls = array('bl.spamcop.net','b.barracudacentral.org');
$dnsbl->setBlacklists($rbls);

if ($dnsbl->isListed($ip, TRUE)) {
echo "\n IS LISTED \nThe object contains:" .
print_r($dnsbl,TRUE)." [end object] (END)\n";
$result['details'] = $dnsbl->getDetails($ip);

}
return $result;
}
#happens if IP is on one blacklist only?
echo "RESULT: " . print_r(get_dnsbl_array2("82.217.205.25"),TRUE);
#echo "RESULT: " . print_r(get_dnsbl_array2("125.110.99.250"),TRUE);
#echo "RESULT: " . print_r(get_dnsbl_array2("77.104.239.1"),TRUE);
?>

Expected result:
----------------
Expecting getDetails() to be the same data (all data) from
$dnsbl['results'].

Actual result:
--------------
IS LISTED
The object contains:Net_DNSBL Object
(
[blacklists] => Array
(
[0] => bl.spamcop.net
[1] => b.barracudacentral.org
)

[results] => Array
(
[82.217.205.25] => Array
(
[b.barracudacentral.org] => Array
(
[record] => Array
(
[0] => 127.0.0.2
)

[txt] => Array
(
[0] =>
http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25
)

)

)

)

)
[end object] (END)
RESULT: Array
(
[details] =>
)

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

Search Discussions

  • Sebastian at Jun 27, 2009 at 9:42 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16383&edit=1

    ID: 16383
    Updated by: [email protected]
    Reported By: scottprive at gmail dot com
    Summary: getDetails() returns no results if 1 result
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: Net_DNSBL
    Operating System: 2.6.28 (Ubuntu 9.04)
    Package Version: 1.3.3
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback
    Sorry, I can't reproduce that. Please provide a test case that shows
    clearly what fails in which condition and what is your expected result
    in that condition.

    With your example, I get

    [exec] array(2) {
    [exec] ["bl.spamcop.net"]=>
    [exec] array(2) {
    [exec] ["record"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(9) "127.0.0.2"
    [exec] }
    [exec] ["txt"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(59) "Blocked - see
    http://www.spamcop.net/bl.shtml?82.217.205.25"
    [exec] }
    [exec] }
    [exec] ["b.barracudacentral.org"]=>
    [exec] array(2) {
    [exec] ["record"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(9) "127.0.0.2"
    [exec] }
    [exec] ["txt"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(66)
    "http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25"
    [exec] }
    [exec] }
    [exec] }

    Which is what I would expect.


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

    [2009-06-26 20:13:35] scottp

    If I change line 11 from:
    $result['details'] = $dnsbl->getDetails($ip);
    to:
    $result['details'] = $dnsbl->results;

    I get the expected results set.

    That is to say, I alternated between the above two line 11's, and
    getDetails would return nothing, but $dnsbl->$results returned correct.

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

    [2009-06-26 19:48:55] scottp

    Description:
    ------------
    getDetails can return no results/listings, when the dnsbl object's
    public variables clearly show there are listings.

    In my testing this seems to happen when querying multiple RBLs and that
    IP is not listed on all of them. If the IP is listed on all RBLs I get
    all results back from getDetails().

    Not 100% sure but it seems to happen if the checked IP is only on 1 RBL
    and that RBL is Barracuda's.

    [email protected]:~$ uname -a
    Linux int.scott.tzo.com 2.6.28-12-generic #43-Ubuntu SMP Fri May 1
    19:27:06 UTC 2009 i686 GNU/Linux
    [email protected]:~$ php --version
    PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23
    2009 14:35:05)


    Test script:
    ---------------
    <?php
    require_once 'Net/DNSBL.php';

    function get_dnsbl_array2($ip) {
    $dnsbl = new Net_DNSBL();
    $rbls = array('bl.spamcop.net','b.barracudacentral.org');
    $dnsbl->setBlacklists($rbls);

    if ($dnsbl->isListed($ip, TRUE)) {
    echo "\n IS LISTED \nThe object contains:" .
    print_r($dnsbl,TRUE)." [end object] (END)\n";
    $result['details'] = $dnsbl->getDetails($ip);

    }
    return $result;
    }
    #happens if IP is on one blacklist only?
    echo "RESULT: " . print_r(get_dnsbl_array2("82.217.205.25"),TRUE);
    #echo "RESULT: " . print_r(get_dnsbl_array2("125.110.99.250"),TRUE);
    #echo "RESULT: " . print_r(get_dnsbl_array2("77.104.239.1"),TRUE);
    ?>

    Expected result:
    ----------------
    Expecting getDetails() to be the same data (all data) from
    $dnsbl['results'].

    Actual result:
    --------------
    IS LISTED
    The object contains:Net_DNSBL Object
    (
    [blacklists] => Array
    (
    [0] => bl.spamcop.net
    [1] => b.barracudacentral.org
    )

    [results] => Array
    (
    [82.217.205.25] => Array
    (
    [b.barracudacentral.org] => Array
    (
    [record] => Array
    (
    [0] => 127.0.0.2
    )

    [txt] => Array
    (
    [0] =>
    http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25
    )

    )

    )

    )

    )
    [end object] (END)
    RESULT: Array
    (
    [details] =>
    )

    ------------------------------------------------------------------------
  • Sebastian at Jun 27, 2009 at 9:43 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16383&edit=1

    ID: 16383
    Updated by: [email protected]
    Reported By: scottprive at gmail dot com
    Summary: getDetails() returns no results if 1 result
    Status: Feedback
    Type: Bug
    Package: Net_DNSBL
    Operating System: 2.6.28 (Ubuntu 9.04)
    Package Version: 1.3.3
    PHP Version: 5.2.5
    -Assigned To:
    +Assigned To: nohn
    Roadmap Versions:
    New Comment:

    -Assigned To:
    +Assigned To: nohn



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

    [2009-06-27 11:40:55] nohn

    -Status: Open
    +Status: Feedback
    Sorry, I can't reproduce that. Please provide a test case that shows
    clearly what fails in which condition and what is your expected result
    in that condition.

    With your example, I get

    [exec] array(2) {
    [exec] ["bl.spamcop.net"]=>
    [exec] array(2) {
    [exec] ["record"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(9) "127.0.0.2"
    [exec] }
    [exec] ["txt"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(59) "Blocked - see
    http://www.spamcop.net/bl.shtml?82.217.205.25"
    [exec] }
    [exec] }
    [exec] ["b.barracudacentral.org"]=>
    [exec] array(2) {
    [exec] ["record"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(9) "127.0.0.2"
    [exec] }
    [exec] ["txt"]=>
    [exec] array(1) {
    [exec] [0]=>
    [exec] string(66)
    "http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25"
    [exec] }
    [exec] }
    [exec] }

    Which is what I would expect.

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

    [2009-06-26 20:13:35] scottp

    If I change line 11 from:
    $result['details'] = $dnsbl->getDetails($ip);
    to:
    $result['details'] = $dnsbl->results;

    I get the expected results set.

    That is to say, I alternated between the above two line 11's, and
    getDetails would return nothing, but $dnsbl->$results returned correct.

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

    [2009-06-26 19:48:55] scottp

    Description:
    ------------
    getDetails can return no results/listings, when the dnsbl object's
    public variables clearly show there are listings.

    In my testing this seems to happen when querying multiple RBLs and that
    IP is not listed on all of them. If the IP is listed on all RBLs I get
    all results back from getDetails().

    Not 100% sure but it seems to happen if the checked IP is only on 1 RBL
    and that RBL is Barracuda's.

    [email protected]:~$ uname -a
    Linux int.scott.tzo.com 2.6.28-12-generic #43-Ubuntu SMP Fri May 1
    19:27:06 UTC 2009 i686 GNU/Linux
    [email protected]:~$ php --version
    PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23
    2009 14:35:05)


    Test script:
    ---------------
    <?php
    require_once 'Net/DNSBL.php';

    function get_dnsbl_array2($ip) {
    $dnsbl = new Net_DNSBL();
    $rbls = array('bl.spamcop.net','b.barracudacentral.org');
    $dnsbl->setBlacklists($rbls);

    if ($dnsbl->isListed($ip, TRUE)) {
    echo "\n IS LISTED \nThe object contains:" .
    print_r($dnsbl,TRUE)." [end object] (END)\n";
    $result['details'] = $dnsbl->getDetails($ip);

    }
    return $result;
    }
    #happens if IP is on one blacklist only?
    echo "RESULT: " . print_r(get_dnsbl_array2("82.217.205.25"),TRUE);
    #echo "RESULT: " . print_r(get_dnsbl_array2("125.110.99.250"),TRUE);
    #echo "RESULT: " . print_r(get_dnsbl_array2("77.104.239.1"),TRUE);
    ?>

    Expected result:
    ----------------
    Expecting getDetails() to be the same data (all data) from
    $dnsbl['results'].

    Actual result:
    --------------
    IS LISTED
    The object contains:Net_DNSBL Object
    (
    [blacklists] => Array
    (
    [0] => bl.spamcop.net
    [1] => b.barracudacentral.org
    )

    [results] => Array
    (
    [82.217.205.25] => Array
    (
    [b.barracudacentral.org] => Array
    (
    [record] => Array
    (
    [0] => 127.0.0.2
    )

    [txt] => Array
    (
    [0] =>
    http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25
    )

    )

    )

    )

    )
    [end object] (END)
    RESULT: Array
    (
    [details] =>
    )

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 26, '09 at 6:50p
activeJun 27, '09 at 9:43a
posts3
users2
websitepear.php.net

2 users in discussion

Sebastian: 2 posts Scottprive: 1 post

People

Translate

site design / logo © 2023 Grokbase