From 247b52ad99acd39b747c57dcdf7d0acbde885d20 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Tue, 21 Jun 2011 19:25:52 +0000 Subject: [PATCH] Filter for main admin query. Fixes issue 842. git-svn-id: http://yourls.googlecode.com/svn/trunk@646 12232710-3e20-11de-b438-597f59cd7555 --- admin/index.php | 1 + includes/functions.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/index.php b/admin/index.php index 6ff8a12..08b99a7 100644 --- a/admin/index.php +++ b/admin/index.php @@ -250,6 +250,7 @@ yourls_table_tbody_start(); // Main Query +$where = yourls_apply_filter( 'admin_list_where', $where ); $url_results = $ydb->get_results("SELECT * FROM `$table_url` WHERE 1=1 $where ORDER BY `$sort_by_sql` $sort_order_sql LIMIT $offset, $perpage;"); $found_rows = false; if( $url_results ) { diff --git a/includes/functions.php b/includes/functions.php index edd4797..3aac216 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -261,7 +261,7 @@ function yourls_insert_link_in_db( $url, $keyword, $title = '' ) { $table = YOURLS_DB_TABLE_URL; $timestamp = date('Y-m-d H:i:s'); $ip = yourls_get_IP(); - $insert = $ydb->query("INSERT INTO `$table` VALUES('$keyword', '$url', '$title', '$timestamp', '$ip', 0);"); + $insert = $ydb->query("INSERT INTO `$table` (`keyword`, `url`, `title`, `timestamp`, `ip`, `clicks`) VALUES('$keyword', '$url', '$title', '$timestamp', '$ip', 0);"); yourls_do_action( 'insert_link', (bool)$insert, $url, $keyword, $title, $timestamp, $ip ); -- 2.45.0