php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77856 xdiff_string_patch() no $error returned
Submitted: 2019-04-05 14:05 UTC Modified: -
From: kentaro at ranvis dot com Assigned:
Status: Open Package: xdiff (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-04-05 14:05 UTC] kentaro at ranvis dot com
Description:
------------
The fourth parameter of xdiff_string_patch() $error should return failed hunks of the patch, but nothing is returned.

Will add PR later.

Test script:
---------------
<?php
$str = "123\n456\n";
$patch = "@@ -1,2 +1,3 @@\n 789\n+012\n 345\n";
$result = xdiff_string_patch($str, $patch, XDIFF_PATCH_NORMAL, $error);
var_dump($result === $str);
var_dump($error === $patch);


Expected result:
----------------
bool(true)
bool(true)


Actual result:
--------------
bool(true)
bool(false)


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-05 14:11 UTC]
The following pull request has been associated:

Patch Name: Fixed bug #77856 (xdiff_string_patch() no $error returned).
On GitHub:  https://github.com/php/pecl-text-xdiff/pull/4
Patch:      https://github.com/php/pecl-text-xdiff/pull/4.patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 12:01:29 2024 UTC