[cpif] r154 - in trunk: backend frontend-web

svn at argo.es svn at argo.es
Fri Jun 15 18:23:07 CEST 2007


Author: jcea
Date: Fri Jun 15 18:23:01 2007
New Revision: 154

Log:
Validacion XHTML, incluyendo actualizacion de los
mensajes ya escritos.



Modified:
   trunk/backend/database.py
   trunk/backend/upgrade.py
   trunk/frontend-web/url_nuevo_hilo_POST.py
   trunk/frontend-web/url_nuevo_post_POST.py

Modified: trunk/backend/database.py
==============================================================================
--- trunk/backend/database.py	(original)
+++ trunk/backend/database.py	Fri Jun 15 18:23:01 2007
@@ -1,7 +1,7 @@
 # $Id$
 
 
-VERSION_DB="2007060601"
+VERSION_DB="2007061501"
 
 from globales import thread_len
 

Modified: trunk/backend/upgrade.py
==============================================================================
--- trunk/backend/upgrade.py	(original)
+++ trunk/backend/upgrade.py	Fri Jun 15 18:23:01 2007
@@ -70,3 +70,10 @@
           plnl[i]=BTree()
     conn.commit()
 
+  if root["version del foro"]=="2007060601" :
+    print "Actualizando la base de datos: 2007060601 -> 2007061501"
+    root["version del foro"]="2007061501"
+    for mensaje in root["mensajes"]["mensajes"].values() :
+      mensaje["texto"]=mensaje["texto"].replace("<br>","<br/>")
+    conn.commit()
+

Modified: trunk/frontend-web/url_nuevo_hilo_POST.py
==============================================================================
--- trunk/frontend-web/url_nuevo_hilo_POST.py	(original)
+++ trunk/frontend-web/url_nuevo_hilo_POST.py	Fri Jun 15 18:23:01 2007
@@ -21,7 +21,7 @@
   cuerpo=cgi.FieldStorage(fp=handler.rfile,headers=handler.headers,environ={'REQUEST_METHOD':'POST'},keep_blank_values=1)
   titulo=cgi.escape(cuerpo.getfirst("titulo"))
   texto=cgi.escape(cuerpo.getfirst("texto"))
-  texto=texto.replace("\r","").replace("\n","<br>\r\n")
+  texto=texto.replace("\r","").replace("\n","<br/>\r\n")
   database.mensaje_add(conn,texto,usuario,titulo=titulo,metatag=metatag)
   return (302,{"Location":"/indice/%d" %metatag},"")
 

Modified: trunk/frontend-web/url_nuevo_post_POST.py
==============================================================================
--- trunk/frontend-web/url_nuevo_post_POST.py	(original)
+++ trunk/frontend-web/url_nuevo_post_POST.py	Fri Jun 15 18:23:01 2007
@@ -21,7 +21,7 @@
   ctype,pdict=cgi.parse_header(handler.headers.getheader('content-type'))
   cuerpo=cgi.FieldStorage(fp=handler.rfile,headers=handler.headers,environ={'REQUEST_METHOD':'POST'},keep_blank_values=1)
   texto=cgi.escape(cuerpo.getfirst("texto"))
-  texto=texto.replace("\r","").replace("\n","<br>\r\n")
+  texto=texto.replace("\r","").replace("\n","<br/>\r\n")
   database.mensaje_add(conn,texto,usuario,hilo=hilo)
   return (302,{"Location":"/indice/%d" %metatag}, "")
 



More information about the cpif mailing list