summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Noreiko2012-03-06 22:39:42 (GMT)
committer Joachim Noreiko2012-03-06 22:39:42 (GMT)
commit33f0caa5321ca8256a917a0affd3e877ad350742 (patch)
tree2152da98cdca740baff8ef8772f0043e748a6d68
parente2ebf3d9be9490f38fefbd51e5682b9f790adab7 (diff)
by joachim: Fixed output of data table title.6.x-1.16.x-1.x
-rw-r--r--data.views.inc4
-rw-r--r--data_ui/data_ui.admin.inc5
-rw-r--r--data_ui/data_ui.views_default.inc1
3 files changed, 6 insertions, 4 deletions
diff --git a/data.views.inc b/data.views.inc
index 123be1e..9679759 100644
--- a/data.views.inc
+++ b/data.views.inc
@@ -25,7 +25,7 @@ function data_views_data() {
$table_data = array();
$table_data['table'] = array(
- 'group' => $table->get('title'),
+ 'group' => check_plain($table->get('title')),
);
foreach ($schema['fields'] as $field_name => $field) {
// If there is no label, generate one from field name.
@@ -59,7 +59,7 @@ function data_views_data() {
if (isset($schema['primary key']) && count($schema['primary key']) >= 1) {
$table_data['table']['base'] = array(
'field' => current($schema['primary key']),
- 'title' => $table->get('title'),
+ 'title' => check_plain($table->get('title')),
'help' => t('Data table'),
'weight' => 10,
);
diff --git a/data_ui/data_ui.admin.inc b/data_ui/data_ui.admin.inc
index 7391592..a0b1fe6 100644
--- a/data_ui/data_ui.admin.inc
+++ b/data_ui/data_ui.admin.inc
@@ -12,7 +12,7 @@ function data_ui_view() {
$rows = array();
foreach ($tables as $table) {
$row = array(
- $table->get('title'),
+ check_plain($table->get('title')),
$table->get('name'),
db_result(db_query('SELECT COUNT(*) FROM {'. db_escape_table($table->get('name')) .'}')),
);
@@ -655,7 +655,8 @@ function data_ui_edit_title_form(&$form_state, $table) {
'#type' => 'textfield',
'#title' => t('Title'),
'#description' => t('Natural name of the table.'),
- '#default_value' => db_escape_table($table->get('title')),
+ // Do not escape the title: show the user what they originally entered.
+ '#default_value' => $table->get('title'),
);
$form['submit'] = array(
'#type' => 'submit',
diff --git a/data_ui/data_ui.views_default.inc b/data_ui/data_ui.views_default.inc
index 11cf811..e550c57 100644
--- a/data_ui/data_ui.views_default.inc
+++ b/data_ui/data_ui.views_default.inc
@@ -68,6 +68,7 @@ function data_ui_views_default_views() {
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
+ // These correspond to user-entered data and so should not be escaped.
'title' => $table->get('title') .' %1',
'id' => $first,
'table' => $table->get('name'),