From 67151e04796b584ccffeff6b3b549d31023621e0 Mon Sep 17 00:00:00 2001 From: Sandeep Rawat <88418157+sandeep2rawat@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:31:40 +0530 Subject: [PATCH] Fix hook add_new_link for yourls >= 1.9 --- expiry/plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expiry/plugin.php b/expiry/plugin.php index ba34509..83f5abb 100644 --- a/expiry/plugin.php +++ b/expiry/plugin.php @@ -955,7 +955,7 @@ function expiry_stats_response( $infos ) { yourls_add_filter( 'add_new_link', function ( $return, $url , $keyword, $title ) { // this method tolelrates no error in short url creation - if(isset ( $return['code'] ) ) { + if( isset ( $return['status'] ) && $return['status'] === 'fail' ) { switch( $return['code'] ) { case 'error:url': $return['expiry'] = 'Error: use "action => expiry" to add expiration data to a pre-esxisting url. No expiry data set';