Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function select( $db, $dbh = null ) {
* @return string escaped
*/
function _real_escape( $str ) {
return SQLite3::escapeString( $str );
return addslashes( $str );
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the line that fixes #599

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,12 +1335,25 @@ private function convert_to_columns_object() {
echo $this->get_error_message();
} else {
foreach ( $this->_results as $row ) {
$_columns['Field'] = $row->name;
$_columns['Type'] = $row->type;
$_columns['Null'] = $row->notnull ? 'NO' : 'YES';
$_columns['Key'] = $row->pk ? 'PRI' : '';
$_columns['Default'] = $row->dflt_value;
$_results[] = new Perflab_SQLite_Object_Array( $_columns );
if ( ! is_object( $row ) ) {
continue;
}
if ( property_exists( $row, 'name' ) ) {
$_columns['Field'] = $row->name;
}
if ( property_exists( $row, 'type' ) ) {
$_columns['Type'] = $row->type;
}
if ( property_exists( $row, 'notnull' ) ) {
$_columns['Null'] = $row->notnull ? 'NO' : 'YES';
}
if ( property_exists( $row, 'pk' ) ) {
$_columns['Key'] = $row->pk ? 'PRI' : '';
}
if ( property_exists( $row, 'dflt_value' ) ) {
$_columns['Default'] = $row->dflt_value;
}
$_results[] = new Perflab_SQLite_Object_Array( $_columns );
Comment on lines +1338 to +1356
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some additional defensive coding to ensure there are no errors.

}
}
$this->results = $_results;
Expand Down