mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
[core] makes 'bridge' and 'format' parameters value less verbose
remove the requirement for 'Format' and 'Bridge' suffixes: https://example.com/?action=display&bridge=Twitter&format=Atom&u=user Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -122,6 +122,7 @@ class Format{
|
||||
throw new \InvalidArgumentException('Name format must be at least one uppercase follow or not by alphabetic characters.');
|
||||
}
|
||||
|
||||
$nameFormat=$nameFormat.'Format';
|
||||
$pathFormat = self::getDir() . $nameFormat . '.php';
|
||||
|
||||
if( !file_exists($pathFormat) ){
|
||||
@@ -169,7 +170,7 @@ class Format{
|
||||
$dirFiles = scandir($pathDirFormat);
|
||||
if( $dirFiles !== false ){
|
||||
foreach( $dirFiles as $fileName ){
|
||||
if( preg_match('@^([^.]+)\.php$@U', $fileName, $out) ){ // Is PHP file ?
|
||||
if( preg_match('@^([^.]+)Format\.php$@U', $fileName, $out) ){ // Is PHP file ?
|
||||
$listFormat[] = $out[1];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user