Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75976 META: Calls passing nulls to built in functions not accepting nulls
  3. MDL-76362

Avoid passing null to functions strictly requiring strings (PHP 8.1)

XMLWordPrintable

      PHP 8.1 shows notice when null is passed to the functions such as strlen(), trim(), str_replace(), preg_replace(), json_decode(), etc

      There are a bunch of places that we were able to detect running unittests and behat but I'm sure there are more

      $a = null;
      var_dump(strlen($a));
      var_dump(strlen($a ?? ''));
      


            marina Marina Glancy
            marina Marina Glancy
            Andrew Lyons Andrew Lyons
            Jun Pataleta Jun Pataleta
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 20 minutes
                2d 5h 20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.