Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Geeklog-Core/geeklog
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Jan 21, 2022
2 parents 8f204e4 + a74c295 commit 54322ee
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 60 deletions.
15 changes: 8 additions & 7 deletions public_html/lib-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -8965,14 +8965,15 @@ function COM_escHTML($str, $flags = ENT_QUOTES, $isDoubleEncode = true, $encodin
*/
function COM_nl2br($string)
{
if (!defined('XHTML')) {
define('XHTML', '');
}

$replace = '<br' . XHTML . '>';
$find = array("\r\n", "\n\r", "\r", "\n");
if (empty($string)) {
return $string;
} else {
if (!defined('XHTML')) {
define('XHTML', '');
}

return str_replace($find, $replace, $string);
return str_replace(["\r\n", "\n\r", "\r", "\n"], '<br' . XHTML . '>', $string);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion public_html/usersettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function edituser()
'about_value',
GLText::getEditText($A['about'], $postMode, GLTEXT_LATEST_VERSION)
);
$preferences->set_var('pgpkey_value', htmlspecialchars($A['pgpkey']));
$preferences->set_var('pgpkey_value', !empty($A['pgpkey']) ? htmlspecialchars($A['pgpkey']) : '');
$preferences->set_var(array(
'plaintext_selected' => (($postMode === 'plaintext') ? ' selected="selected"' : ''),
'html_selected' => (($postMode === 'html') ? ' selected="selected"' : ''),
Expand Down

0 comments on commit 54322ee

Please sign in to comment.