Skip to content

Commit

Permalink
Fix parseLines()
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis authored Jun 9, 2018
1 parent 8966acf commit a2fb237
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function stripSpace($string): string
public static function parseLines($text, $toAssoc = true): array
{
$text = htmlspecialchars_decode($text);
$text = self::clean($text);
$text = self::clean($text, false, false, false);

$text = str_replace(["\n", "\r", "\r\n", PHP_EOL], "\n", $text);
$lines = explode("\n", $text);
Expand Down Expand Up @@ -86,11 +86,15 @@ public static function parseLines($text, $toAssoc = true): array
* @param string $string
* @param bool $toLower
* @param bool $addSlashes
* @param bool $removeAccents
* @return string
*/
public static function clean($string, $toLower = false, $addSlashes = false): string
public static function clean($string, $toLower = false, $addSlashes = false, $removeAccents = true): string
{
$string = Slug::removeAccents($string);
if ($removeAccents) {
$string = Slug::removeAccents($string);
}

$string = strip_tags($string);
$string = trim($string);

Expand Down

0 comments on commit a2fb237

Please sign in to comment.