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) : integer

Arguments

$str

Response

integer

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) : integer

Arguments

$matches

Response

integer

Index of saved string value

Fixes bracket characters in URL handling

parse_url_brackets( &$url) 
static

Arguments

$url

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

replace(string $str) : string

Arguments

$str

string

Text

Response

string

Text

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 substituted strings with original values

resolve( $str) 

Arguments

$str

Properties

pattern

pattern : 
static

Type(s)

mailto_pattern

mailto_pattern : 

Type(s)

linkref_index

linkref_index : 

Type(s)

linkref_pattern

linkref_pattern : 

Type(s)

values

values : 

Type(s)

options

options : 

Type(s)

linkrefs

linkrefs : 

Type(s)

urls

urls : 

Type(s)

noword

noword : 

Type(s)