PHP error

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

/media/shnoulle/data/webdev/master/application/helpers/expressions/em_core_helper.php(2308)

2296      * This version properly handles nested curly braces and curly braces within strings within curly braces - both of which are needed to better support JavaScript
2297      * 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.
2298      * @param string $src
2299      * @return array
2300      */
2301     public function asSplitStringOnExpressions($src)
2302     {
2303         // Empty string, return an array
2304         if ($src === "") {
2305             return array();
2306         }
2307         // No replacement to do, preg_split get more time than strpos
2308         if (strpos($src, "{") === false || $src === "{"  || $src === "}") {
2309             return array (
2310                 0 => array ($src,0,'STRING')
2311             );
2312         };
2313 
2314         // Seems to need split and replacement
2315         $parts = preg_split($this->RDP_ExpressionRegex, $src, -1, (PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE));
2316 
2317         $count = count($parts);
2318         $tokens = array();
2319         $inSQString = false;
2320         $inDQString = false;

Stack Trace

#0
+
 /media/shnoulle/data/webdev/master/application/helpers/expressions/em_core_helper.php(2308): strpos(null, "{")
2303         // Empty string, return an array
2304         if ($src === "") {
2305             return array();
2306         }
2307         // No replacement to do, preg_split get more time than strpos
2308         if (strpos($src, "{") === false || $src === "{"  || $src === "}") {
2309             return array (
2310                 0 => array ($src,0,'STRING')
2311             );
2312         };
2313 
#1
+
 /media/shnoulle/data/webdev/master/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
+
 /media/shnoulle/data/webdev/master/application/helpers/expressions/em_core_helper.php(1974): ExpressionManager->sProcessStringContainingExpressionsHelper(null, 0, 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-11-03 10:17:37 nginx/1.22.1 Yii Framework/1.1.28