PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #20

regexp bug in Generator.php

Details

Submitted2003-09-18 12:30 UTC
Fromsergey at nikiforov dot net
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.3.1
OSWin2K
Roadmaps(Not assigned)

Comments

[2003-09-18 12:30 UTC] sergey at nikiforov dot net

Description:
------------
in Generator.php lines 459-461 you wrote this code:
return preg_replace(
'/(\n|\r\n)\s*###START_AUTOCODE\n.*\n\s*###END_AUTOCODE(\n|\r\n)/s',
$body,$input);

it doesn't work under win platform becouse of missing \r in regexp.
The following will work:
return preg_replace(
'/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s',
$body,$input);

Reproduce code:
---------------
return preg_replace(
'/(\n|\r\n)\s*###START_AUTOCODE\n.*\n\s*###END_AUTOCODE(\n|\r\n)/s',
$body,$input);