phpBB API Documentation
Class

phpbb\textformatter\s9e\parser

class parser implements parser_interface

s9e\TextFormatter\Parser adapter

Methods

__construct(driver_interface $cache, string $key, factory $factory, dispatcher_interface $dispatcher)

Constructor

string parse(string $text)

Parse given text

null disable_bbcode(string $name)

Disable a specific BBCode

disable_bbcodes()

Disable BBCodes in general

disable_censor()

Disable the censor

disable_magic_url()

Disable magic URLs

disable_smilies()

Disable smilies

null enable_bbcode(string $name)

Enable a specific BBCode

enable_bbcodes()

Enable BBCodes in general

enable_censor()

Enable the censor

enable_magic_url()

Enable magic URLs

enable_smilies()

Enable smilies

array[] get_errors()

Get the list of errors that were generated during last parsing

Parser get_parser()

Return the instance of s9e\TextFormatter\Parser used by this object

null set_var(string $name, mixed $value)

Set a variable to be used by the parser

null set_vars(array $vars)

Set multiple variables to be used by the parser

static mixed filter_flash_height(string $height, integer $max_height, Logger $logger)

Filter a flash object's height

static mixed filter_flash_width(string $width, integer $max_width, Logger $logger)

Filter a flash object's width

static mixed filter_font_size(string $size, integer $max_size, Logger $logger)

Filter the value used in a [size] BBCode

static string|bool filter_img_url(string $url, array $url_config, Logger $logger)

Filter an image's URL to enforce restrictions on its dimensions

Details

at line 43
public __construct(driver_interface $cache, string $key, factory $factory, dispatcher_interface $dispatcher)

Constructor

Parameters

driver_interface $cache
string $key Cache key
factory $factory
dispatcher_interface $dispatcher

at line 76
public string parse(string $text)

Parse given text

Parameters

string $text

Return Value

string

at line 110
public null disable_bbcode(string $name)

Disable a specific BBCode

Parameters

string $name BBCode name

Return Value

null

at line 118
public disable_bbcodes()

Disable BBCodes in general

at line 126
public disable_censor()

Disable the censor

at line 134
public disable_magic_url()

Disable magic URLs

at line 143
public disable_smilies()

Disable smilies

at line 152
public null enable_bbcode(string $name)

Enable a specific BBCode

Parameters

string $name BBCode name

Return Value

null

at line 160
public enable_bbcodes()

Enable BBCodes in general

at line 168
public enable_censor()

Enable the censor

at line 176
public enable_magic_url()

Enable magic URLs

at line 185
public enable_smilies()

Enable smilies

at line 197
public array[] get_errors()

Get the list of errors that were generated during last parsing

Return Value

array[] Array of arrays. Each array contains a lang string at index 0 plus any number of optional parameters

at line 269
public Parser get_parser()

Return the instance of s9e\TextFormatter\Parser used by this object

Return Value

Parser

at line 277
public null set_var(string $name, mixed $value)

Set a variable to be used by the parser

Parameters

string $name
mixed $value

Return Value

null

at line 296
public null set_vars(array $vars)

Set multiple variables to be used by the parser

Parameters

array $vars Associative array of [name => value]

Return Value

null

at line 314
static public mixed filter_flash_height(string $height, integer $max_height, Logger $logger)

Filter a flash object's height

Parameters

string $height
integer $max_height
Logger $logger

Return Value

mixed Original value if valid, FALSE otherwise

See also

bbcode_firstpass::bbcode_flash()

at line 336
static public mixed filter_flash_width(string $width, integer $max_width, Logger $logger)

Filter a flash object's width

Parameters

string $width
integer $max_width
Logger $logger

Return Value

mixed Original value if valid, FALSE otherwise

See also

bbcode_firstpass::bbcode_flash()

at line 358
static public mixed filter_font_size(string $size, integer $max_size, Logger $logger)

Filter the value used in a [size] BBCode

Parameters

string $size Original size
integer $max_size Maximum allowed size
Logger $logger

Return Value

mixed Original value if valid, FALSE otherwise

See also

bbcode_firstpass::bbcode_size()

at line 386
static public string|bool filter_img_url(string $url, array $url_config, Logger $logger)

Filter an image's URL to enforce restrictions on its dimensions

Parameters

string $url Original URL
array $url_config Config used by the URL filter
Logger $logger

Return Value

string|bool Original value if valid, FALSE otherwise

See also

bbcode_firstpass::bbcode_img()