[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6388] trunk



Revision: 6388
          http://sourceforge.net/p/ledger-smb/code/6388
Author:   einhverfr
Date:     2014-01-05 13:11:13 +0000 (Sun, 05 Jan 2014)
Log Message:
-----------
Template saving now works.  Now to add file uploads.

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/template.pm
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB/Scripts/template.pm
===================================================================
--- trunk/LedgerSMB/Scripts/template.pm	2014-01-05 12:24:44 UTC (rev 6387)
+++ trunk/LedgerSMB/Scripts/template.pm	2014-01-05 13:11:13 UTC (rev 6388)
@@ -78,7 +78,9 @@
 
 sub save {
     my ($request) = @_;
-    my $dbtemp = LedgerSMB::Template::DB->get(%$request);
+    $request->{template} = $request->unescape($request->{template})
+        if $request->{template} =~ /<\?lsmb/;
+    my $dbtemp = LedgerSMB::Template::DB->new(%$request);
     $dbtemp->save();
     display($request);
 }

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2014-01-05 12:24:44 UTC (rev 6387)
+++ trunk/LedgerSMB.pm	2014-01-05 13:11:13 UTC (rev 6388)
@@ -23,6 +23,10 @@
 This function takes the date in the format provided and returns a numeric 
 string in YYMMDD format.  This may be moved to User in the future.
 
+=item unescape($var)
+
+Unescapes the var, i.e. converts html entities back to their characters.
+
 =item open_form()
 
 This sets a $self->{form_id} to be used in later form validation (anti-XSRF 
@@ -386,6 +390,12 @@
 
 }
 
+sub unescape {
+    my ($self, $var) = @_;
+    my $q = CGI::Simple->new();
+    return $q->unescapeHTML($var);
+}
+
 sub open_form {
     my ($self, $args) = @_;
     if (!$ENV{GATEWAY_INTERFACE}){

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits