Skip to content

Commit

Permalink
Optimize regex and trim text
Browse files Browse the repository at this point in the history
  • Loading branch information
bcosca committed Jul 13, 2018
1 parent 7100969 commit d383f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion log.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Log {
**/
function write($text,$format='r') {
$fw=Base::instance();
foreach (preg_split('/\r\n|\r|\n/',$text) as $line)
foreach (preg_split('/\r?\n|\r/',trim($text)) as $line)
$fw->write(
$this->file,
date($format).
Expand Down

0 comments on commit d383f6f

Please sign in to comment.