mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[PR #891] [MERGED] Do not iterate non-array Traversables #1401
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#1401
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/891
Author: @naderman
Created: 11/24/2016
Status: ✅ Merged
Merged: 11/26/2016
Merged by: @Seldaek
Base:
1.x← Head:t/do-not-iterate-non-arrays📝 Commits (1)
45de570Don't even try to attempt normalizing iterators or generators in context📊 Changes
1 file changed (+2 additions, -6 deletions)
View changed files
📝
src/Monolog/Formatter/NormalizerFormatter.php(+2 -6)📄 Description
Iterators and Generators may not be rewindable, so foreach is not safe to use on them.
Iterators and especially Generators may trigger irreversible actions on calling next(), so iterating over all values can potentially cause harm, e.g. imagine an iterator over a set of HTTP POST requests that are sent when the next value is requested . The only sufficiently safe thing to iterate and include here are primitive arrays.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.