eldur / jwbf

Java Wiki Bot Framework is a library to maintain Wikis like Wikipedia based on MediaWiki.
http://jwbf.sourceforge.net/
Apache License 2.0
78 stars 33 forks source link

FileUpload uses wrong input for GetApiToken #61

Closed leonard84 closed 8 years ago

leonard84 commented 8 years ago

The FileUpload uses simpleFile.getPath() which just delegates to file.getPath() this causes issues if the path is relative, since relative paths are forbidden. uploadTokenAction = new GetApiToken(Intoken.EDIT, simpleFile.getPath());

For the actual upload it uses the correct title property of SimpleFile .param("filename", MediaWiki.urlEncode(simpleFile.getTitle()))

So all that is to do here is to change uploadTokenAction = new GetApiToken(Intoken.EDIT, simpleFile.getPath()); to uploadTokenAction = new GetApiToken(Intoken.EDIT, MediaWiki.urlEncode(simpleFile.getTitle()));

eldur commented 8 years ago

Sounds good, can you submit a patch?

leonard84 commented 8 years ago

Done, could you please publish a new release when #62 is merged, it is effectively blocking our use of jwbf.

leonard84 commented 8 years ago

@eldur great, could you please publish a bugfix release.

leonard84 commented 8 years ago

@eldur is there anything blocking a bugfix release?

eldur commented 8 years ago

holidays 😄

leonard84 commented 8 years ago

@eldur could you give me an ETA?

eldur commented 8 years ago

is released as 3.1.1

leonard84 commented 8 years ago

thanks