mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-12-13 17:08:23 +00:00
cf1480cb96
The mb_strpos() function throws E_WARNING if the offset is longer than the length of the string. Bug: T209600 Change-Id: Ib4296ba136eaf5c8461681e9d5f108118b2494f4
51 lines
599 B
Plaintext
51 lines
599 B
Plaintext
# @todo expand
|
|
!! functionhooks
|
|
len
|
|
!! endfunctionhooks
|
|
|
|
!! test
|
|
#len
|
|
!! input
|
|
{{#len:}}
|
|
{{#len:0}}
|
|
{{#len:test}}
|
|
!!result
|
|
<p>0
|
|
1
|
|
4
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#urldecode
|
|
!! input
|
|
{{#urldecode:}}
|
|
{{#urldecode:foo%20bar}}
|
|
{{#urldecode:%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%92%D0%B8%D0%BA%D0%B8}}
|
|
{{#urldecode: some unescaped string}}
|
|
!! result
|
|
<p>foo bar
|
|
МедиаВики
|
|
some unescaped string
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#pos
|
|
!! input
|
|
{{#pos:Žmržlina|žlina}}
|
|
{{#pos:stringstring|str|4}}
|
|
!! result
|
|
<p>3
|
|
6
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#pos with too large offset (T209600)
|
|
!! input
|
|
{{#pos:FooBar|Foo|32}}
|
|
!! result
|
|
|
|
!! end
|