Skip to content

Commit c57381b

Browse files
maskaravivekmisaochan
authored andcommitted
Fix category edits (commons-app#1823)
1 parent 5105b27 commit c57381b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/src/main/java/fr/free/nrw/commons/mwapi/ApacheHttpClientMediaWikiApi.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ public boolean pageExists(String pageName) throws IOException {
270270
public String edit(String editToken, String processedPageContent, String filename, String summary) throws IOException {
271271
return api.action("edit")
272272
.param("title", filename)
273-
.param("token", editToken)
273+
.param("token", getEditToken())
274+
.param("centralauthtoken", getCentralAuthToken())
274275
.param("text", processedPageContent)
275276
.param("summary", summary)
276277
.post()
@@ -283,7 +284,8 @@ public String edit(String editToken, String processedPageContent, String filenam
283284
public String appendEdit(String editToken, String processedPageContent, String filename, String summary) throws IOException {
284285
return api.action("edit")
285286
.param("title", filename)
286-
.param("token", editToken)
287+
.param("token", getEditToken())
288+
.param("centralauthtoken", getCentralAuthToken())
287289
.param("appendtext", processedPageContent)
288290
.param("summary", summary)
289291
.post()
@@ -295,7 +297,8 @@ public String appendEdit(String editToken, String processedPageContent, String f
295297
public String prependEdit(String editToken, String processedPageContent, String filename, String summary) throws IOException {
296298
return api.action("edit")
297299
.param("title", filename)
298-
.param("token", editToken)
300+
.param("token", getEditToken())
301+
.param("centralauthtoken", getCentralAuthToken())
299302
.param("prependtext", processedPageContent)
300303
.param("summary", summary)
301304
.post()

0 commit comments

Comments
 (0)