Commit fa6e63cf authored by damjan's avatar damjan
Browse files

[BUGFIX] Not converting newlines to br tags

Related: forge.typo3.org/issues/66178
parent 4e926e29
......@@ -148,7 +148,7 @@ class FileBasePHPService extends FileBaseService {
$metaData = '';
foreach ($this->meta as $metaIndex => $value) {
$value = preg_replace('/[^\\\]\'/', '\\\'', str_replace("\n", '<br />', $value));
$value = preg_replace('/[^\\\]\'/', '\\\'', $value);
$metaData .= "\t" . '\'' . $metaIndex . '\' => \'' . $value . '\',' . "\n";
}
......@@ -193,7 +193,7 @@ class FileBasePHPService extends FileBaseService {
ksort($localLang);
foreach ($localLang as $const => $value) {
$value = preg_replace("/([^\\\])'/", "$1\'", $value);
$value = str_replace("\r", '', str_replace("\n", '<br />', $value));
$value = str_replace("\r", '', $value);
$content .= "\t\t'$const' => '$value',\n";
}
}
......@@ -215,7 +215,7 @@ class FileBasePHPService extends FileBaseService {
ksort($localLang);
foreach ($localLang as $const => $value) {
$value = preg_replace("/([^\\\])'/", "$1\'", $value);
$value = str_replace("\r", '', str_replace("\n", '<br />', $value));
$value = str_replace("\r", '', $value);
$content .= "\t'$const' => '$value',\n";
}
}
......
......@@ -290,7 +290,7 @@ class FileBaseXLFService extends FileBaseService {
ksort($localLang);
foreach ($localLang as $const => $value) {
$content[$const] = str_replace("\r", '', str_replace("\n", '<br />', $value));
$content[$const] = str_replace("\r", '', $value);
}
return $content;
......@@ -304,7 +304,7 @@ class FileBaseXLFService extends FileBaseService {
private function prepareMeta() {
if (is_array($this->meta) && count($this->meta)) {
foreach ($this->meta as $label => $value) {
$this->meta[$label] = str_replace("\r", '', str_replace("\n", '<br />', $value));
$this->meta[$label] = str_replace("\r", '', $value);
}
}
$this->addGeneratorString();
......
......@@ -252,7 +252,7 @@ class FileBaseXMLService extends FileBaseService {
ksort($localLang);
foreach ($localLang as $const => $value) {
$content['data'][$lang][$const] =
$value = str_replace("\r", '', str_replace("\n", '<br />', $value));
$value = str_replace("\r", '', $value);
}
return $content;
......@@ -266,7 +266,7 @@ class FileBaseXMLService extends FileBaseService {
private function prepareMeta() {
if (is_array($this->meta) && count($this->meta)) {
foreach ($this->meta as $label => $value) {
$this->meta[$label] = str_replace("\r", '', str_replace("\n", '<br />', $value));
$this->meta[$label] = str_replace("\r", '', $value);
}
}
$this->addGeneratorString();
......
......@@ -177,14 +177,14 @@ class FileOverrideService extends FileBaseXMLService {
}
foreach ($languageData as $constKey => $constValue) {
$localLangData = $this->originalFileObject->getLocalLangData($language);
if (SgLib::strCmpIgnoreCRConvertLF($constValue, $localLangData[$constKey])) {
if (SgLib::strCmpIgnoreCR($constValue, $localLangData[$constKey])) {
unset($this->localLang[$language][$constKey]);
}
}
}
foreach ($this->meta as $metaTag => $metaValue) {
if (SgLib::strCmpIgnoreCRConvertLF($metaValue, $this->originalFileObject->getMetaData($metaTag))) {
if (SgLib::strCmpIgnoreCR($metaValue, $this->originalFileObject->getMetaData($metaTag))) {
unset($this->meta[$metaTag]);
}
}
......
......@@ -325,8 +325,8 @@ class SgLib {
* @param string $string2
* @return bool
*/
public static function strCmpIgnoreCRConvertLF($string1, $string2) {
return is_string($string1) && str_replace("\r", '', str_replace("\n", '<br />', $string1)) === $string2;
public static function strCmpIgnoreCR($string1, $string2) {
return is_string($string1) && str_replace("\r", '', $string1) === $string2;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment