Commit graph

46 commits

Author SHA1 Message Date
Ignacio R. Morelle
0e707d641e wam: Fix HTML injection attack on the add-ons.wesnoth.org web interface
This escapes all strings provided by add-ons server data to guarantee
they can't be used to get extraneous and potentially harmful HTML into
the generated web index.

However, and because I don't have time to look into the dense regex
contained in the relevant code right now, it also removes the hidden
feature of linkifying any URLs found in add-on descriptions. It's a
small price to pay for our safety, really.
2017-07-24 03:05:34 -04:00
Ignacio R. Morelle
1398133eac addons.w.o: New Year copyright update 2015-01-01 18:58:12 -03:00
Ignacio R. Morelle
40c549735f wam/html: Add add-on type labels for campaign_sp_mp and mod_mp 2014-06-26 19:18:10 -04:00
Groggy Dice
b7b8e54c06 html.py: hone regexes for URL linking
First, a couple of extraneous quotes were left in the second regex around
"</a>".

Second, it is possible that a period or question mark could be used to end
a sentence, rather than be part of the URL. So check that these characters
are followed by an alphanumeric character to make them part of the URL.
2014-05-16 01:46:42 -04:00
Groggy Dice
f859ceee06 style.css: no margin-bottom for <pre> 2014-05-16 01:45:07 -04:00
Groggy Dice
1ff17d1d9b html.py,style.css: use <pre> with no top-margin on all descriptions
After my last change dealing with this issue, I noticed that descriptions
with <pre> had an extra blank line at the top. Adding top-margin to the
CSS file made this go away, but it also made the <br/> superfluous. Thus,
it is simpler just to have every description use <pre> instead of <br/>.

This should finally resolve everything having to do with the add-on
descriptions.

If I'd noticed that the re module hadn't been imported, I probably wouldn't
have considered URL linking to be important enough to do so. Since I've
already written the code, however, I'll keep it.
2014-05-07 06:14:48 -04:00
Groggy Dice
a08fe82f2a html.py: replace Windows backslashes in icon paths
This is one source of missing-image results.

There remain other reasons for missing icons. The script doesn't find images
in add-ons. And when resources are moved or renamed, they are no longer found
by the script, even if they had been found before.

Also, capitalize a sentence.
2014-05-05 04:05:39 -04:00
Groggy Dice
acafb98bde style.css,html.py: use <pre> instead of <br/>; re.sub instead of re.finditer
After looking into it some more, I think I've figured out how to handle <pre>
in the CSS. So, use that, when description has more than one line.

Also, go to re.sub for turning URLs into links. The version of Python I was
testing my code on wasn't properly handling backreferences in the replacement
string when in the form "\#", causing me to use finditer instead of sub. But
I've discovered that it does handle backreferences in the form "\g<#>". So
switch to much simpler re.sub code.
2014-05-05 03:53:28 -04:00
Groggy Dice
219dc47817 html.py: import re module
Bugfix for last commit.
2014-04-25 02:46:57 -04:00
Groggy Dice
15899daee4 html.py: format add-on description for HTML
The description text does not get rendered very well on a webpage. One
solution might be to use pre-wrap/word-wrap in the CSS, but due to
differences between browsers, that's a can of worms (at least for me, I'm
not a web pro).

So, the not-so-elegant solution is to add <br/> to every line.

URLs are also not linked in the plain text. Although in modern browsers
you can select the text and right-click, it's still convenient to turn
them into actual links.
2014-04-25 01:29:21 -04:00
Ignacio R. Morelle
1d2a59b0ab addons.w.o: New Year copyright update 2014-01-01 02:18:05 -03:00
Alexander van Gessel
38b224c1ff Revert "Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old""
This reverts commit 23b72d6956.
2013-08-09 00:13:46 +02:00
Thibault Févry
23b72d6956 Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old"
This reverts commit 5fa5c03411, reversing
changes made to 06374c64ba.
2013-08-08 18:50:46 +02:00
Groggy Dice
9903fd227e fix <title> to only display branch directory
OK, so it turns out basename() was required after all!
2013-07-31 05:12:30 -04:00
Groggy Dice
09073d3ff5 add a <title> to UMC listing pages
As I read it, basename() should not be required for path, and I've tested this locally.
2013-07-31 01:32:26 -04:00
Ignacio R. Morelle
30c8f93e6c website: New Year copyright update 2013-01-01 00:47:00 +00:00
Ignacio R. Morelle
334a4c0f28 Update page footers for units.wesnoth.org,
add-ons.wesnoth.org and the macro reference
2011-12-31 23:27:08 +00:00
Thibault Févry
2288ef0939 Removed a lot of trailing whitespaces. Shouldn't be anymore in python scripts. 2011-03-12 02:22:21 +00:00
Ignacio R. Morelle
2966c02ce8 New year copyright notice update 2011-02-13 07:56:23 +00:00
Ignacio R. Morelle
2edce97b7c Update copyright notice time interval...
...in the source for the web interface to the add-ons server
2010-05-11 14:37:35 +00:00
Alexander van Gessel
25aa0b9359 Serially TC addon icons after iterating over the campaigns 2010-04-27 14:35:15 +01:00
Nils Kneuper
4095965813 remove a feature from the addon manager...
...that creates problems on the server atm:

