public function execute() {
$config = $this->getConfig();
$feedClasses = $config->get( 'FeedClasses' );
+ $params = [];
try {
$params = $this->extractRequestParams();
break;
case UploadBase::HOOK_ABORTED:
- $this->dieWithError( $params, 'hookaborted', [ 'details' => $verification['error'] ] );
+ $msg = $verification['error'] === '' ? 'hookaborted' : $verification['error'];
+ $this->dieWithError( $msg, 'hookaborted', [ 'details' => $verification['error'] ] );
break;
default:
$this->dieWithError( 'apierror-unknownerror-nocode', 'unknown-error',
$wgAutoloadClasses += $data['autoload'];
$hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ?
+ /** @suppress PhanUndeclaredVariable $wgHooks is set by DefaultSettings */
$wgHooks['LoadExtensionSchemaUpdates'] : [];
if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
) {
$inputPos = 0;
$outputPos = 0;
+ $contentPos = 0;
$output = '';
$foundStart = false;
$encStart = preg_quote( $startDelim, '!' );
trigger_error( E_USER_WARNING, get_class( $e ) . ': ' . $e->getMessage() );
};
- $this->profiler = isset( $params['profiler'] ) ? $params['profiler'] : null;
+ $this->profiler = isset( $conf['profiler'] ) ? $conf['profiler'] : null;
$this->trxProfiler = isset( $conf['trxProfiler'] )
? $conf['trxProfiler']
: new TransactionProfiler();
'ChronologyProtection' => 'true'
];
- $this->cliMode = isset( $params['cliMode'] ) ? $params['cliMode'] : PHP_SAPI === 'cli';
+ $this->cliMode = isset( $conf['cliMode'] ) ? $conf['cliMode'] : PHP_SAPI === 'cli';
$this->hostname = isset( $conf['hostname'] ) ? $conf['hostname'] : gethostname();
- $this->agent = isset( $params['agent'] ) ? $params['agent'] : '';
+ $this->agent = isset( $conf['agent'] ) ? $conf['agent'] : '';
$this->ticket = mt_rand();
}
}
} else {
array_unshift( $this->mode, self::MODE_IGNORE );
- array_unshift( $this->curItem, $elm );
+ array_unshift( $this->curItem, $ns . ' ' . $tag );
return;
}
}
}
- return $this->formatDate( $bits, $linked );
+ return $this->formatDate( $bits, $matches[0], $linked );
}
/**
* @param array $bits
+ * @param string $orig Original input string, to be returned
+ * on formatting failure.
* @param bool $link
* @return string
*/
- public function formatDate( $bits, $link = true ) {
+ private function formatDate( $bits, $orig, $link = true ) {
$format = $this->targets[$this->mTarget];
if ( !$link ) {
}
}
if ( $fail ) {
- /** @todo FIXME: $matches doesn't exist here, what's expected? */
- $text = $matches[0];
+ // This occurs when parsing a date with day or month outside the bounds
+ // of possibilities.
+ $text = $orig;
}
$isoBits = [];
$batch = new LinkBatch();
# Give some pointers to make (last) links
$this->mForm->prevId = [];
+ $rev_id = null;
foreach ( $this->mResult as $row ) {
$batch->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) );
$batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) );
- $rev_id = isset( $rev_id ) ? $rev_id : $row->rev_id;
- if ( $rev_id > $row->rev_id ) {
- $this->mForm->prevId[$rev_id] = $row->rev_id;
- } elseif ( $rev_id < $row->rev_id ) {
- $this->mForm->prevId[$row->rev_id] = $rev_id;
+ if ( isset( $rev_id ) ) {
+ if ( $rev_id > $row->rev_id ) {
+ $this->mForm->prevId[$rev_id] = $row->rev_id;
+ } elseif ( $rev_id < $row->rev_id ) {
+ $this->mForm->prevId[$row->rev_id] = $rev_id;
+ }
}
$rev_id = $row->rev_id;
private $noahTableStack = [ [] ];
public function __destruct() {
+ $next = null;
for ( $node = $this->head; $node; $node = $next ) {
$next = $node->nextAFE;
$node->prevAFE = $node->nextAFE = $node->nextNoah = null;
if ( !is_readable( $phpfile ) ) {
$this->error( "Error reading $phpfile", 1 );
}
+ $messages = null;
include $phpfile;
$phpfileContents = file_get_contents( $phpfile );
);
foreach ( $res as $s ) {
+ $title = Title::makeTitle( $s->page_namespace, $s->page_title );
try {
- $title = Title::makeTitle( $s->page_namespace, $s->page_title );
-
$rev = new Revision( $s );
$content = $rev->getContent();
* with complicated cross-file globals that you have no
* hope of fixing.
*/
- 'ignore_undeclared_variables_in_global_scope' => false,
+ 'ignore_undeclared_variables_in_global_scope' => true,
/**
* Set to true in order to attempt to detect dead
"PhanUndeclaredProperty",
// approximate error count: 3
"PhanUndeclaredStaticMethod",
- // approximate error count: 79
- "PhanUndeclaredVariable",
],
/**