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, integer $max_height, integer $max_width)

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

Details

at line 42
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 75
public string parse(string $text)

Parse given text

Parameters

string $text

Return Value

string

at line 109
public null disable_bbcode(string $name)

Disable a specific BBCode

Parameters

string $name BBCode name

Return Value

null

at line 117
public disable_bbcodes()

Disable BBCodes in general

at line 125
public disable_censor()

Disable the censor

at line 133
public disable_magic_url()

Disable magic URLs

at line 142
public disable_smilies()

Disable smilies

at line 151
public null enable_bbcode(string $name)

Enable a specific BBCode

Parameters

string $name BBCode name

Return Value

null

at line 159
public enable_bbcodes()

Enable BBCodes in general

at line 167
public enable_censor()

Enable the censor

at line 175
public enable_magic_url()

Enable magic URLs

at line 184
public enable_smilies()

Enable smilies

at line 196
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 247
public Parser get_parser()

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

Return Value

Parser

at line 255
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 274
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 292
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 314
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 336
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 365
static public string|bool filter_img_url(string $url, array $url_config, Logger $logger, integer $max_height, integer $max_width)

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
integer $max_height Maximum height allowed
integer $max_width Maximum width allowed

Return Value

string|bool Original value if valid, FALSE otherwise

See also

bbcode_firstpass::bbcode_img()