Req #19343 [Opn->Dup]: Class not tested before inclusion
| From: | borz_off at cs dot msu dot su | Date: | Thu, 22 Mar 2012 19:00:28 +0000 |
| Subject: | Req #19343 [Opn->Dup]: Class not tested before inclusion | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8423@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19343&edit=1
ID: 19343
Updated by: borz_off@cs.msu.su
Reported By: kanea at free dot fr
Summary: Class not tested before inclusion
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
Package: HTTP_Request2
Operating System: all
Package Version: 2.0.0
PHP Version: 5.3.5
Roadmap Versions:
New Comment:
-Status: Open
+Status: Duplicate
See request #19344
Previous Comments:
------------------------------------------------------------------------
[2012-03-22 18:45:49] kanea
Description:
------------
For a plugin which connect wordpress to CaasuleCRM that i
realized for a client, i must integrate a default solution if PEAR
is not present.
To make that, i remove the require_once and concanete all
class in a single file. Every works fine (capasule and other
depandency) except this line 821 wich don't test the class
existance before make the include.
So i propose a solution in expected result
Test script:
---------------
Line 821 in Request2.php :
if (!class_exists($adapter, false)) and
preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0-9]+)$/', $adapter)) {
include_once str_replace('_', DIRECTORY_SEPARATOR,
$adapter) . '.php';
}
Expected result:
----------------
<?php
if (!class_exists($adapter, false)) {
if (preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0-
9]+)$/', $adapter)) {
include_once str_replace('_',
DIRECTORY_SEPARATOR, $adapter) . '.php';
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19343&edit=1