Kartographer
Extension that adds maps to wiki pages
Loading...
Searching...
No Matches
Kartographer\SimpleStyleParser Class Reference

Parses and sanitizes text properties of GeoJSON/simplestyle by putting them through parser. More...

+ Inheritance diagram for Kartographer\SimpleStyleParser:

Public Member Functions

 __construct ( $parser, array $options=[])
 
 parse ( $input)
 Parses string into JSON and performs validation/sanitization.
 
 parseObject (&$data)
 Validate and sanitize a parsed GeoJSON data object.
 
 normalizeAndSanitize (&$data)
 Normalize an object.
 

Static Public Member Functions

static updateMarkerSymbolCounters (array $values, array &$counters=[])
 

Protected Member Functions

 sanitize (&$json)
 Performs recursive sanitizaton.
 
 normalize (&$json)
 Normalizes JSON.
 

Detailed Description

Parses and sanitizes text properties of GeoJSON/simplestyle by putting them through parser.

Constructor & Destructor Documentation

◆ __construct()

Kartographer\SimpleStyleParser::__construct ( $parser,
array $options = [] )
Parameters
MediaWikiWikitextParser | Parser$parser
array$optionsSet ['saveUnparsed' => true] to back up the original values of title and description in _origtitle and _origdescription

Member Function Documentation

◆ normalize()

Kartographer\SimpleStyleParser::normalize ( & $json)
protected

Normalizes JSON.

Parameters
stdClass[] | stdClass&$json
Returns
Status

Reimplemented in Kartographer\Tests\Mock\MockSimpleStyleParser.

◆ normalizeAndSanitize()

Kartographer\SimpleStyleParser::normalizeAndSanitize ( & $data)

Normalize an object.

Parameters
stdClass[] | stdClass&$data
Returns
Status

◆ parse()

Kartographer\SimpleStyleParser::parse ( $input)

Parses string into JSON and performs validation/sanitization.

Parameters
string | null$input
Returns
Status

◆ parseObject()

Kartographer\SimpleStyleParser::parseObject ( & $data)

Validate and sanitize a parsed GeoJSON data object.

Parameters
array | stdClass&$data
Returns
Status

◆ sanitize()

Kartographer\SimpleStyleParser::sanitize ( & $json)
protected

Performs recursive sanitizaton.

Does not attempt to be smart, just recurses through everything that can be dangerous even if not a valid GeoJSON.

Parameters
stdClass[] | stdClass&$json

Reimplemented in Kartographer\Tests\Mock\MockSimpleStyleParser.

◆ updateMarkerSymbolCounters()

static Kartographer\SimpleStyleParser::updateMarkerSymbolCounters ( array $values,
array & $counters = [] )
static
Parameters
stdClass[]$values
int[]&$counters
Returns
array|false [ string $markerSymbol, stdClass $markerProperties ]

The documentation for this class was generated from the following file: