Commit 72837008 authored by Tim Rohaly's avatar Tim Rohaly Committed by Jordan Karlov
Browse files

Issue #3252703 by TR: PHP 8.1: Deprecated function: preg_match(): Passing null...

Issue #3252703 by TR: PHP 8.1: Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
parent 7d3d0e28
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -237,7 +237,17 @@ function views_aggregator_average(array $groups, $field_handler, $precision_grou
function views_aggregator_count(array $groups, $field_handler, $group_regexp = NULL, $column_regexp = NULL) {
  $values = [];
  $count_column = 0;
  $regexp = isset($group_regexp) ? $group_regexp : $column_regexp;

  if (isset($group_regexp)) {
    $regexp = $group_regexp;
  }
  elseif (isset($column_regexp)) {
    $regexp = $column_regexp;
  }
  else {
    $regexp = '';
  }

  if (preg_match('/[a-zA-Z0-9_]+/', $regexp)) {
    // Interpret omitted brace chars in the regexp as a verbatim text match.
    $regexp = "/$regexp/";
@@ -275,7 +285,17 @@ function views_aggregator_count(array $groups, $field_handler, $group_regexp = N
function views_aggregator_count_unique(array $groups, $field_handler, $group_regexp = NULL, $column_regexp = NULL) {
  $values = [];
  $count_column = 0;
  $regexp = isset($group_regexp) ? $group_regexp : $column_regexp;

  if (isset($group_regexp)) {
    $regexp = $group_regexp;
  }
  elseif (isset($column_regexp)) {
    $regexp = $column_regexp;
  }
  else {
    $regexp = '';
  }

  if (preg_match('/[a-zA-Z0-9_]+/', $regexp)) {
    // Interpret omitted brace chars in the regexp as a verbatim text match.
    $regexp = "/$regexp/";