Skip to content
Snippets Groups Projects
Commit 4634d213 authored by Peter Rotich's avatar Peter Rotich
Browse files

fixes: Minor bug fixes

parent 1e6d0df5
Branches
Tags
No related merge requests found
...@@ -1766,7 +1766,7 @@ class DatetimeField extends FormField { ...@@ -1766,7 +1766,7 @@ class DatetimeField extends FormField {
function to_database($value) { function to_database($value) {
// Store time in gmt time, unix epoch format // Store time in gmt time, unix epoch format
return date('Y-m-d H:i:s', $value); return $value ? date('Y-m-d H:i:s', $value) : $value;
} }
function to_php($value) { function to_php($value) {
......
...@@ -1014,7 +1014,7 @@ function mb_wordwrap($string, $width=75, $break="\n", $cut=false) { ...@@ -1014,7 +1014,7 @@ function mb_wordwrap($string, $width=75, $break="\n", $cut=false) {
} else { } else {
// Anchor the beginning of the pattern with a lookahead // Anchor the beginning of the pattern with a lookahead
// to avoid crazy backtracking when words are longer than $width // to avoid crazy backtracking when words are longer than $width
$pattern = '/(?=[\s\p{Ps}])(.{1,'.$width.'})(?:\s|$|(\p{Ps}))/uS'; $search = '/(?=[\s\p{Ps}])(.{1,'.$width.'})(?:\s|$|(\p{Ps}))/uS';
$replace = '$1'.$break.'$2'; $replace = '$1'.$break.'$2';
} }
return rtrim(preg_replace($search, $replace, $string), $break); return rtrim(preg_replace($search, $replace, $string), $break);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment