Skip to content
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

[10.x] Escape the delimiter when extracting an excerpt from text #48765

Merged
merged 1 commit into from
Oct 18, 2023
Merged

[10.x] Escape the delimiter when extracting an excerpt from text #48765

merged 1 commit into from
Oct 18, 2023

Conversation

standaniels
Copy link
Contributor

@standaniels standaniels commented Oct 18, 2023

This PR adds the delimiter to the preg_quote() function so it will be escaped.

Currently, when passing the delimiter (/) as the phrase to the Str::excerpt() method, you would get an error since it is not escaped:

Str::excerpt('', '/'); // ErrorException : preg_match(): Unknown modifier ')'

@taylorotwell taylorotwell merged commit 19c0454 into laravel:10.x Oct 18, 2023
21 checks passed
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
Co-authored-by: Stan Daniëls <stan@nachomail.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants