Php Yourls:如何使插件接受http或https以外的方案中的url

Php Yourls:如何使插件接受http或https以外的方案中的url,php,yourls,Php,Yourls,默认不允许在http或https以外的其他方案中缩短url。但我希望它也能接受它们。我将通过添加自定义插件来实现 有一个函数评估用户输入的url,如下所示 includes\functions.php function yourls_add_new_link( $url, $keyword = '', $title = '' ) { // Allow plugins to short-circuit the whole function $pre = yourls_apply_f

默认不允许在http或https以外的其他方案中缩短url。但我希望它也能接受它们。我将通过添加自定义插件来实现

有一个函数评估用户输入的url,如下所示

includes\functions.php

function yourls_add_new_link( $url, $keyword = '', $title = '' ) {
    // Allow plugins to short-circuit the whole function
    $pre = yourls_apply_filter( 'shunt_add_new_link', false, $url, $keyword, $title );
    if ( false !== $pre )
        return $pre;

    $url = yourls_encodeURI( $url );
    $url = yourls_sanitize_url( $url );
    if ( !$url || $url == 'http://' || $url == 'https://' ) {
        $return['status']    = 'fail';
        $return['code']      = 'error:nourl';
        $return['message']   = yourls__( 'Missing or malformed URL' );
        $return['errorCode'] = '400';
        return yourls_apply_filter( 'add_new_link_fail_nourl', $return, $url, $keyword, $title );
    }

我只是不知道是否可以通过添加插件来允许其他url方案。你有什么想法吗?

我从来没有听说过Yourls,但它看起来很相关-他们说你需要添加类似于
$Yourls\u allowedprotocols=array('http://'、'https://'、'facetime://')的内容
到你的
config.php
文件我从来没有听说过你的ls,但是,它看起来很相关-他们说你需要添加类似于
$Yourls\u allowedprotocols=array的内容('http://'、'https://'、'facetime://')
到您的
config.php
文件