Bug 272938 - devel/pear-htmlpurifier: support for php81 "Generates a PHP fatal error: autoload() is no longer supported, use spl_autoload_register()"
Summary: devel/pear-htmlpurifier: support for php81 "Generates a PHP fatal error: auto...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-04 15:08 UTC by Joel Rodriguez
Modified: 2023-08-04 18:05 UTC (History)
1 user (show)

See Also:


Attachments
update to 4.15.0 (945 bytes, patch)
2023-08-04 16:36 UTC, Vladimir Druzenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Rodriguez 2023-08-04 15:08:10 UTC
Generates a PHP fatal error: autoload() is no longer supported, use spl_autoload_register()

Code:

    function __autoload($class)
    {
        return HTMLPurifier_Bootstrap::autoload($class);
    }

Suggested fix:

    function spl_autoload_register($class)
    {
        return HTMLPurifier_Bootstrap::autoload($class);
    }
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-04 15:17:24 UTC
Has upstream already fixed this?
Same question for your other PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272939
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-04 15:47:07 UTC
Already fixed in 4.14.0:
https://github.com/ezyang/htmlpurifier/commit/4285590c90a1eaf36eb6ae147cc1cbfa7aa546a6

So probably we just need to update old 4.9.2 to current release 4.16.0.
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-04 16:36:20 UTC
Created attachment 243841 [details]
update to 4.15.0

Can you test the patch?
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-04 16:58:03 UTC
4.15.0, released 2022-09-18
! PHP 8.1 and 8.2 support, esp. fixes for deprecation warnings.

https://github.com/ezyang/htmlpurifier/blob/master/NEWS
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-08-04 17:58:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=94ea65b1037c4e04fb2d2a6e0ee1480f0b254179

commit 94ea65b1037c4e04fb2d2a6e0ee1480f0b254179
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2023-08-04 17:53:44 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2023-08-04 17:53:44 +0000

    devel/pear-htmlpurifier: update to 4.15.0 for support PHP 8+

    Runtime errors with PHP 8.1:
    "Generates a PHP fatal error: autoload() is no longer supported, use
    spl_autoload_register()"
    "Generates a PHP fatal error: Array and string offset access syntax with
    curly braces is no longer supported"

    Changelog: https://github.com/ezyang/htmlpurifier/blob/master/NEWS
    4.15.0, released 2022-09-18
    ! PHP 8.1 and 8.2 support, esp. fixes for deprecation warnings.

    PR:                     272938 272939
    Approved by:            adamw (mentor)
    Differential Revision:  https://reviews.freebsd.org/D41323
    MFH:                    2023Q3

 devel/pear-htmlpurifier/Makefile | 3 +--
 devel/pear-htmlpurifier/distinfo | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-08-04 18:03:50 UTC
A commit in branch 2023Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c0e935c195d85458402cd70a1fc8708dc8227aab

commit c0e935c195d85458402cd70a1fc8708dc8227aab
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2023-08-04 17:53:44 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2023-08-04 18:02:56 +0000

    devel/pear-htmlpurifier: update to 4.15.0 for support PHP 8+

    Runtime errors with PHP 8.1:
    "Generates a PHP fatal error: autoload() is no longer supported, use
    spl_autoload_register()"
    "Generates a PHP fatal error: Array and string offset access syntax with
    curly braces is no longer supported"

    Changelog: https://github.com/ezyang/htmlpurifier/blob/master/NEWS
    4.15.0, released 2022-09-18
    ! PHP 8.1 and 8.2 support, esp. fixes for deprecation warnings.

    PR:                     272938 272939
    Approved by:            adamw (mentor)
    Differential Revision:  https://reviews.freebsd.org/D41323
    MFH:                    2023Q3

    (cherry picked from commit 94ea65b1037c4e04fb2d2a6e0ee1480f0b254179)

 devel/pear-htmlpurifier/Makefile | 3 +--
 devel/pear-htmlpurifier/distinfo | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-04 18:05:17 UTC
Commited new version.