Fix systematic errors in pagination, sucursal warnings, and fatal count() errors across multiple modules

This commit is contained in:
2026-01-07 01:06:27 -06:00
parent aaa77e870e
commit 3a5afa82fe
354 changed files with 9022 additions and 15093 deletions

View File

@@ -224,7 +224,7 @@ switch ( $sapi ) {
}
if ( isset($opts['t']) ) {
$arr = split(',',$opts['t']);
$arr = explode(',',$opts['t']);
$types = array();
foreach ($arr as $type)
$types[ trim($type) ] = 1;

View File

@@ -230,8 +230,9 @@ abstract class Frame_Reflower {
// Convert escaped hex characters into ascii characters (e.g. \A => newline)
$string = preg_replace_callback("/\\\\([0-9a-fA-F]{0,6})(\s)?(?(2)|(?=[^0-9a-fA-F]))/",
create_function('$matches',
'return chr(hexdec($matches[1]));'),
function($matches) {
return chr(hexdec($matches[1]));
},
$string);
return $string;
}

View File

@@ -377,16 +377,18 @@ class Text_Frame_Reflower extends Frame_Reflower {
// faster than doing a single-pass character by character scan. Heh,
// yes I took the time to bench it ;)
$words = array_flip(preg_split("/[\s-]+/u",$str, -1, PREG_SPLIT_DELIM_CAPTURE));
array_walk($words, create_function('&$val,$str',
'$val = Font_Metrics::get_text_width($str, "'.addslashes($font).'", '.$size.', '.$word_spacing.', '.$char_spacing.');'));
array_walk($words, function(&$val, $str) use ($font, $size, $word_spacing, $char_spacing) {
$val = Font_Metrics::get_text_width($str, $font, $size, $word_spacing, $char_spacing);
});
arsort($words);
$min = reset($words);
break;
case "pre":
$lines = array_flip(preg_split("/\n/u", $str));
array_walk($lines, create_function('&$val,$str',
'$val = Font_Metrics::get_text_width($str, "'.addslashes($font).'", '.$size.', '.$word_spacing.', '.$char_spacing.');'));
array_walk($lines, function(&$val, $str) use ($font, $size, $word_spacing, $char_spacing) {
$val = Font_Metrics::get_text_width($str, $font, $size, $word_spacing, $char_spacing);
});
arsort($lines);
$min = reset($lines);
@@ -413,8 +415,9 @@ class Text_Frame_Reflower extends Frame_Reflower {
case "pre-wrap":
// Find the longest word (i.e. minimum length)
$lines = array_flip(preg_split("/\n/", $text));
array_walk($lines, create_function('&$val,$str',
'$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$word_spacing.', '.$char_spacing.');'));
array_walk($lines, function(&$val, $str) use ($font, $size, $word_spacing, $char_spacing) {
$val = Font_Metrics::get_text_width($str, $font, $size, $word_spacing, $char_spacing);
});
arsort($lines);
reset($lines);
$str = key($lines);