You are here

function _quote_filter_process in Quote 7

Same name and namespace in other branches
  1. 5 quote.module \_quote_filter_process()
  2. 6.2 quote.module \_quote_filter_process()
  3. 6 quote.module \_quote_filter_process()

Replace [quote] tags with markup for display.

Parameters

$text: The text with the [quote] tags that need to be replaced with HTML tags.

Return value

$text Filtered text.

2 calls to _quote_filter_process()
quote_filter_tips in ./quote.module
Implements hook_filter_tips().
_quote_filter_process_callback in ./quote.module
Generate and return the quote theming for a quote occurence found by _quote_filter_process().
1 string reference to '_quote_filter_process'
quote_filter_info in ./quote.module
Implements hook_filter_info().

File

./quote.module, line 279
The quote module provides a filter and appropriate links that allow users to quote nodes and other comments in their own comments.

Code

function _quote_filter_process($text) {
  if (stristr($text, '[quote')) {

    // Single regexp with callback allowing for theme calls and quote
    // nesting/recursion with regexp code from
    // http://de.php.net/manual/en/function.preg-replace-callback.php#85836
    $text = preg_replace_callback('#\\[(quote.*?)]((?>\\[(?!/?quote[^[]*?])|[^[]+|(?R))*)\\[/quote]#is', '_quote_filter_process_callback', $text);
  }
  return $text;
}