diff options
author | ྅༻ Ǭɀħ ༄༆ཉ <ozh@ozh.org> | 2022-04-22 16:56:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 16:56:06 +0300 |
commit | 223a4e57733b2eb642a48ee08bfb199f25855902 (patch) | |
tree | b66c29d0836c6623776fb42e2b76ea2068d5c7c7 | |
parent | a8387c5fdcd0f2f08d2265af9108ae2e222cab68 (diff) |
More helpful "URL already exists" (#3305)
Fixes #1676 opened by... myself... 8 years ago 😅
-rw-r--r-- | includes/functions-shorturls.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/functions-shorturls.php b/includes/functions-shorturls.php index 4554fd21..3437bccc 100644 --- a/includes/functions-shorturls.php +++ b/includes/functions-shorturls.php @@ -80,7 +80,8 @@ function yourls_add_new_link( $url, $keyword = '', $title = '' ) { $return['status'] = 'fail'; $return['code'] = 'error:url'; $return['url'] = array( 'keyword' => $url_exists->keyword, 'url' => $url, 'title' => $url_exists->title, 'date' => $url_exists->timestamp, 'ip' => $url_exists->ip, 'clicks' => $url_exists->clicks ); - $return['message'] = /* //translators: eg "http://someurl/ already exists" */ yourls_s( '%s already exists in database', yourls_trim_long_string( $url ) ); + $return['message'] = /* //translators: eg "http://someurl/ already exists (short URL: sho.rt/abc)" */ yourls_s('%s already exists in database (short URL: %s)', + yourls_trim_long_string($url), preg_replace('!https?://!', '', yourls_get_yourls_site()) . '/'. $url_exists->keyword ); $return['title'] = $url_exists->title; $return['shorturl'] = yourls_link($url_exists->keyword); |