Semantic MediaWiki and related extensions
Static Public Member Functions | List of all members
SMW\Encoder Class Reference

Static Public Member Functions

static escape ( $string)
 
static unescape ( $string)
 
static encode ( $string)
 
static decode ( $string)
 

Detailed Description

GNU GPL v2+

Since
2.1
Author
mwjames

Member Function Documentation

◆ decode()

static SMW\Encoder::decode (   $string)
static
Since
2.1
Parameters
string$string
Returns
string

◆ encode()

static SMW\Encoder::encode (   $string)
static
See also
SMWInfolink::encodeParameters
Since
2.2
Parameters
string$string
Returns
string

◆ escape()

static SMW\Encoder::escape (   $string)
static
See also
SMWInfolink::encodeParameters

Escape certain problematic values. Use SMW-escape (like URLencode but - instead of % to prevent double encoding by later MW actions) : SMW's parameter separator, must not occur within params // - : used in SMW-encoding strings, needs escaping too [ ] < > < > '' |: problematic in MW titles & : sometimes problematic in MW titles ([[&]] is OK, [[&test]] is OK, [[]] is not OK) (Note: '&' in strings obtained during parsing already has replaced by UTF8 anyway) ' ': are equivalent with '_' in MW titles, but are not equivalent in certain parameter values "\n": real breaks not possible in [[...]] "#": has special meaning in URLs, triggers additional MW escapes (using . for %) '': must be escaped to prevent any impact of double decoding when replacing - by % before urldecode '?': if not escaped, strange effects were observed on some sites (printout and other parameters ignored without obvious cause); SMW-escaping is always save to do – it just make URLs less readable

Since
2.2
Parameters
string$string
Returns
string

◆ unescape()

static SMW\Encoder::unescape (   $string)
static

Reverse of self::escape

Since
2.5
Parameters
$string
Returns
string

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

About | General disclaimer | Privacy policy