mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-09 06:46:40 +02:00
Use normal replacement for @ in slugify
This commit is contained in:
@@ -1166,6 +1166,7 @@ class Stringy implements Countable, IteratorAggregate, ArrayAccess
|
||||
{
|
||||
$stringy = $this->toAscii();
|
||||
|
||||
$stringy->str = str_replace('@', $replacement, $stringy);
|
||||
$quotedReplacement = preg_quote($replacement);
|
||||
$pattern = "/[^a-zA-Z\d\s-_$quotedReplacement]/u";
|
||||
$stringy->str = preg_replace($pattern, '', $stringy);
|
||||
|
@@ -1108,7 +1108,7 @@ class StringyTestCase extends PHPUnit_Framework_TestCase
|
||||
['another-foo-bar', 'another..& foo -.-"-...bar'],
|
||||
['foo-dbar', " Foo d'Bar "],
|
||||
['a-string-with-dashes', 'A string-with-dashes'],
|
||||
['userhost', 'user@host'],
|
||||
['user-host', 'user@host'],
|
||||
['using-strings-like-foo-bar', 'Using strings like fòô bàř'],
|
||||
['numbers-1234', 'numbers 1234'],
|
||||
['perevirka-ryadka', 'перевірка рядка'],
|
||||
|
Reference in New Issue
Block a user