Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Mysql: Tablename may create an error when getting size and count
  • Loading branch information
cdujeu committed Jun 16, 2015
1 parent 4507aaf commit 3a871bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/src/plugins/access.mysql/class.mysqlAccessDriver.php
Expand Up @@ -327,9 +327,14 @@ public function switchAction($action, $httpVars, $fileVars)
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="filelist"><column messageString="Table Name" attributeName="ajxp_label" sortType="String"/><column messageString="Byte Size" attributeName="bytesize" sortType="NumberKo"/><column messageString="Count" attributeName="count" sortType="Number"/></columns>');
$icon = ($mode == "file_list"?"sql_images/mimes/ICON_SIZE/table_empty.png":"sql_images/mimes/ICON_SIZE/table_empty_tree.png");
foreach ($tables as $tableName) {
$size = $this->getSize($tableName);
$count = $this->getCount($tableName);
if(AJXP_Utils::detectXSS($tableName)) $tableName = "XSS Detected!";
if(AJXP_Utils::detectXSS($tableName)) {
$tableName = "XSS Detected!";
$size = 'N/A';
$count = 'N/A';
}else{
$size = $this->getSize($tableName);
$count = $this->getCount($tableName);
}
print "<tree is_file=\"0\" text=\"$tableName\" filename=\"/$tableName\" bytesize=\"$size\" count=\"$count\" icon=\"$icon\" ajxp_mime=\"table\" />";
}
print "<tree is_file=\"0\" text=\"Search Results\" ajxp_node=\"true\" filename=\"/ajxpmysqldriver_searchresults\" bytesize=\"-\" count=\"-\" icon=\"search.png\"/>";
Expand Down

0 comments on commit 3a871bc

Please sign in to comment.