API routes generate invalid development output

  • Thread starter Thread starter DragonByte Tech
  • Start date Start date

DragonByte Tech

Guest
Member
Defining the following two routes:

#1
1641315947134.png

#2
1641315973396.png

Will both write to api_dbtech-ecommerce_categories_.json.

Suggested solution:
In /src/XF/DevelopmentOutput/Route.php find:
PHP:

$subNameFile = preg_replace('#[^a-z0-9_-]#i', '-', $subName);

Replace with:
Code:

Code:
        $subNameFile = preg_replace('#/$#i', '_', $subName);
        $subNameFile = preg_replace('#[^a-z0-9_-]#i', '-', $subNameFile);

This will cause #1 to...

Read more
 
Top