Author: Shivam Mathur (shivammathur)
Committer: GitHub (web-flow)
Pusher: shivammathur
Date: 2024-10-15T00:19:39+05:30

Commit: 
https://github.com/php/web-downloads/commit/020e463c5450296a8a04a9008ef0492827359815
Raw diff: 
https://github.com/php/web-downloads/commit/020e463c5450296a8a04a9008ef0492827359815.diff

Add redirect for uppercase pecl builds in redirect.php

Changed paths:
  M  public/redirect.php


Diff:

diff --git a/public/redirect.php b/public/redirect.php
index d166f3e..c69b4bf 100644
--- a/public/redirect.php
+++ b/public/redirect.php
@@ -3,6 +3,11 @@
     $fixed = str_replace( 'Win32-vc', 'Win32-VC', $_SERVER['REQUEST_URI'] );
     header("Location: $fixed", true, 301);
     exit();
+} else if(preg_match('/\/pecl\/.*\/php_[^\-]+\-([^\-]+)/', 
$_SERVER['REQUEST_URI'])) {
+    preg_match_all('/\/pecl\/.*\/php_[^\-]+\-([^\-]+)/', 
$_SERVER['REQUEST_URI'], $matches);
+    $fixed = str_replace($matches[1][0], strtoupper($matches[1][0]), 
$_SERVER['REQUEST_URI']);
+    header("Location: $fixed", true, 301);
+    exit();
 }
 
 header('Location: /', true, 404);

Reply via email to