HTTP input character conversion is improperly configured after upgrade

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

HTTP input character conversion is improperly configured after upgrade

Post by bendik »

After upgrade from 3.3.2 into 3.3.3 cannot resolve error message on multiple my PHPBB forums.
php.JPG
php2.JPG
my .htaccess already contain
php_value mbstring.http_input pass
php_value mbstring.http_output pass

as per recomendation here
viewtopic.php?t=2149478
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

Yes, it does appear that https://tracker.phpbb.com/browse/PHPBB3-16656 and the changes made for that bug removed "pass" as an allowed value.

So the previously valid & required configuration of "pass" from PHP 5.x is no longer accepted by the phpBB ACP check that presents this warning message. Apparently in response to the "should be left blank" assertion in the PHP documentation.

If you don't override the mbstring.http_input and mbstring.http_output in your .htaccess file, do you know what defaults exist for PHP in your environment? Meaning if you simply comment out those .htaccess lines, is a blank value what your PHP 7.4.9 environment already has as its default, as expected? Which should pass phpBB 3.3.3's updated test.

Otherwise, perhaps try the "none" syntax to assert a blank value.

Code: Select all

php_value mbstring.http_input none
php_value mbstring.http_output none
It's not that I know this syntax works specifically for mbstring.http_input and mbstring.http_output; this "none" is just part of the PHP documentation for the Apache module's "php_value" directive.
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

Re: HTTP input character conversion is improperly configured after upgrade

Post by bendik »

Thanks for troubleshooting here and your help, see below error message and PHP config after update . htaccess to none

phperr.jpg
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

What was the first result from having simply removed or commented those lines out of your .htaccess entirely? If the phpBB warning still showed up, what does the phpBB ACP's PHP Information page show for mbstring.http_input and mbstring.http_output? Meaning, what is the default your hosting provider has for these values in your PHP 7.4.9 environment, which is what you should be seeing once the .htaccess file directives are removed.

If continuing to attempt configuring mbstring.http_input and mbstring.http_output in the .htaccess file is actually necessary, it would seem unusual that the "none" configuration worked for one of the settings, but not for both of the settings. (As is being suggested by your latest screen shot.) What does the phpBB ACP PHP Information page show for mbstring.http_input and mbstring.http_output in this configuration?

If that had happened to me, I would also be double-checking my .htaccess modifications to make sure I didn't "set mbstring.http_output twice" instead of setting both mbstring.http_input and mbstring.http_output, or that something else was wrong in the syntax of how mbstring.http_input was set to "none".
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

bendik wrote:
Thu Feb 18, 2021 5:28 pm
this is my .access file, after removal all none sense mbstring I would guess that is correct. But error message still occur. Attaching picture of my PHP config too. As per PHP info, mbstring.http_input is set to UTF-8 as Master data
Agreed. With all "php_value mbstring.http_*" statements removed from the .htaccess file, you're seeing that mbstring.http_output is blank as expected, but php_value mbstring.http_input is UTF-8. Presumably exactly as your hosting configuration has configured them to be by default.

So at minimum, it would seem like you at least still need php_value mbstring.http_input none in order to setup the conditions phpBB is expecting. Although setting both to "none" would also be fine.

This too is something you already tested? Or does setting "none" for mbstring.http_input in the .htaccess file eliminate the remaining warning in the phpBB ACP?

If setting php_value mbstring.http_input none in the .htaccess file does not eliminate the warning, what does the phpBB ACP's PHP Information show for mbstring configuration values at that point? i.e. What happened to the mbstring.http_input value, if anything, in response to the "none" configuration.
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

Re: HTTP input character conversion is improperly configured after upgrade

Post by bendik »

by empty mbstring in .access data PHP panel presenting UTF-8 in local an master data
by php_value mbstring.http_input none in .access data PHP panel presenting same values so UTF-8 in local an master data
so adding none values doesnt change the message
User avatar
3Di
Former Team Member
Posts: 16174
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Name: Marco
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by 3Di »

bendik wrote: โ†‘
Thu Feb 18, 2021 7:03 pm
...
Have you tried to contact your host?
In case let them have a read to this https://www.php.net/manual/en/mbstring. ... http-input
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

bendik wrote: โ†‘
Thu Feb 18, 2021 7:03 pm
so adding none values doesnt change the message
Fair enough. So apparently, at least in the PHP implementation running on this server, you're able to change the mbstring.http_input and mbstring.http_output configuration to "pass" using the .htaccess file, as evidenced by the fact phpBB ACP reported the warning for both values under that configuration.

But the .htaccess configuration is unable to assert that "a blank value" should be the effective setting, at least for mbstring.http_input. And at best reports "UTF-8" for mbstring.http_input when attempting to assert "none" from the .htaccess file.

Asking your hosting provider whether the configuration for your server can be changed to "a blank value" for both mbstring.http_input and mbstring.http_output, as recommended by the PHP documentation 3Di linked to, could be important for a couple reasons:

One, they might agree and be able to make this configuration change, and the phpBB ACP warning will cease. At which point, problem solved.

Two, they might tell you "it's already been configured as a blank value." Which would mean that "UTF-8" is what's being reported specifically for mbstring.http_input "because it was otherwise set to a blank value." Same as the behavior we see happening when we use the .htaccess file to assert that it should be set to "none", too.

