RSS Feed/News API routes generate invalid development output

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
30,291
Points
823

Reputation:

Defining the following two routes:

#1
1641315947134.webp

#2
1641315973396.webp

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

Continue reading...
 
Status
Not open for further replies.
Top