From 3eefc10d775e04810b15f0514f1fddf0a4abe908 Mon Sep 17 00:00:00 2001 From: Clayton Daley Date: Wed, 16 Oct 2013 18:54:08 -0400 Subject: [PATCH] I want to be able to get all keywords for a specific URL. While the function yourls_get_duplicate_keywords() exists, it returns NULL -- instead of a single keyword -- if yourls_allow_duplicate_longurls() is false. This commit refactors the keyword logic from yourls_allow_duplicate_longurls() into yourls_get_keywords() so a keyword list can be obtained regardless of the state of YOURLS_UNIQUE_URLS. --- includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 9a71f5c..4d6329f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1222,7 +1222,10 @@ function yourls_allow_duplicate_longurls() { function yourls_get_duplicate_keywords( $longurl ) { if( !yourls_allow_duplicate_longurls() ) return NULL; - + return yourls_get_keywords ( $longurl ); +} + +function yourls_get_keywords( $longurl ) { global $ydb; $longurl = yourls_escape( yourls_sanitize_url($longurl) ); $table = YOURLS_DB_TABLE_URL; -- 2.45.0