no teamcolorize for the icon list till the server is fixed again what
should be done: serialize the teamcolorize call, so that the script
only starts one instance at a time
2010-04-27 10:38:56 +00:00
Gunter Labes
f6fdc4bea0 do not use os.system with user supplied data 2009-05-25 21:32:22 +00:00
Gunter Labes
73c11b17e8 Revert "made the add-on type case insensitive" 2009-05-24 09:55:00 +00:00
Gunter Labes
04ef17ba7a made the add-on type case insensitive 2009-05-24 02:00:55 +00:00
Gunter Labes
3a1686ebf1 added explanations for the different add-on types 2009-05-23 22:25:10 +00:00
Gunter Labes
3b188dd248 fixed some bugs with icon finding 2009-05-23 00:28:58 +00:00
Gunter Labes
b22f0d5e98 added a note on how to manually install add-ons...
...and a reminder that not all add-ons are campaigns..
2009-05-22 22:53:20 +00:00
Gunter Labes
b7628c80b0 made all paths relative to the addon manager dir 2009-05-22 22:53:16 +00:00
Gunter Labes
e2d63e2d54 improved icon finding + teamcoloring 2009-03-11 22:19:03 +00:00
Elias Pschernig
b2dfe246e7 addons website:
- Added sortable "Type" column

- Added sortkey to the "Size" column

- List available translations in the "Notes" column
2009-03-07 15:54:14 +00:00
Gunter Labes
ff4bf263c3 bold the size number to make sorting behave right 2009-03-07 15:46:47 +00:00
Elias Pschernig
1099a43513 Clarified the license of jquery.js and tablesorter.js...
...which are used by the HTML addons list generator script.
2009-01-02 16:11:10 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Alexander van Gessel
3df044e3ff State filesizes in proper SI-notation. 2008-11-03 04:02:36 +01:00
Elias Pschernig
7211157845 addon_manager:
- Table sorting now displays nice arrows (using the "jquery"
  javascript library for this now).

- Auto-create --tar folder.
2008-10-12 13:05:11 +00:00
Elias Pschernig
5908716518 addon_manager: fixed numeric sorting of downloads column 2008-10-11 10:54:19 +00:00
Elias Pschernig
7c2fa06b0a addon_manager: Made columns of HTML output sortable (with javascript). 2008-10-11 10:41:24 +00:00
Elias Pschernig
a33b05979b Added two options to wesnto_addon_manager:
--tar Causes tarballs to be generated for each addon newly downloaded
with --download.

--url=... Adds download links to the --html output, with the given
base URL.
2008-10-09 19:09:00 +00:00
Alexander van Gessel
9f314cd978 Fix some executable properties. 2008-09-30 15:07:09 +01:00
Alexander van Gessel
0063d92356 Adjust a lot of svn properties. 2008-09-30 14:06:26 +01:00
Gunter Labes
5e0012f5aa add the title to --list output and use title rather than name in html output 2008-09-29 15:28:21 +00:00
Gunter Labes
00d5bd4c4e added a note about how to install add-ons and how to see the descriptions 2008-09-28 13:23:44 +00:00
Gunter Labes
c80fbfffc7 used a better suited image for missing icons...
...and removed some obsolete links
2008-09-28 10:15:50 +00:00
Elias Pschernig
2892d0591b wesnot_addon_manager: Create --html output directory if it does not exist yet. 2008-09-27 15:33:37 +00:00
Elias Pschernig
464c1bd1db Added a --html option to wesnoth_addon_manager.
Soliton hinted that may be useful.
2008-09-27 15:24:38 +00:00