global $wgUseSquid, $wgInternalServer, $wgDeferredUpdateList;
$oldimage = $wgRequest->getText( 'oldimage' );
-
if ( strlen( $oldimage ) < 16 ) {
- $wgOut->unexpectedValueError( 'oldimage', $oldimage );
+ $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
+ return;
+ }
+ if ( strstr( $oldimage, "/" ) || strstr( $oldimage, "\\" ) ) {
+ $wgOut->unexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
return;
}
+
if ( wfReadOnly() ) {
$wgOut->readOnlyPage();
return;
$curfile = "{$dest}/{$name}";
if ( ! is_file( $curfile ) ) {
- $wgOut->fileNotFoundError( $curfile );
+ $wgOut->fileNotFoundError( htmlspecialchars( $curfile ) );
return;
}
$oldver = wfTimestampNow() . "!{$name}";