Skip to content

Saving changes not working with php8.1 as soon as code is not basic html #16

@OliverFrWTFalreadyTakenComeOnNow

Description

Hello,

Environment:

Debian Buster. Virtualmin panel allowing to choose default PHP mode (currently 7.4.33) but also to make exceptions and have whatever's installed in a directory of choice to run another different of PHP (testing version 8.1.13). MariaDB.

Testing grounds: a brand new wordpress, installed on an empty directory with a freshly downloaded wordpress zip archive, using a brand new freshly created database. Only 1 plugin was added, Classic Widgets.
But also a clone of an existing blog (cloned both files and database, wp-settings edited to change the site’s home url) that is still running fine in php 7.4 today, but in which there is the bug I come to report when ran in php 8.1.

The bug:

Saving the text contents of widgets only works when this is basic html content. (Think p, center.)

Anything more complex, a script, a form, or php, it won’t be saved. I click the “Save” button, a spinning wheel icon starts rotating left of the Save button… and nothing more happens. if I come back five actual minutes later to check, the button is still spinning, if I refresh the page, the change hasn’t been saved.

A screenshot is attached:
rescreenshot

An example of the code that won’t be saved into a widget area, this is, plainly, a search form, no more, no less:

<div class="search_main">
<form method="get" class="searchform" action="/" autocomplete="off">
<input type="text" class="field s" name="s" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" autocomplete="off">
<button type="submit" class="fa fa-search submit" name="submit" value="Search"></button>
</form>
<div class="fix"></div>
</div>

I checked the website’s apache error log, without a risk of false positives as it was a test ground: nothing is recorded, at all, when I click the “Save” button and nothing happens.

Maybe important to mention:

I'm not 100% sure this is classic-widgets' fault. I tried with the “Classic widgets” plugin disabled , went to create a “Code” widget, pasted inside the code I quoted above, and it gave “There was an error. The response is not a valid JSON response.”. No idea if that’s the same issue or not, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions