Comments (6)
Hi. thanks for reporting this. I heard something similar recently, but your details are very good. Yes probably we should just add a check if the constant exists with defined()
before accessing it and remove the @
from fatfree.
This is because "Latin" (la) is not part of the Windows compatible ISO-639-2 locale subset.
ref.: https://docs.moodle.org/dev/Table_of_locales#Table
we should probably review this and check if Win10+ can handle the unix type locales now.
from fatfree.
We have encountered this for the first time yesterday. The fix for this is a bit groky and I think the actual problem might still count as a bug(ish).
I come from South Africa and we have a number of local official languages. This issue was first reported by a user with isiZulu set as their browser langauge. I was able to replicate this problem by setting my browser language to isiXhosa - not an unreasonable thing for Zulu/Xhosa speakers to do. This triggered the following error:
Undefined constant ISO::LC_xh [F:\wamp64\www\rodel\trust.rodelfiduciary.co.za\vendor\bcosca\fatfree-core\base.php:1136]
This is derived from the 'Accept-Language' request header, which in my case is:
'xh-ZA,xh;q=0.8,en-US;q=0.5,en;q=0.3'
The error suppression at line 1136 doesn't work at my current version of PHP (8.0.20). I am not sure if it worked previously:
$locale=@constant('ISO::LC_'.$parts[0]);
The fix, which is not ideal, is to manually change the $_SERVER['HTTP_ACCEPT_LANGUAGE']
early on in the request (before you hit F3). For example:
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en-ZA,en';
I can't seem to find any other way around it. I would welcome a more robust solution if I missed it :-)
from fatfree.
@MissConstrued I was looking at the PHP 8 upgrade info, and noticed this:
The @ operator will no longer silence fatal errors (E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR, E_PARSE). Error handlers that expect error_reporting to be 0 when @ is used, should be adjusted to use a mask check instead:
https://www.php.net/manual/en/migration80.incompatible.php
The constant() method will throw an error if the constant is not defined:
https://www.php.net/manual/en/function.constant.php
If the constant is not defined, an Error exception is thrown. Prior to PHP 8.0.0, an E_WARNING level error was generated in that case.
So in PHP 7 it probably didn't work either, but the supression did work.
from fatfree.
Great :-)
However, for anyone currently facing this issue (who doesn't want to edit base.php for the obvious reasons) a work around is to check and override $_SERVER['HTTP_ACCEPT_LANGUAGE']
before F3 instantiation.
from fatfree.
fixed
from fatfree.
Related Issues (20)
- Mapper and Virtual Field HOT 6
- Error messages missing where the actual error occurs HOT 1
- Mapper->load() fails if the first parameter is an empty array HOT 2
- undefined array keys in php 8.1 HOT 2
- Dockerized HOT 1
- 'kz' locale trouble HOT 1
- Google Static Maps v2 plug-in HOT 2
- Form data are not being parsed on patch HOT 1
- avoid useless database connections HOT 2
- Sql Mapper: Misleading error message when setting value for non existent field in the mapped table HOT 3
- How to use SQL Mapper save method to insert/update a geometry field type?
- Extend template error
- breakin in the middle of a <repeat> loop in an F3 template file. HOT 2
- Named route incorrectly includes the extra @params in the route HOT 2
- Google Static Maps - is this still a feature? HOT 1
- XDebug? HOT 2
- Custom date format not respecting parameters (PHP8.1) HOT 2
- Remove HTML comments from template (minifying) HOT 6
- Dockerised fatfree redirects broken HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fatfree.