Title: [opsview] [5337] Fixed inline wiki when only spaces entered
Revision
5337
Author
tvoon
Date
2010-11-08 17:50:24 +0000 (Mon, 08 Nov 2010)

Log Message

Fixed inline wiki when only spaces entered

Modified Paths


Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2010-11-08 17:49:34 UTC (rev 5336)
+++ trunk/CHANGES	2010-11-08 17:50:24 UTC (rev 5337)
@@ -4,6 +4,7 @@
     FIXES:
     Fixed slight visual glitch when long text is in Actions button
     Fixed upgrade of ODW database when ODW is MyISAM type
+    Fixed inline wiki when only spaces entered
 
 3.9.1.5328 8th November 2010
     FEATURES:

Modified: trunk/opsview-core/filelist
===================================================================
--- trunk/opsview-core/filelist	2010-11-08 17:49:34 UTC (rev 5336)
+++ trunk/opsview-core/filelist	2010-11-08 17:50:24 UTC (rev 5337)
@@ -573,6 +573,7 @@
 f nagios:nagios 0555 /usr/local/nagios/utils/update_copyrights utils/update_copyrights
 f nagios:nagios 0555 /usr/local/nagios/utils/update_opsview_schema_classes utils/update_opsview_schema_classes
 f nagios:nagios 0555 /usr/local/nagios/utils/update_test_dbs utils/update_test_dbs
+f nagios:nagios 0755 /usr/local/nagios/utils/update_test_odw utils/update_test_odw
 
 d nagios:nagios 0755 /var/run/opsview
 d nagios:nagios 0755 /var/log/opsview

Modified: trunk/opsview-web/lib/Opsview/Web/Controller/Info.pm
===================================================================
--- trunk/opsview-web/lib/Opsview/Web/Controller/Info.pm	2010-11-08 17:49:34 UTC (rev 5336)
+++ trunk/opsview-web/lib/Opsview/Web/Controller/Info.pm	2010-11-08 17:50:24 UTC (rev 5337)
@@ -40,7 +40,12 @@
 
 sub get_html : PathPart('info/get_html') Chained('/') Args(0) {
     my ( $self, $c ) = @_;
-    my $html = $c->request->params->{content} || $c->stash->{default_info};
+    my $html = $c->request->params->{content};
+
+    if ( $html =~ /^\s*$/ ) {
+        $html = $c->stash->{default_info};
+    }
+
     $html =~ s/\&/\&/g;
     $html =~ s/\>/\>/g;
     $html =~ s/\</\&lt;/g;

Modified: trunk/opsview-web/t/099-comments.t
===================================================================
--- trunk/opsview-web/t/099-comments.t	2010-11-08 17:49:34 UTC (rev 5336)
+++ trunk/opsview-web/t/099-comments.t	2010-11-08 17:50:24 UTC (rev 5337)
@@ -41,6 +41,12 @@
 $mech->post( "/info/get_html", { content => 'This contains a <script>alert("Helpme!")</script>' } );
 $mech->content_contains( 'This contains a &lt;script&gt;alert', "Escaped for auto update preview" );
 
+$mech->post( "/info/get_html", { content => '' } );
+$mech->content_contains( 'No comments currently entered for this item' );
+
+$mech->post( "/info/get_html", { content => '   ' } );
+$mech->content_contains( 'No comments currently entered for this item', 'Still get this message when spaces entered' );
+
 # Cleared - tests assumes true later
 $mech->get_ok('http://localhost/info/hostgroup/2/edit');
 $mech->form_name('comments');

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to