rcube_string_replacer

Helper class for string replacements based on preg_replace_callback

package

Framework

subpackage

Utils

Methods

__construct

__construct($options = array()) 

Arguments

$options

Add a string to the internal list

add($str) : int

Arguments

$str

Response

int

Index of value for retrieval

Build replacement string

get_replacement($i) 

Arguments

$i

Callback to add an entry to the link index

linkref_addindex($matches) 

Arguments

$matches

Callback to replace link references with real links

linkref_callback($matches) 

Arguments

$matches

Callback function used to build mailto: links around e-mail strings

mailto_callback($matches) : int

Arguments

$matches

Response

int

Index of saved string value

Look up the index from the preg_replace matches array and return the substitution value.

replace_callback($matches) : string

Arguments

$matches

Response

string

Value at index $matches[1]

Replace all defined (link|mailto) patterns with replacement string

replace(string $str) : string

Arguments

$str

string

Text

Response

string

Text

Replace substituted strings with original values

resolve($str) 

Arguments

$str

Fixes bracket characters in URL handling

parse_url_brackets(&$url) 
static

Arguments

$url

Properties

pattern

pattern : 
static

mailto_pattern

mailto_pattern : 

linkref_index

linkref_index : 

linkref_pattern

linkref_pattern : 

values

values : 

options

options : 

linkrefs

linkrefs : 

urls

urls :