add check for php-mbstring extension

fix typos
Dieser Commit ist enthalten in:
o.pinke 2021-08-25 13:57:35 +02:00
Ursprung e3a04c543b
Commit c684277786
2 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -261,4 +261,3 @@ class EditArea {
return $sJsResult; return $sJsResult;
} }
} }
?>

Datei anzeigen

@ -209,7 +209,11 @@ function fileEdit($filename, $sCode, $path) {
if (is_writable($path . $filename)) { if (is_writable($path . $filename)) {
if (strlen(stripslashes(trim($sCode))) > 0) { if (strlen(stripslashes(trim($sCode))) > 0) {
if (!empty($sCode)) { if (!empty($sCode)) {
if (extension_loaded('mbstring')) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); $sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING');
} else {
$oNot->displayNotification("warning", i18n("PHP-mbstring extension is not activated or installed!"));
}
} }
cFileHandler::write($path . $filename, $sCode); cFileHandler::write($path . $filename, $sCode);
return true; return true;
@ -232,9 +236,14 @@ function fileEdit($filename, $sCode, $path) {
* @return (string|void) Either content of file o nothing * @return (string|void) Either content of file o nothing
*/ */
function getFileContent($filename, $path) { function getFileContent($filename, $path) {
$oNot = new Contenido_Notification();
$sCode = cFileHandler::read($path . $filename); $sCode = cFileHandler::read($path . $filename);
if (!empty($sCode)) { if (!empty($sCode)) {
if (extension_loaded('mbstring')) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); $sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING');
} else {
$oNot->displayNotification("warning", i18n("PHP-mbstring extension is not activated or installed!"));
}
} }
return $sCode; return $sCode;
} }
@ -324,5 +333,3 @@ function fileValidateFilename($filename, $notifyAndExitOnFailure = true) {
} }
return true; return true;
} }
?>