Skip to content

Weird behavior of Str::slug in particular language #54444

Closed
@kenan-recebli

Description

@kenan-recebli

Laravel Version

11.41.3

PHP Version

8.3.16

Database Driver & Version

No response

Description

I think it's better just to show:

Image

First, I couldn't realize why slug becomes longer, then noticed extra letters. Then tried to manually delete letters to find out letter combinations that cause this issue.

Maybe it happens in other languages too, but I tested some languages, they all return nad.

Maybe there is are other combinations also, that behaves weird, but I didn't test.

First, I thought that it's because of the ascii method, but no. I couldn't find the source of this issue.

UPDATE
Find out a little bit more combinations (in the second example letter is trimmed):

Image

Steps To Reproduce

Just do:
str('nad')->slug('az')
str('yab')->slug('az')
str('ab')->slug('az')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions