summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Noreiko2012-03-05 21:53:04 (GMT)
committer Joachim Noreiko2012-03-05 21:53:04 (GMT)
commit6f6858a973391c2e630d8c9feb176d0bc3241db0 (patch)
tree891d252ec26a69d096be9aee8f656ef1fb9a012d
parent3fc8a3e3b1c27da012ac865e518008940fdb6d35 (diff)
by joachim: Fixed output of data table title.7.x-1.0-alpha3
-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 eb0a702..995f73a 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 5ec21e0..1f77f65 100644
--- a/data_ui/data_ui.admin.inc
+++ b/data_ui/data_ui.admin.inc
@@ -13,7 +13,7 @@ function data_ui_view() {
foreach ($tables as $table) {
// TODO Please convert this statement to the D7 database API syntax.
$row = array(
- $table->get('title'),
+ check_plain($table->get('title')),
$table->get('name'),
db_query('SELECT COUNT(*) FROM {' . db_escape_table($table->get('name')) . '}')->fetchField(),
);
@@ -703,7 +703,8 @@ function data_ui_edit_title_form($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 4e95f3c..31b1716 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'),