99moorem / wikiteam

Automatically exported from code.google.com/p/wikiteam
0 stars 0 forks source link

uploader.py needs escaping #88

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
uploader.py just takes random regex-ed HTML (both from APIs and screenscraping) 
and then spits it out as shell commands: definitely not a good idea.

For proteopedia is also breaks with "sh: Syntax error: redirection unexpected", 
because one of their fields has single quotes:

curl --location --header 'x-amz-auto-make-bucket:1' --header 
'x-archive-queue-derive:0' --header 'x-archive-size-hint:8634381217' --header 
'authorization: <redacted>' --header 'x-archive-meta-mediatype:web' --header 
'x-archive-meta-collection:wikiteam' --header 'x-archive-meta-title:Wiki - 
proteopediaorg_wiki' --header 'x-archive-meta-description:<a 
href="http://www.proteopedia.org/wiki/index.php">proteopediaorg_wiki</a> dumped 
with <a href="http://code.google.com/p/wikiteam/" rel="nofollow">WikiTeam</a> 
tools.' --header 'x-archive-meta-language:English' --header 
'x-archive-meta-last-updated-date:2014-01-28' --header 
'x-archive-meta-subject:wiki; wikiteam; MediaWiki; proteopediaorg_wiki; 
proteopediaorg_wiki' --header 
'x-archive-meta-licenseurl:/wiki/index.php/Proteopedia:Terms_of_Service' 
--header 'x-archive-meta-rights:User-added text is available under <a 
href="/wiki/index.php/Proteopedia:Terms_of_Service" title="Proteopedia:Terms of 
Service">Proteopedia:Terms of Service</a> and the <a 
href='http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attributio
n-ShareAlike_3.0_Unported_License'>CC-BY-SA 3.0</a> License. <br/>Content 
aggregated by Proteopedia from external resources falls under the respective 
resources' copyrights.  See the <a 
href="http://proteopedia.org/wiki/index.php/Proteopedia:Terms_of_Service">Terms 
of Service</a><br/>' --header 
'x-archive-meta-originalurl:http://www.proteopedia.org/wiki/index.php' 
--upload-file proteopediaorg_wiki-20140128-wikidump.7z 
http://s3.us.archive.org/wiki-proteopediaorg_wiki/proteopediaorg_wiki-20140128-w
ikidump.7z

Original issue reported on code.google.com by nemow...@gmail.com on 29 Jan 2014 at 8:15

GoogleCodeExporter commented 8 years ago
Should be fixed by r935.

Original comment by nemow...@gmail.com on 29 Jan 2014 at 9:27

GoogleCodeExporter commented 8 years ago
And, properly, by its followup r936. Now more thoroughly tested and verified 
working (on linux).

Original comment by nemow...@gmail.com on 29 Jan 2014 at 10:35

GoogleCodeExporter commented 8 years ago
Reopening, I got a "sh: Syntax error: Unterminated quoted string" for 
http://www.farete.it/mediawiki/api.php . No time to investigate right now.

Original comment by nemow...@gmail.com on 31 Jan 2014 at 12:34

GoogleCodeExporter commented 8 years ago
Will probably be fixed by eliminating nasty bash commands, i.e. issue 54.

Original comment by nemow...@gmail.com on 26 Feb 2014 at 11:29