$timestamp = $useTimestamp ? wfTimestamp( TS_UNIX, filemtime( $file ) ) : wfTimestampNow();
$title = Title::newFromText( $pageName );
- $exists = $title->exists();
- $oldRevID = $title->getLatestRevID();
- $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) : null;
-
- if ( !$title ) {
+ // Have to check for # manually, since it gets interpreted as a fragment
+ if ( !$title || $title->hasFragment() ) {
$this->error( "Invalid title $pageName. Skipping.\n" );
$skipCount++;
continue;
}
+ $exists = $title->exists();
+ $oldRevID = $title->getLatestRevID();
+ $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) : null;
$actualTitle = $title->getPrefixedText();
if ( $exists ) {