If "it's already a blank value" is what they report, this would imply that the "UTF-8" we're seeing is because the PHP default_charset is set to "UTF-8". And "to defer to what default_charset is configured as" being the stated intention in the PHP documentation of setting a blank value in the first place.

That's not how it works in my version of PHP 7.4.11, and the PHP Information page simply shows "no value" for both local and global on both settings. But I'm mentioning the possibility just in case that's the evidence which comes back from the hosting provider, since "it's already configured to be blank" could certainly fit with why asserting "none" as the value from the .htaccess file doesn't change anything.

I suppose the third reason it could be important is if the hosting provider says "it's set to UTF-8, but we're not going to change it for you." Because then phpBB would need to make a decision as to whether the new warning logic is actually "helping" in this situation. phpBB requires default_charset to be "UTF-8", and wants mbstring.http_input to be blank "so it will use default_charset".

So is the fact that mbstring.http_input is set to "UTF-8" ultimately a "this won't work correctly for phpBB" configuration that phpBB's warning should be alerting about? Because phpBB is getting the UTF-8 result it both wants and requires.
User avatar
3Di
Former Team Member
Posts: 16174
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Name: Marco
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by 3Di »

This is what it should be === no value, I do not what a blank value is... BTW.
2021-02-19 00_05_18-PHP information โ€“ Mozilla Firefox.png
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

Re: HTTP input character conversion is improperly configured after upgrade

Post by bendik »

thanks gents and let me correct what I meant
My values as per screenshot below are UTF-8 except output


phperr2.jpg
User avatar
3Di
Former Team Member
Posts: 16174
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Name: Marco
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by 3Di »

bendik wrote: โ†‘
Fri Feb 19, 2021 5:56 am
thanks gents and let me correct what I meant
My values as per screenshot below are UTF-8 except output
...
3Di wrote: โ†‘
Thu Feb 18, 2021 7:08 pm
...
Have you tried to contact your host?
In case let them have a read to this https://www.php.net/manual/en/mbstring. ... http-input
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

Re: HTTP input character conversion is improperly configured after upgrade

Post by bendik »

Handled few emails with hosting provider and outcome is not good, they are recommending to apply settings viewtopic.php?t=671175 and not listening my arguments https://www.php.net/manual/en/mbstring. ... http-input

Why warning exist in 3.3.3. but was not in 3.3.2?
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

bendik wrote: โ†‘
Mon Feb 22, 2021 9:14 am
Why warning exist in 3.3.3. but was not in 3.3.2?
That's a good question. Because although the test was indeed changed in phpBB 3.3.3, the previous implementation of the test would not have allowed for "UTF-8" either. What was changed in phpBB 3.3.3 was no longer accepting the old PHP 5.x required configuration of "pass" for these configurations, since this hadn't been correct for the last several PHP version releases.

Before, either "pass" or a blank value were accepted; else the warning would be shown. Now only a blank value is accepted. So based on the code change that was made in phpBB, if this warning only recently started appearing, I would first suspect that the hosting provider had recently implemented it, based on some need to have the mbstring.http_input set to "UTF-8".

And that if you went back to phpBB 3.3.2 now, phpBB would still be showing the warning in ACP. Because the "UTF-8" configuration set by the hosting provider is still neither "a blank value" nor "pass".


Personally I think there is still a case to be made for "phpBB should be accepting UTF-8". Because phpBB isn't just "randomly enforcing PHP rules" here; phpBB is trying to make sure that the encoding will be the one that the phpBB code is expecting. "The configuration must be for a blank value" is being tested with the intention that PHP will end up using the "default_charset" configuration. And phpBB separately requires that the PHP "default_charset" configuration be either literally or effectively set to "UTF-8".

So phpBB's actual goal here is "ensure mbstring.http_input and mbstring.http_output will be treated as UTF-8", and not specifically "a blank value." Even though we as programmers can cite PHP documentation that says "it should have been configured as a blank value", from a phpBB perspective and proper operation of phpBB, being set to "UTF-8" still gives us exactly what phpBB requires, and what phpBB was checking the PHP configuration to ensure would be the case.
bendik
Registered User
Posts: 8
Joined: Thu Feb 18, 2021 3:09 pm

Re: HTTP input character conversion is improperly configured after upgrade

Post by bendik »

Thanks, so maybe programmers to change to code in next versions? Can I ignore the warning or I have to investigate and resolve it somehow?
User avatar
EA117
Registered User
Posts: 2068
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: HTTP input character conversion is improperly configured after upgrade

Post by EA117 »

I went ahead and entered a bug for it, https://tracker.phpbb.com/browse/PHPBB3-16708, so that it can be considered to further refine the phpBB 3.3.3 test regarding mbstring.http_input and mbstring.http_output. That doesn't guarantee "if" or when it might get taken up; but it's at least in the list now.

If suppressing the warning is important enough to make an interim fix of your own, the attached /includes/acp/acp_main.php for phpBB 3.3.3 should achieve forgiveness of an explicit "UTF-8" configuration. Of course, these changes will be lost once a future update like phpBB 3.3.4 is applied, since acp_main.php will be overwritten with whatever the shipping code is at that point.
Attachments
acp_main.php
(22.57 KiB) Downloaded 8 times
Post Reply

Return to โ€œ[3.3.x] Support Forumโ€