[Orca-checkins] r498 - orca/trunk/lib/Orca

blair at orcaware.com blair at orcaware.com
Sat Nov 19 16:52:02 PST 2005


Author: blair at orcaware.com
Date: Sat Nov 19 16:51:17 2005
New Revision: 498

Modified:
   orca/trunk/lib/Orca/SourceFile.pm

Log:
Fix a problem when a plot has only a single a data line in the
configuration file which has a regular expression containing a ?.  The
? will end up in the filename, which when sent back to the web server
will get a 404, since the web server parses any characters following
the ? as part of the CGI query and not the filename.

* lib/Orca/SourceFile.pm
  (add_plots):


Modified: orca/trunk/lib/Orca/SourceFile.pm
==============================================================================
--- orca/trunk/lib/Orca/SourceFile.pm	(original)
+++ orca/trunk/lib/Orca/SourceFile.pm	Sat Nov 19 16:51:17 2005
@@ -802,8 +802,20 @@
                                       lc($plot->{data_type}[0]),
                                       'volatile',
                                       @{$original_plot->{data}[0]});
+
+      # Because the regular expression in the configuration file is
+      # placed in these variables and these variables are used to
+      # generate the HTML and image filenames and hence the URLs, some
+      # characters will prevent the web server from properly serving
+      # the files.  Notably, the ? character will cause the web server
+      # to parse any following characters as part of the CGI query
+      # string and as not part of the filename, hence a 404 will be
+      # returned.
+      $all_names_with_subgroup =~ s/\?/q/g;
+
       @my_short_rrds = ($all_names_with_subgroup);
-      @names_without_subgroup = (join('_',
+      @names_without_subgroup = map { s/\?/q/g; $_ }
+                                (join('_',
                                       $group_name,
                                       lc($plot->{data_type}[0]),
                                       'volatile',



More information about the Orca-checkins mailing list