$title = Title::newFromRow( $result );
$ret = Linker::link( $title, null, array(), array(), array( 'known' ) );
if ( $result->pp_value !== '' ) {
- $propValue = Html::element( 'span', array( 'class' => 'prop-value' ), $result->pp_value );
- $value = $this->msg( 'parentheses' )->rawParams( $propValue )->escaped();
- $ret .= " $value";
+ // Do not show very long or binary values on the special page
+ $valueLength = strlen( $result->pp_value );
+ $isBinary = strpos( $result->pp_value, "\0" ) !== false;
+ $isTooLong = $valueLength > 1024;
+
+ if ( $isBinary || $isTooLong ) {
+ $message = $this
+ ->msg( $isBinary ? 'pageswithprop-prophidden-binary' : 'pageswithprop-prophidden-long' )
+ ->numParams( round( $valueLength / 1024, 2 ) );
+
+ $propValue = Html::element( 'span', array( 'class' => 'prop-value-hidden' ), $message->text() );
+ } else {
+ $propValue = Html::element( 'span', array( 'class' => 'prop-value' ), $result->pp_value );
+ }
+
+ $ret .= $this->msg( 'colon-separator' )->escaped() . $propValue;
}
return $ret;
They may have to link to a more appropriate page instead.<br />
A page is treated as a disambiguation page if it uses a template that is linked from [[MediaWiki:Disambiguationspage]].",
-'pageswithprop' => 'Pages with a page property',
-'pageswithprop-summary' => '', # do not translate or duplicate this message to other languages
-'pageswithprop-legend' => 'Pages with a page property',
-'pageswithprop-text' => 'This page lists pages that use a particular page property.',
-'pageswithprop-prop' => 'Property name:',
-'pageswithprop-submit' => 'Go',
+'pageswithprop' => 'Pages with a page property',
+'pageswithprop-summary' => '', # do not translate or duplicate this message to other languages
+'pageswithprop-legend' => 'Pages with a page property',
+'pageswithprop-text' => 'This page lists pages that use a particular page property.',
+'pageswithprop-prop' => 'Property name:',
+'pageswithprop-submit' => 'Go',
+'pageswithprop-prophidden-long' => 'long text property value hidden ($1 kilobytes)',
+'pageswithprop-prophidden-binary' => 'binary property value hidden ($1 kilobytes)',
'doubleredirects' => 'Double redirects',
'doubleredirects-summary' => '', # do not translate or duplicate this message to other languages
{{Identical|Property name}}',
'pageswithprop-submit' => 'Label for the submit button on [[Special:PagesWithProp]].
{{Identical|Go}}',
+'pageswithprop-prophidden-long' => 'Information shown on [[Special:PagesWithProp]] when property value is longer than 1 kilobyte.
+See also {{msg-mw|pageswithprop-prophidden-binary}}.
+Parameters:
+* $1 - size of property value in kilobytes',
+'pageswithprop-prophidden-binary' => 'Information shown on [[Special:PagesWithProp]] when property value contains binary data.
+See also {{msg-mw|pageswithprop-prophidden-long}}.
+Parameters:
+* $1 - size of property value in kilobytes',
'doubleredirects' => '{{doc-special|DoubleRedirects}}',
'doubleredirectstext' => 'Shown on top of [[Special:Doubleredirects]]',
'pageswithprop-text',
'pageswithprop-prop',
'pageswithprop-submit',
+ 'pageswithprop-prophidden-long',
+ 'pageswithprop-prophidden-binary',
),
'doubleredirects' => array(
'doubleredirects',