YOURLS: Call to undefined function yourls_nonce_url()

Since update to 1.7.9 I get this error:

[24-Apr-2020 11:00:48 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function yourls_nonce_url() in C:\Apache24\htdocs\example.com\www\includes\functions-html.php:528
Stack trace:
#0 C:\Apache24\htdocs\example.com\www\includes\functions.php(295): yourls_table_add_row()
#1 C:\Apache24\htdocs\example.com\www\includes\functions-api.php(21): yourls_add_new_link()
#2 C:\Apache24\htdocs\example.com\www\includes\functions-plugins.php(150): yourls_api_action_shorturl()
#3 C:\Apache24\htdocs\example.com\www\yourls-api.php(35): yourls_apply_filter()
#4 C:\Apache24\htdocs\example.com\www\api.php(26): require_once('C:\\Apache24\\htd...')
#5 {main}
  thrown in C:\Apache24\htdocs\example.com\www\includes\functions-html.php on line 528

api.php looks like this:

// Some recaptcha stuff
// [...]
if ($resp->isSuccess()) {
  define('YOURLS_PRIVATE', false);
  require_once( dirname(__FILE__).'/yourls-api.php' ); // line 26
} else {
  require_once( dirname(__FILE__).'/includes/load-yourls.php' );
  $format = ( isset( $_REQUEST['format'] ) ? $_REQUEST['format'] : 'xml' );
  $return = array(
        'status' => 'fail',
        'code'   => 'error:recaptcha',
        'message' => 'reCAPTCHA not successfull',
        'recaptcha_score' => $resp->getScore(),
        'errorCode' => '403',
      );
  yourls_api_output( $format, $return );
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Oh, indeed. I moved some functions from one file to another without thinking about guys running a public shortener.

Quick fix until next release: simply add require_once '/path/to/includes/functions-auth.php'; to your config.php (edit: need to hardcode path)

Pinned to aid visibility.