mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "ApiVisualEditorEdit: Add logging for funny etags"
This commit is contained in:
commit
44e3319824
|
@ -279,6 +279,22 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
if ( isset( $parserParams['oldid'] ) && $parserParams['oldid'] ) {
|
||||
$path .= '/' . $parserParams['oldid'];
|
||||
}
|
||||
// Adapted from RESTBase mwUtil.parseETag()
|
||||
if ( !preg_match( '/
|
||||
^(?:W\\/)?"?
|
||||
([^"\\/]+)
|
||||
(?:\\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))
|
||||
(?:\\/([^"]+))?
|
||||
"?$
|
||||
/x', $etag ) ) {
|
||||
$this->logger->info(
|
||||
__METHOD__ . ": Received funny ETag from client: {etag}",
|
||||
[
|
||||
'etag' => $etag,
|
||||
'requestPath' => $path,
|
||||
]
|
||||
);
|
||||
}
|
||||
return $this->requestRestbase(
|
||||
$title,
|
||||
'POST', $path, $data,
|
||||
|
|
Loading…
Reference in a new issue