Index: branches/5.2.x/core/admin_templates/tools/sql_query.tpl =================================================================== diff -u -N -r14244 -r15618 --- branches/5.2.x/core/admin_templates/tools/sql_query.tpl (.../sql_query.tpl) (revision 14244) +++ branches/5.2.x/core/admin_templates/tools/sql_query.tpl (.../sql_query.tpl) (revision 15618) @@ -57,28 +57,34 @@ -
+
- "> + -
- - - - - - "> - - - - - - - -
- + + + + + + + + + + + + + + + + + +
+ + + + +
-
Index: branches/5.2.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r15590 -r15618 --- branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15590) +++ branches/5.2.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 15618) @@ -1,6 +1,6 @@ Application->GetVar('sql_rows')); $ret = ''; $block = $params['render_as']; - foreach ($a_data AS $a_row) - { - foreach ($a_row AS $col => $value) - { - $ret .= $this->Application->ParseBlock(Array('name'=>$block, 'value'=>$col)); - } - break; + $a_data = unserialize($this->Application->GetVar('sql_rows')); + + $a_row = current($a_data); + + foreach ($a_row AS $col => $value) { + $ret .= $this->Application->ParseBlock(Array ('name' => $block, 'value' => $col)); } + return $ret; } function PrintSqlRows($params) { - $a_data = unserialize($this->Application->GetVar('sql_rows')); $ret = ''; $block = $params['render_as']; - foreach ($a_data AS $a_row) - { + $a_data = unserialize($this->Application->GetVar('sql_rows')); + + foreach ($a_data as $a_row) { $cells = ''; - foreach ($a_row AS $col => $value) - { - $cells .= ''.$value.''; + $a_row = array_map('htmlspecialchars', $a_row); + + foreach ($a_row as $value) { + $cells .= '' . $value . ''; } - $ret .= $this->Application->ParseBlock(Array('name'=>$block, 'cells'=>$cells)); + + $ret .= $this->Application->ParseBlock(Array ('name' => $block, 'cells' => $cells)); } + return $ret; } Index: branches/5.2.x/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r15539 -r15618 --- branches/5.2.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 15539) +++ branches/5.2.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 15618) @@ -1,6 +1,6 @@ Conn->Query($sql); $this->Application->SetVar('sql_time', round(microtime(true) - $start, 7)); - if ( $result ) { - if ( is_array($result) ) { - $this->Application->SetVar('sql_has_rows', 1); - $this->Application->SetVar('sql_rows', serialize($result)); - } + if ( $result && is_array($result) ) { + $this->Application->SetVar('sql_has_rows', 1); + $this->Application->SetVar('sql_rows', serialize($result)); } $check_sql = trim(strtolower($sql));