Browse Source

add filter xss

pull/420/head
yqjiang 11 years ago
parent
commit
b91de5e64e
  1. 3
      includes/dublin_core.inc
  2. 6
      theme/islandora-dublin-core-display.tpl.php
  3. 6
      theme/theme.inc

3
includes/dublin_core.inc

@ -131,7 +131,7 @@ class DublinCore {
$dc_label = explode(':', $field); $dc_label = explode(':', $field);
$element_label = drupal_ucfirst($dc_label[1]); $element_label = drupal_ucfirst($dc_label[1]);
$dc_array[$field]['label'] = $element_label; $dc_array[$field]['label'] = $element_label;
$dc_array[$field]['value'] = $value; $dc_array[$field]['value'] = filter_xss($value);
$dc_array[$field]['class'] = drupal_strtolower(preg_replace('/[^A-Za-z0-9]/', '-', $field)); $dc_array[$field]['class'] = drupal_strtolower(preg_replace('/[^A-Za-z0-9]/', '-', $field));
$dc_array[$field]['dcterms'] = preg_replace('/^dc/', 'dcterms', $field); $dc_array[$field]['dcterms'] = preg_replace('/^dc/', 'dcterms', $field);
} }
@ -140,7 +140,6 @@ class DublinCore {
return $dc_array; return $dc_array;
} }
/** /**
* Creates a new instance of the class by parsing dc_xml. * Creates a new instance of the class by parsing dc_xml.
* *

6
theme/islandora-dublin-core-display.tpl.php

@ -20,11 +20,11 @@
<dl xmlns:dcterms="http://purl.org/dc/terms/" class="islandora-inline-metadata islandora-metadata-fields"> <dl xmlns:dcterms="http://purl.org/dc/terms/" class="islandora-inline-metadata islandora-metadata-fields">
<?php $row_field = 0; ?> <?php $row_field = 0; ?>
<?php foreach($dc_array as $key => $value): ?> <?php foreach($dc_array as $key => $value): ?>
<dt property="<?php print $value['dcterms']; ?>" content="<?php print $value['value']; ?>" class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>"> <dt property="<?php print $value['dcterms']; ?>" content="<?php print filter_xss($value['value']); ?>" class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['label']; ?> <?php print filter_xss($value['label']); ?>
</dt> </dt>
<dd class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>"> <dd class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['value']; ?> <?php print filter_xss($value['value']); ?>
</dd> </dd>
<?php $row_field++; ?> <?php $row_field++; ?>
<?php endforeach; ?> <?php endforeach; ?>

6
theme/theme.inc

@ -39,7 +39,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
); );
$row[] = array( $row[] = array(
'class' => 'datastream-label', 'class' => 'datastream-label',
'data' => $ds->label, 'data' => filter_xss($ds->label),
); );
$row[] = array( $row[] = array(
'class' => 'datastream-control', 'class' => 'datastream-control',
@ -47,7 +47,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
); );
$row[] = array( $row[] = array(
'class' => 'datastream-mime', 'class' => 'datastream-mime',
'data' => $ds->mimeType, 'data' => filter_xss($ds->mimeType),
); );
$row[] = array( $row[] = array(
'class' => 'datastream-size', 'class' => 'datastream-size',
@ -81,7 +81,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
); );
$rows[] = $row; $rows[] = $row;
} }
$caption = $islandora_object->label . ' - ' . $islandora_object->id; $caption = filter_xss($islandora_object->label) . ' - ' . $islandora_object->id;
$table = array( $table = array(
'colgroups' => NULL, 'colgroups' => NULL,
'sticky' => TRUE, 'sticky' => TRUE,

Loading…
Cancel
Save