[ckan-changes] commit/ckan: dread: [lib]: #1431 Fix exception when foreign chars in recaptcha submission.
Bitbucket
commits-noreply at bitbucket.org
Mon Oct 31 17:51:57 UTC 2011
1 new commit in ckan:
https://bitbucket.org/okfn/ckan/changeset/711a68a12d90/
changeset: 711a68a12d90
branch: release-v1.5
user: dread
date: 2011-10-31 18:42:23
summary: [lib]: #1431 Fix exception when foreign chars in recaptcha submission.
affected #: 2 files
diff -r 85a4cd3694da876d80890ce451e44b859571f0c4 -r 711a68a12d90fefc0c4a484e38116a7ffdfcccda CHANGELOG.txt
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,35 @@
CKAN CHANGELOG
++++++++++++++
+v1.5 XXXX-XX-XX
+===============
+(not finished - got to 1294 branch 61adc4dde07e
+Major:
+ * New visual theme (#1108)
+ * Package & Resource edit overhaul (#1294/#1296)
+ * Resource edit overhaul (#1296)
+ * JS and CSS reorganisation (#1282)
+ * Apache Solr used for search in core instead of Postgres (#1275)
+ * Authorization system now embedded in the logic layer (#1253)
+ * Captcha added for user registration (#1307)
+ * UI language translations refreshed
+ * Action API improved with docs now (#1315)
+
+Minor:
+ * Cross-Origin Resource Sharing (CORS) support (#1271)
+ * Strings to translate into other languages tidied up (#1249)
+ * Resource format autocomplete (#816)
+ * Database disconnection gives better error message (#1290)
+ * Log-in cookie is preserved between sessions (#78)
+ * Extensions can access formalchemy forms (#1301)
+ * 'Dataset' is the new name for 'Package' (#1293)
+
+Bug fixes:
+ * Purging of revisions didn't work (since 1.4.3) (#1258)
+ * Search indexing wasn't working for SOLR (since 1.4.3) (#1256)
+ * Configuration errors were being ignored (since always) (#1172)
+ * Flash messages were temporarily held-back when using proxy cache (since 1.3.2)(#1321)
+
v1.4.3.1 2011-09-30
===================
Minor:
diff -r 85a4cd3694da876d80890ce451e44b859571f0c4 -r 711a68a12d90fefc0c4a484e38116a7ffdfcccda ckan/lib/captcha.py
--- a/ckan/lib/captcha.py
+++ b/ckan/lib/captcha.py
@@ -4,7 +4,8 @@
import urllib2
def check_recaptcha(request):
- '''Check a user's recaptcha submission is valid, and raise CaptchaError on failure.'''
+ '''Check a user\'s recaptcha submission is valid, and raise CaptchaError
+ on failure.'''
recaptcha_private_key = config.get('ckan.recaptcha.privatekey', '')
if not recaptcha_private_key:
# Recaptcha not enabled
@@ -16,10 +17,13 @@
recaptcha_server_name = 'http://api-verify.recaptcha.net/verify'
+ # recaptcha_response_field will be unicode if there are foreign chars in
+ # the user input. So ee need to encode it as utf8 before urlencoding or
+ # we get an exception (#1431).
params = urllib.urlencode(dict(privatekey=recaptcha_private_key,
remoteip=client_ip_address,
challenge=recaptcha_challenge_field,
- response=recaptcha_response_field))
+ response=recaptcha_response_field.encode('utf8')))
f = urllib2.urlopen(recaptcha_server_name, params)
data = f.read()
f.close()
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list