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

Commit 3a871bc

Browse files
committed
Mysql: Tablename may create an error when getting size and count
1 parent 4507aaf commit 3a871bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

core/src/plugins/access.mysql/class.mysqlAccessDriver.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,14 @@ public function switchAction($action, $httpVars, $fileVars)
327327
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>');
328328
$icon = ($mode == "file_list"?"sql_images/mimes/ICON_SIZE/table_empty.png":"sql_images/mimes/ICON_SIZE/table_empty_tree.png");
329329
foreach ($tables as $tableName) {
330-
$size = $this->getSize($tableName);
331-
$count = $this->getCount($tableName);
332-
if(AJXP_Utils::detectXSS($tableName)) $tableName = "XSS Detected!";
330+
if(AJXP_Utils::detectXSS($tableName)) {
331+
$tableName = "XSS Detected!";
332+
$size = 'N/A';
333+
$count = 'N/A';
334+
}else{
335+
$size = $this->getSize($tableName);
336+
$count = $this->getCount($tableName);
337+
}
333338
print "<tree is_file=\"0\" text=\"$tableName\" filename=\"/$tableName\" bytesize=\"$size\" count=\"$count\" icon=\"$icon\" ajxp_mime=\"table\" />";
334339
}
335340
print "<tree is_file=\"0\" text=\"Search Results\" ajxp_node=\"true\" filename=\"/ajxpmysqldriver_searchresults\" bytesize=\"-\" count=\"-\" icon=\"search.png\"/>";

0 commit comments

Comments
 (0)