PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Diff » Bug #5152

Inline checking fails in versions earlier than 4.3.0

Details

Submitted2005-08-19 11:58 UTC
Fromkruegel at gmail dot com
Assignedyunosh
StatusClosed
PackageText_Diff
PHP Version4.2.0
OSLinux
Roadmaps(Not assigned)

Comments

[2005-08-19 11:58 UTC] kruegel at gmail dot com

Description:
------------
Text\Diff\Renderer\inline.php

The following lines fail in php versions earlier than 4.3.0 due to the use of the "start position" parameter in the strspn and strcspn functions.

$spaces = strspn($string, " \n", $pos);
$nextpos = strcspn($string, "\n", $pos + spaces);

The listed dependency for Text_Diff is currently 4.2.0

The following replacement can be made in order to allow it to work in these earlier versions:

$spaces = strspn(substr($string, $pos), " \n");
$nextpos = strcspn(substr($string, $pos + $spaces), " \n");