Loading modules/filter/filter.module +3 −1 Original line number Diff line number Diff line Loading @@ -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 = ''; Loading @@ -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); Loading modules/taxonomy/taxonomy.test +18 −0 Original line number Diff line number Diff line Loading @@ -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))); } } } Loading Loading
modules/filter/filter.module +3 −1 Original line number Diff line number Diff line Loading @@ -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 = ''; Loading @@ -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); Loading
modules/taxonomy/taxonomy.test +18 −0 Original line number Diff line number Diff line Loading @@ -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))); } } } Loading