[GH-ISSUE #1511] Fatal error: Uncaught TypeError: substr() #642

Closed
opened 2026-03-04 02:16:37 +03:00 by kerem · 4 comments
Owner

Originally created by @HendrikCromboom on GitHub (Nov 5, 2020).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1511

Monolog version 2.1.1

Repeatable on multiple devices with fresh version:

When using BrowserConsoleHandler:

Fatal error: Uncaught TypeError: substr() expects parameter 3 to be int, null given in /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php:34 Stack trace: #0 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php(34): substr() #1 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(179): Monolog\Utils::substr() #2 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(153): Monolog\Handler\BrowserConsoleHandler::handleStyles() #3 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(70): Monolog\Handler\BrowserConsoleHandler::generateScript() #4 [internal function]: Monolog\Handler\BrowserConsoleHandler::send() #5 {main} thrown in /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php on line 34

Originally created by @HendrikCromboom on GitHub (Nov 5, 2020). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1511 Monolog version 2.1.1 Repeatable on multiple devices with fresh version: When using BrowserConsoleHandler: Fatal error: Uncaught TypeError: substr() expects parameter 3 to be int, null given in /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php:34 Stack trace: #0 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php(34): substr() #1 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(179): Monolog\Utils::substr() #2 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(153): Monolog\Handler\BrowserConsoleHandler::handleStyles() #3 /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php(70): Monolog\Handler\BrowserConsoleHandler::generateScript() #4 [internal function]: Monolog\Handler\BrowserConsoleHandler::send() #5 {main} thrown in /var/www/html/monolog-php/vendor/monolog/monolog/src/Monolog/Utils.php on line 34
kerem 2026-03-04 02:16:37 +03:00
  • closed this issue
  • added the
    Bug
    label
Author
Owner

@HendrikCromboom commented on GitHub (Nov 5, 2020):

Substr can be hardcoded towards a non-null value to solve this part of the issue.

<!-- gh-comment-id:722414428 --> @HendrikCromboom commented on GitHub (Nov 5, 2020): Substr can be hardcoded towards a non-null value to solve this part of the issue.
Author
Owner

@HendrikCromboom commented on GitHub (Nov 5, 2020):

Rolling back to previous stable candidate solves the issue.

<!-- gh-comment-id:722435712 --> @HendrikCromboom commented on GitHub (Nov 5, 2020): Rolling back to previous stable candidate solves the issue.
Author
Owner

@grubolsch commented on GitHub (Nov 5, 2020):

I provided a bugfix for this that was merged a while again.
https://github.com/Seldaek/monolog/pull/1490

Was this revert for some reason, can I help out with this?

<!-- gh-comment-id:722437214 --> @grubolsch commented on GitHub (Nov 5, 2020): I provided a bugfix for this that was merged a while again. https://github.com/Seldaek/monolog/pull/1490 Was this revert for some reason, can I help out with this?
Author
Owner

@Seldaek commented on GitHub (Dec 10, 2020):

Nope the issue is that I did not release a bugfix release since it was merged. Will try and get that done soon. You can require ^2.1@dev in the meantime.

<!-- gh-comment-id:742608479 --> @Seldaek commented on GitHub (Dec 10, 2020): Nope the issue is that I did not release a bugfix release since it was merged. Will try and get that done soon. You can require `^2.1@dev` in the meantime.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#642
No description provided.