diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index 1f7a31bad..31e7dd0e2 100755 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -15,10 +15,6 @@ class Import_Export extends Plugin implements IHandler { "fox"); } - private function bool_to_sql_bool($s) { - return $s ? 'true' : 'false'; - } - function xml_import($args) { $filename = $args['xml_import']; @@ -30,26 +26,21 @@ class Import_Export extends Plugin implements IHandler { _debug("please enter your username:"); - $username = db_escape_string(trim(read_stdin())); + $username = trim(read_stdin()); _debug("importing $filename for user $username...\n"); - $result = db_query("SELECT id FROM ttrss_users WHERE login = '$username'"); + $sth = $this->pdo->prepare("SELECT id FROM ttrss_users WHERE login = ?"); + $sth->execute($username); - if (db_num_rows($result) == 0) { + if ($row = $sth->fetch()) { + $owner_uid = $row['id']; + + $this->perform_data_import($filename, $owner_uid); + } else { print "error: could not find user $username.\n"; return; } - - $owner_uid = db_fetch_result($result, 0, "id"); - - $this->perform_data_import($filename, $owner_uid); - } - - function save() { - $example_value = db_escape_string($_POST["example_value"]); - - echo "Value set to $example_value (not really)"; } function get_prefs_js() { @@ -77,7 +68,9 @@ class Import_Export extends Plugin implements IHandler { print "