@@ -426,7 +426,7 @@ public function getValues($keys = null, $format = 's', $maxDepth = 1)
426426 * @param string|null $format format to use for the output
427427 * @return mixed formatted value of the variable
428428 */
429- public function getVar ($ key , $ format = null )
429+ public function getVar ($ key , ? string $ format = null )
430430 {
431431 $ format = (null === $ format ) ? 's ' : (string ) $ format ;
432432 $ ret = null ;
@@ -437,7 +437,7 @@ public function getVar($key, $format = null)
437437 $ myts = \MyTextSanitizer::getInstance ();
438438 switch ($ this ->vars [$ key ]['data_type ' ]) {
439439 case XOBJ_DTYPE_INT :
440- $ ret = (null === $ ret ) ? null : (int ) $ ret ;
440+ $ ret = (null === $ ret ) ? '' : (int ) $ ret ;
441441 break ;
442442 case XOBJ_DTYPE_UNICODE_TXTBOX :
443443 case XOBJ_DTYPE_TXTBOX :
@@ -446,13 +446,13 @@ public function getVar($key, $format = null)
446446 case 'show ' :
447447 case 'e ' :
448448 case 'edit ' :
449- return $ myts ->htmlSpecialChars ($ ret );
449+ return $ myts ->htmlSpecialChars (( string ) $ ret );
450450 break 1 ;
451451 case 'p ' :
452452 case 'preview ' :
453453 case 'f ' :
454454 case 'formpreview ' :
455- return $ myts ->htmlSpecialChars ($ ret );
455+ return $ myts ->htmlSpecialChars (( string ) $ ret );
456456 break 1 ;
457457 case 'n ' :
458458 case 'none ' :
@@ -489,7 +489,7 @@ public function getVar($key, $format = null)
489489 break 1 ;
490490 case 'f ' :
491491 case 'formpreview ' :
492- return htmlspecialchars ($ ret , ENT_QUOTES | ENT_HTML5 );
492+ return htmlspecialchars (( string ) $ ret , ENT_QUOTES | ENT_HTML5 );
493493 break 1 ;
494494 case 'n ' :
495495 case 'none ' :
@@ -541,15 +541,15 @@ public function getVar($key, $format = null)
541541 break 1 ;
542542 case 'e ' :
543543 case 'edit ' :
544- return htmlspecialchars ($ ret , ENT_QUOTES | ENT_HTML5 );
544+ return htmlspecialchars (( string ) $ ret , ENT_QUOTES | ENT_HTML5 );
545545 break 1 ;
546546 case 'p ' :
547547 case 'preview ' :
548548 return $ ret ;
549549 break 1 ;
550550 case 'f ' :
551551 case 'formpreview ' :
552- return htmlspecialchars ($ ret , ENT_QUOTES | ENT_HTML5 );
552+ return htmlspecialchars (( string ) $ ret , ENT_QUOTES | ENT_HTML5 );
553553 break 1 ;
554554 case 'n ' :
555555 case 'none ' :
0 commit comments