[moin-user] Double encoding bug in page names with spaces

PETER BLEACKLEY pete.bleackley at btinternet.com
Tue Aug 22 12:59:03 EDT 2017


I'm using MoinMoin 1.9.9, running as a wsgi app under Passenger on a shared Dreamhost server.
URLs including encoded spaces and puncuation are being processed wrongly. Consider the following HTML, returned from a page called [[Conlang Critic]]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="edit_on_doubleclick" content="/">
<meta name="robots" content="index,nofollow">
<title>Conlang%20Critic - The Conlang Sources Wiki</title>
<script type="text/javascript" src="/moin_static199/common/js/common.js"></script>
<script type="text/javascript">
<!--
var search_hint = "Search";
//-->
</script>
<script type="text/javascript">
<!-- // GUI edit link and i18n
var gui_editor_link_href = "/Conlang%2520Critic?action=edit&editor=gui";
var gui_editor_link_text = "Edit (GUI)";
//-->
</script>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/moin_static199/modernized/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/moin_static199/modernized/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="/moin_static199/modernized/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="/moin_static199/modernized/css/projection.css">
<!-- css only for MS IE6/IE7 browsers -->
<!--[if lt IE 8]>
   <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/moin_static199/modernized/css/msie.css">
<![endif]-->
<link rel="alternate" title="The Conlang Sources Wiki: Conlang%20Critic" href="/Conlang%2520Critic?diffs=1&show_att=1&action=rss_rc&unique=0&page=Conlang%2520Critic&ddiffs=1" type="application/rss+xml">
<link rel="alternate" type="application/wiki" title="Edit" href="/Conlang%2520Critic?action=edit">
<link rel="Start" href="/FrontPage">
<link rel="Alternate" title="Wiki Markup" href="/Conlang%2520Critic?action=raw">
<link rel="Alternate" media="print" title="Print View" href="/Conlang%2520Critic?action=print">
<link rel="Search" href="/FindPage">
<link rel="Index" href="/TitleIndex">
<link rel="Glossary" href="/WordIndex">
<link rel="Help" href="/HelpOnFormatting">
</head>
<body  lang="en" dir="ltr">
<div id="header">
<form id="searchform" method="get" action="/Conlang%2520Critic">
<div>
<input type="hidden" name="action" value="fullsearch">
<input type="hidden" name="context" value="180">
<label for="searchinput">Search:</label>
<input id="searchinput" type="text" name="value" value="" size="20"
    onfocus="searchFocus(this)" onblur="searchBlur(this)"
    onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search">
<input id="titlesearch" name="titlesearch" type="submit"
    value="Titles" alt="Search Titles">
<input id="fullsearch" name="fullsearch" type="submit"
    value="Text" alt="Search Full Text">
</div>
</form>
<script type="text/javascript">
<!--// Initialize search form
var f = document.getElementById('searchform');
f.getElementsByTagName('label')[0].style.display = 'none';
var e = document.getElementById('searchinput');
searchChange(e);
searchBlur(e);
//-->
</script>
<div id="logo"><a href="/FrontPage"><img src="/moin_static199/common/moinmoin.png" alt="MoinMoin Logo"></a></div>
<div id="username"><a class="nonexistent" href="/Conlang%2520Critic?action=login" id="login" rel="nofollow">Login</a></div>
<h1 id="locationline">
<span id="pagelocation"><a class="nonexistent" href="/Conlang%2520Critic">Conlang%20Critic</a></span>
</h1>
<ul id="navibar">
<li class="wikilink"><a href="/FrontPage">FrontPage</a></li><li class="wikilink"><a class="nonexistent" href="/RecentChanges">RecentChanges</a></li><li class="wikilink"><a class="nonexistent" href="/FindPage">FindPage</a></li><li class="wikilink"><a class="nonexistent" href="/HelpContents">HelpContents</a></li><li class="current"><a class="nonexistent" href="/Conlang%2520Critic">Conlang%20Critic</a></li>
</ul>
<div id="pageline"><hr style="display:none;"></div>
</div>
<div id="page" lang="en" dir="ltr">
<div dir="ltr" id="content" lang="en"><span class="anchor" id="top"></span>
<span class="anchor" id="line-1"></span><p class="line867"><strong><a class="action" href="/Conlang%2520Critic?action=edit">Create New Page</a></strong> <span class="anchor" id="bottom"></span></div>
<div id="pagebottom"></div>
</div>
<div id="footer">
<ul id="credits">
<li><a href="http://moinmo.in/" title="This site uses the MoinMoin Wiki software.">MoinMoin Powered</a></li><li><a href="http://moinmo.in/Python" title="MoinMoin is written in Python.">Python Powered</a></li><li><a href="http://moinmo.in/GPL" title="MoinMoin is GPL licensed.">GPL licensed</a></li><li><a href="http://validator.w3.org/check?uri=referer" title="Click here to validate this page.">Valid HTML 4.01</a></li>
</ul>
</div>
</body>
</html>
Note that Conlang%20Critic has been double encoded as Conlang%2520Critic
In 
<span class="anchor" id="line-1"></span><p class="line867"><strong><a class="action" href="/Conlang%2520Critic?action=edit">Create New Page</a></strong> <span class="anchor" id="bottom"></span></div>
how is the href generated?
wiki/data/pages/Conlang(20)Critic its contents do exist.
Pete Bleackley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20170822/3f10a805/attachment-0001.html>


More information about the moin-user mailing list