PHP error

strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

/var/www/html/limesurvey/application/helpers/expressions/em_core_helper.php(2304)

2292      * This version properly handles nested curly braces and curly braces within strings within curly braces - both of which are needed to better support JavaScript
2293      * Users still need to add a space or carriage return after opening braces (and ideally before closing braces too) to avoid  having them treated as expressions.
2294      * @param string $src
2295      * @return array
2296      */
2297     public function asSplitStringOnExpressions($src)
2298     {
2299         // Empty string, return an array
2300         if ($src === "") {
2301             return array();
2302         }
2303         // No replacement to do, preg_split get more time than strpos
2304         if (strpos($src, "{") === false || $src === "{"  || $src === "}") {
2305             return array (
2306                 0 => array ($src,0,'STRING')
2307             );
2308         };
2309 
2310         // Seems to need split and replacement
2311         $parts = preg_split($this->RDP_ExpressionRegex, $src, -1, (PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE));
2312 
2313         $count = count($parts);
2314         $tokens = array();
2315         $inSQString = false;
2316         $inDQString = false;

Stack Trace

#0
+
 /var/www/html/limesurvey/application/helpers/expressions/em_core_helper.php(2304): strpos(null, "{")
2299         // Empty string, return an array
2300         if ($src === "") {
2301             return array();
2302         }
2303         // No replacement to do, preg_split get more time than strpos
2304         if (strpos($src, "{") === false || $src === "{"  || $src === "}") {
2305             return array (
2306                 0 => array ($src,0,'STRING')
2307             );
2308         };
2309 
#1
+
 /var/www/html/limesurvey/application/helpers/expressions/em_core_helper.php(2003): ExpressionManager->asSplitStringOnExpressions(null)
1998      * @return string
1999      */
2000     public function sProcessStringContainingExpressionsHelper($src, $questionNum, $staticReplacement = false)
2001     {
2002         // tokenize string by the {} pattern, properly dealing with strings in quotations, and escaped curly brace values
2003         $stringParts = $this->asSplitStringOnExpressions($src);
2004         $resolvedParts = array();
2005         $prettyPrintParts = array();
2006         $this->ResetErrorsAndWarnings();
2007         foreach ($stringParts as $stringPart) {
2008             if ($stringPart[2] == 'STRING') {
#2
+
 /var/www/html/limesurvey/application/helpers/expressions/em_core_helper.php(1974): ExpressionManager->sProcessStringContainingExpressionsHelper(null, 40, false)
1969 
1970         $prettyPrintIterationDone = false;
1971         for ($i = 1; $i <= $numRecursionLevels; ++$i) {
1972             // TODO - Since want to use <span> for dynamic substitution, what if there are recursive substititons?
1973             $prevResult = $result;
1974             $result = $this->sProcessStringContainingExpressionsHelper($result, $questionNum, $staticReplacement);
1975             if ($result === $prevResult) {
1976                 // No update during process : can exit of iteration
1977                 if (!$prettyPrintIterationDone) {
1978                     $prettyPrint = $this->prettyPrintSource;
1979                 }
2023-05-31 14:11:52 Apache/2.4.52 (Ubuntu) Yii Framework/1.1.28