-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Error when StringWrapper/Intl:strlen is passed null (BC break in 3.4.0) #29
Comments
These operations require string input as per API signature?
…On Tue, 6 Jul 2021, 00:12 Dick Ittmann, ***@***.***> wrote:
In 3.4.0 (because/after declare(strict_types=1) was added) when null is
passed to StringWrapper/Intl:strlen a Fatal Error is thrown.
This was not the case in previous versions (up to 3.3.1)
PHP Fatal error: Uncaught TypeError: grapheme_strlen() expects parameter 1
to be string, null given in
/application/vendor/laminas/laminas-stdlib/src/StringWrapper/Intl.php:55
For example (in our case) it is triggered in an application using
laminas-mvc-console when php public/index.php is run without arguments
(this normally displays usage information)
PHP Fatal error: Uncaught TypeError: grapheme_strlen() expects parameter 1 to be string, null given in /application/vendor/laminas/laminas-stdlib/src/StringWrapper/Intl.php:55
Stack trace:
#0 /application/vendor/laminas/laminas-stdlib/src/StringWrapper/Intl.php(55): grapheme_strlen(NULL)
#1 /application/vendor/laminas/laminas-mvc-console/src/View/RouteNotFoundStrategy.php(397): Laminas\Stdlib\StringWrapper\Intl->strlen(NULL)
#2 /application/vendor/laminas/laminas-mvc-console/src/View/RouteNotFoundStrategy.php(344): Laminas\Mvc\Console\View\RouteNotFoundStrategy->renderTable(Array, 3, 237)
#3 /application/vendor/laminas/laminas-mvc-console/src/View/RouteNotFoundStrategy.php(153): Laminas\Mvc\Console\View\RouteNotFoundStrategy->getConsoleUsage(Object(Laminas\Console\Adapter\Posix), 'index.php', Object(Laminas\ModuleManager\ModuleManager))
#4 /application/vendor/laminas/laminas-eventmanager/src/EventManager.php(331): Laminas\Mvc\Console\View\RouteNotFoundStrategy->handleRouteNotFoundError(Object(Laminas\Mvc\MvcEvent))
#5 /applic in /application/vendor/laminas/laminas-stdlib/src/StringWrapper/Intl.php on line 55
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#29>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEC6XSRAHSF3FSTFLETTWIU57ANCNFSM473M6D2A>
.
|
grapheme_strlen does, but StringWrapper/Intl:strlen didn't before / without the strict_types it didn't throw an error |
It always did:
https://github.com/laminas/laminas-stdlib/blob/e89c2268c9cad25099f562f7f015c28c5dd383c9/src/StringWrapper/Intl.php
See the ***@***.*** string`?
…On Tue, 6 Jul 2021, 00:17 Dick Ittmann, ***@***.***> wrote:
These operations require string input as per API signature?
grapheme_strlen does, but StringWrapper/Intl:strlen didn't before
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEHJC45XZP3P2GJCUY3TWIVOHANCNFSM473M6D2A>
.
|
yes, but without the |
Closing as duplicate of laminas/laminas-escaper#20 |
Ocramius
added
Bug
Something isn't working
Invalid
This doesn't seem right
Duplicate
This issue or pull request already exists
labels
Jul 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In 3.4.0 (because/after
declare(strict_types=1)
was added) when null is passed to StringWrapper/Intl:strlen a Fatal Error is thrown.This was not the case in previous versions (up to 3.3.1)
PHP Fatal error: Uncaught TypeError: grapheme_strlen() expects parameter 1 to be string, null given in /application/vendor/laminas/laminas-stdlib/src/StringWrapper/Intl.php:55
For example (in our case) it is triggered in an application using laminas-mvc-console when
php public/index.php
is run without arguments (this normally displays usage information)The text was updated successfully, but these errors were encountered: