$retval = array();
if ( is_array( $metadata ) ) {
foreach ( $metadata as $key => $value ) {
- $r = array( 'name' => $key );
+ $r = array(
+ 'name' => $key,
+ ApiResult::META_BC_BOOLS => array( 'value' ),
+ );
if ( is_array( $value ) ) {
$r['value'] = self::processMetaData( $value, $result );
} else {
*/
const COMPRESSED = 2;
+ /**
+ * Flag: indicates data is an integer
+ */
+ const INTVAL = 4;
+
// }}}
/**
*/
if ( $flags & self::SERIALIZED ) {
$ret[$rkey] = unserialize( $ret[$rkey] );
+ } elseif ( $flags & self::INTVAL ) {
+ $ret[$rkey] = intval( $ret[$rkey] );
}
}
$flags = 0;
- if ( !is_scalar( $val ) ) {
+ if ( is_int( $val ) ) {
+ $flags |= self::INTVAL;
+ } elseif ( !is_scalar( $val ) ) {
$val = serialize( $val );
$flags |= self::SERIALIZED;
if ( $this->_debug ) {
default:
$func = 'urlencode';
}
- return $parser->markerSkipCallback( $s, $func );
+ // See T105242, where the choice to kill markers and various
+ // other options were discussed.
+ return $func( $parser->killMarkers( $s ) );
}
public static function lcfirst( $parser, $s = '' ) {
*/
class MovePageForm extends UnlistedSpecialPage {
/** @var Title */
- protected $oldTitle;
+ protected $oldTitle = null;
/** @var Title */
protected $newTitle;
// Yes, the use of getVal() and getText() is wanted, see bug 20365
$oldTitleText = $request->getVal( 'wpOldTitle', $target );
- $this->oldTitle = Title::newFromText( $oldTitleText );
+ if ( is_string( $oldTitleText ) ) {
+ $this->oldTitle = Title::newFromText( $oldTitleText );
+ }
- if ( is_null( $this->oldTitle ) ) {
+ if ( $this->oldTitle === null ) {
+ // Either oldTitle wasn't passed, or newFromText returned null
throw new ErrorPageError( 'notargettitle', 'notargettext' );
}
if ( !$this->oldTitle->exists() ) {
indexpageids: 1,
titles: title.getPrefixedDb()
} ).then( function ( result ) {
- if ( result.query.pageids.length > 0 ) {
+ if ( result.query.pageids && result.query.pageids.length > 0 ) {
pageId = result.query.pageids[0];
page = result.query.pages[pageId];
{{urlencode:x<nowiki/>y}}
{{urlencode:x<nowiki/>y|wiki}}
{{urlencode:x<nowiki/>y|path}}
+{{urlencode:x<pre id="one">two</pre>y}}
!! html
<p>xy
xy
xy
+xy
</p>
!! end