[open-ils-commits] r20092 - in branches/rel_2_1/Open-ILS: src/perlmods/lib/OpenILS/WWW web/opac/skin/default/xml/rdetail (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 14 17:10:34 EDT 2011
Author: dbs
Date: 2011-04-14 17:10:28 -0400 (Thu, 14 Apr 2011)
New Revision: 20092
Modified:
branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm
branches/rel_2_1/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Log:
Restore URIs in marcxml-uris unAPI format
At some point (r16750) we started doing a numeric comparison of
$flesh instead of just checking to see if $flesh was defined; this
returned false when $flesh == 'uris', preventing URIs from being
included in the marcxml-uris unAPI format.
This restores URIs to marcxml-uris and so we can revert the extra
BibTemplate call in rdetail_summary.xml.
Modified: branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm 2011-04-14 21:09:32 UTC (rev 20091)
+++ branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm 2011-04-14 21:10:28 UTC (rev 20092)
@@ -547,6 +547,12 @@
if ($type eq 'isbn') {
my $rec = $supercat->request('open-ils.supercat.isbn.object.retrieve',$id)->gather(1);
if (!@$rec) {
+ # Escape user input before display
+ $command = CGI::escapeHTML($command);
+ $id = CGI::escapeHTML($id);
+ $type = CGI::escapeHTML($type);
+ $format = CGI::escapeHTML(decode_utf8($format));
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 404, <<" HTML");
<html>
@@ -572,6 +578,10 @@
{ $_ eq $base_format }
qw/opac html htmlholdings marctxt ris holdings_xml/
) {
+ # Escape user input before display
+ $format = CGI::escapeHTML($format);
+ $type = CGI::escapeHTML($type);
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 406, <<" HTML");
<html>
@@ -605,6 +615,12 @@
);
if (!$feed->count) {
+ # Escape user input before display
+ $command = CGI::escapeHTML($command);
+ $id = CGI::escapeHTML($id);
+ $type = CGI::escapeHTML($type);
+ $format = CGI::escapeHTML(decode_utf8($format));
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 404, <<" HTML");
<html>
@@ -643,6 +659,12 @@
my $data = $req->gather();
if ($req->failed || !$data) {
+ # Escape user input before display
+ $command = CGI::escapeHTML($command);
+ $id = CGI::escapeHTML($id);
+ $type = CGI::escapeHTML($type);
+ $format = CGI::escapeHTML(decode_utf8($format));
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 404, <<" HTML");
<html>
@@ -836,6 +858,9 @@
} otherwise {
warn shift();
+ # Escape user input before display
+ $id = CGI::escapeHTML($id);
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 404, <<" HTML");
<html>
@@ -878,6 +903,12 @@
$req->wait_complete;
if ($req->failed) {
+ # Escape user input before display
+ $command = CGI::escapeHTML($command);
+ $id = CGI::escapeHTML($id);
+ $type = CGI::escapeHTML($type);
+ $format = CGI::escapeHTML(decode_utf8($format));
+
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 404, <<" HTML");
<html>
@@ -1428,7 +1459,7 @@
next unless $node;
$xml = '';
- if ($lib && ($type eq 'marcxml' || $type eq 'atom') && $flesh > 0) {
+ if ($lib && ($type eq 'marcxml' || $type eq 'atom') && ($flesh > 0 || $flesh eq 'uris')) {
my $r = $supercat->request( "open-ils.supercat.$search.holdings_xml.retrieve", $rec, $lib, $depth, $flesh_feed, $paging );
while ( !$r->complete ) {
$xml .= join('', map {$_->content} $r->recv);
@@ -1439,8 +1470,8 @@
$node->id($item_tag);
#$node->update_ts(cleanse_ISO8601($record->edit_date));
- $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh > 0);
- $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh > 0);
+ $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh > 0 || $flesh eq 'uris');
+ $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh > 0 || $flesh eq 'uris');
$node->link(unapi => $feed->unapi . "?id=$item_tag") if ($flesh);
$node->link('unapi-id' => $item_tag) if ($flesh);
}
Modified: branches/rel_2_1/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
===================================================================
--- branches/rel_2_1/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2011-04-14 21:09:32 UTC (rev 20091)
+++ branches/rel_2_1/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2011-04-14 21:10:28 UTC (rev 20092)
@@ -130,7 +130,7 @@
]]></script>
</span>
</td>
- <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' datatype='holdings_xml' query='volumes volume uris uri' join=", ">
+ <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' query='volumes volume uris uri' join=", ">
<script type='opac/slot-format'><![CDATA[
var link = '<a href="' + item.getAttribute('href') + '">' + item.getAttribute('label') + '</a>';
if (item.getAttribute('use_restriction'))
More information about the open-ils-commits
mailing list