Merge "ApiVisualEditorEdit: Add logging for funny etags"

This commit is contained in:
jenkins-bot 2019-10-02 21:32:30 +00:00 committed by Gerrit Code Review
commit 44e3319824

View file

@ -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,