From 63874447c104fc1e1324aa1bb673ccccb809c398 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Feb 2018 13:57:46 -0500 Subject: [PATCH] simplify string replace --- bibtexbrowser.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 5867752..8084cbb 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -959,10 +959,7 @@ function xtrim($line) { // 2010-06-30 // bug found by Thomas // windows new line is **\r\n"** and not the other way around!! - $line = str_replace("\r\n",' ', $line);//windows like - $line = str_replace("\n",' ', $line);//unix-like - // we also replace tabs - $line = str_replace("\t",' ', $line); + $line = str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $line); // remove superfluous spaces e.g. John+++Bar $line = preg_replace('/ {2,}/',' ', $line); return $line;