projects
/
irspy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xml_encode() does not translate /'/ to ' since Internet Explorer
[irspy-moved-to-github.git]
/
lib
/
ZOOM
/
IRSpy
/
Utils.pm
diff --git
a/lib/ZOOM/IRSpy/Utils.pm
b/lib/ZOOM/IRSpy/Utils.pm
index
8113bcf
..
071e226
100644
(file)
--- a/
lib/ZOOM/IRSpy/Utils.pm
+++ b/
lib/ZOOM/IRSpy/Utils.pm
@@
-1,4
+1,4
@@
-# $Id: Utils.pm,v 1.16 2006-11-29 17:22:00 mike Exp $
+# $Id: Utils.pm,v 1.18 2006-11-30 12:02:26 mike Exp $
package ZOOM::IRSpy::Utils;
package ZOOM::IRSpy::Utils;
@@
-7,7
+7,8
@@
use strict;
use warnings;
use Exporter 'import';
use warnings;
use Exporter 'import';
-our @EXPORT_OK = qw(xml_encode
+our @EXPORT_OK = qw(isodate
+ xml_encode
cql_quote
cql_target
irspy_xpath_context
cql_quote
cql_target
irspy_xpath_context
@@
-20,6
+21,14
@@
our $IRSPY_NS = 'http://indexdata.com/irspy/1.0';
# Utility functions follow, exported for use of web UI
# Utility functions follow, exported for use of web UI
+sub isodate {
+ my($time) = @_;
+
+ my($sec, $min, $hour, $mday, $mon, $year) = localtime($time);
+ return sprintf("%04d-%02d-%02dT%02d:%02d:%02d",
+ $year+1900, $mon+1, $mday, $hour, $min, $sec);
+}
+
# I can't -- just can't, can't, can't -- believe that this function
# isn't provided by one of the core XML modules. But the evidence all
# I can't -- just can't, can't, can't -- believe that this function
# isn't provided by one of the core XML modules. But the evidence all
@@
-37,7
+46,8
@@
sub xml_encode {
$text =~ s/&/&/g;
$text =~ s/</</g;
$text =~ s/>/>/g;
$text =~ s/&/&/g;
$text =~ s/</</g;
$text =~ s/>/>/g;
- $text =~ s/['']/'/g;
+ # Internet Explorer can't display ' (!) so don't create it
+ #$text =~ s/['']/'/g;
$text =~ s/[""]/"/g;
return $text;
}
$text =~ s/[""]/"/g;
return $text;
}