php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76736 Tidy's Reflection arginfo is wrong for some global functions
Submitted: 2018-08-13 13:16 UTC Modified: 2018-08-14 13:48 UTC
From: tysonandre775 at hotmail dot com Assigned:
Status: Verified Package: Tidy (PECL)
PHP Version: 7.1.20 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tysonandre775 at hotmail dot com
New email:
PHP Version: OS:

 

 [2018-08-13 13:16 UTC] tysonandre775 at hotmail dot com
Description:
------------
The second argument (Tidy instance) is mandatory.

See http://php.net/tidy_getopt - Because the same arginfo from the method is reused, the global function has incorrect reflection signatures.

For the global functions, PHP 7.1 and newer are affected



https://github.com/php/php-src/pull/3439/files was an earlier, incorrect attempt at fixing this, before noticing that I needed to stop reusing arginfo and that additional methods such as tidy_repair_string() also had incorrect signatures.

- 

Test script:
---------------
var_export((new ReflectionFunction('tidy_getopt'))->getParameters());
// Same for tidy_get_root(), tidy_get_html(), tidy_get_head(), tidy_get_body(), tidy_repair_string(), and probably even more global functions

Expected result:
----------------
Expected: Both $option and $object should exist as required parameters on tidy_getopt.

The reflection signature of Tidy::getOpt(), etc. should not be changed by any bug fix.

Actual result:
--------------
Observed: Only one required parameter is rec

array (
  0 => 
  ReflectionParameter::__set_state(array(
     'name' => 'option',
  )),
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-14 13:48 UTC] cmb@php.net
-Status: Open +Status: Verified
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Dec 13 08:01:25 2018 UTC