Commit 8eac033b authored by Drew Webber's avatar Drew Webber
Browse files

Issue #3316901 by poker10, solideogloria, mcdruid: hash(): Passing null to...

Issue #3316901 by poker10, solideogloria, mcdruid: hash(): Passing null to parameter #2 ($data) of type string is deprecated in check_markup()
parent 98011383
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -773,6 +773,8 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE)
    return '';
  }

  $text = (string) $text;

  // Check for a cached version of this piece of text.
  $cache = $cache && !empty($format->cache);
  $cache_id = '';
@@ -785,7 +787,7 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE)

  // Convert all Windows and Mac newlines to a single newline, so filters only
  // need to deal with one possibility.
  $text = str_replace(array("\r\n", "\r"), "\n", (string) $text);
  $text = str_replace(array("\r\n", "\r"), "\n", $text);

  // Get a complete list of filters, ordered properly.
  $filters = filter_list_format($format->format);
+18 −0
Original line number Diff line number Diff line
@@ -1948,6 +1948,24 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
      $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language, 'sanitize' => FALSE));
      $this->assertEqual($output, $expected, format_string('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
    }

    // Verify that tokens are generated for terms with empty description.
    $term1->description = '';
    taxonomy_term_save($term1);
    $term2->description = NULL;
    taxonomy_term_save($term2);

    // Generate and test sanitized tokens.
    $tests = array();
    $tests['[term:description]'] = '';

    foreach ($tests as $input => $expected) {
      $output = token_replace($input, array('term' => $term1), array('language' => $language));
      $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));

      $output = token_replace($input, array('term' => $term2), array('language' => $language));
      $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
    }
  }

}