fixed encoding-decoding of flash, thanks Anthony

This commit is contained in:
mdipierro committed 2012-08-06 06:28:32 -05:00
1 parent 1dc9c59768
commit 4ec117b943
5 files changed
+11 -8

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-08-05 21:35:52) dev Version 2.00.0 (2012-08-06 06:28:28) dev
+1 -1
View File
@@ -97,7 +97,7 @@ function web2py_ajax_page(method, action, data, target) {
if(command) if(command)
eval(decodeURIComponent(command)); eval(decodeURIComponent(command));
if(flash) if(flash)
jQuery('.flash').html(decodeURIComponent(flash)).slideDown(); jQuery('.flash').html(flash).slideDown();
} }
}); });
} }
+1 -1
View File
@@ -97,7 +97,7 @@ function web2py_ajax_page(method, action, data, target) {
if(command) if(command)
eval(decodeURIComponent(command)); eval(decodeURIComponent(command));
if(flash) if(flash)
jQuery('.flash').html(decodeURIComponent(flash)).slideDown(); jQuery('.flash').html(flash).slideDown();
} }
}); });
} }
+1 -1
View File
@@ -97,7 +97,7 @@ function web2py_ajax_page(method, action, data, target) {
if(command) if(command)
eval(decodeURIComponent(command)); eval(decodeURIComponent(command));
if(flash) if(flash)
jQuery('.flash').html(decodeURIComponent(flash)).slideDown(); jQuery('.flash').html(flash).slideDown();
} }
}); });
} }
+7 -4
View File
@@ -87,7 +87,7 @@ from dal import BaseAdapter
from settings import global_settings from settings import global_settings
from validators import CRYPT from validators import CRYPT
from cache import Cache from cache import Cache
from html import URL as Url from html import URL as Url, xmlescape
from utils import is_valid_ip_address from utils import is_valid_ip_address
import newcron import newcron
import rewrite import rewrite
@@ -547,10 +547,13 @@ def wsgibase(environ, responder):
# ################################################## # ##################################################
if request.cid: if request.cid:
if response.flash and not 'web2py-component-flash' in http_response.headers: if response.flash and not 'web2py-component-flash' \
in http_response.headers:
http_response.headers['web2py-component-flash'] = \ http_response.headers['web2py-component-flash'] = \
urllib2.quote(str(response.flash).replace('\n','')) urllib2.quote(xmlescape(response.flash)\
if response.js and not 'web2py-component-command' in http_response.headers: .replace('\n',''))
if response.js and not 'web2py-component-command' \
in http_response.headers:
http_response.headers['web2py-component-command'] = \ http_response.headers['web2py-component-command'] = \
response.js.replace('\n','') response.js.replace('\n','')
if session._forget and \ if session._forget and \