Skip to content

Commit 177b6d0

Browse files
committed
fix php8 deprecations
1 parent 69e489a commit 177b6d0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/helper/TextHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function truncate_text($text, $length = 30, $truncate_string = '...', $truncate_
5050

5151
if ($strlen($text) > $length) {
5252
if ($truncate_pattern) {
53-
$length_min = null !== $length_max && (0 == $length_max || $length_max > $length) ? $length : null;
53+
$length_min = null !== $length_max && (0 == $length_max || $length_max > $length) ? $length : 0;
5454

5555
preg_match($truncate_pattern, $text, $matches, PREG_OFFSET_CAPTURE, $length_min);
5656

lib/util/sfToolkit.class.php

+4
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ public static function arrayDeepMerge()
245245
*/
246246
public static function stringToArray($string)
247247
{
248+
if (null === $string) {
249+
return array();
250+
}
251+
248252
preg_match_all('/
249253
\s*((?:\w+-)*\w+) # key \\1
250254
\s*=\s* # =

0 commit comments

Comments
 (0)