Commit:    39daeda954b803b5bdcbca133e91b538672a027e
Author:    Peter Cowburn <[email protected]>         Tue, 23 Jul 2019 20:07:25 
+0100
Parents:   c41f8bffe7caef1a455327d971a56d8788885e6a
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=39daeda954b803b5bdcbca133e91b538672a027e

Log:
use updated "Strip http://php.net"; method for more news links

Following on from a similar change in 47f8ecc688, update more places
where we manipulate the URL.

Changed paths:
  M  conferences/index.php
  M  include/layout.inc


Diff:
diff --git a/conferences/index.php b/conferences/index.php
index 14daf18..1bb5cdc 100644
--- a/conferences/index.php
+++ b/conferences/index.php
@@ -29,7 +29,7 @@ $panels = '<p class="prepend"><a 
href="https://wiki.php.net/conferences";>Want to
 
 
 foreach($frontpage as $entry) {
-    $link = substr($entry["id"], 15); // Strip http://php.net/
+    $link = preg_replace('~^(http://php.net/|https://www.php.net/)~', '', 
$entry["id"]);
     $id   = parse_url($entry["id"], PHP_URL_FRAGMENT);
     $date = date_format(date_create($entry["updated"]), 'Y-m-d');
     $content .= '<div class="newsentry">';
diff --git a/include/layout.inc b/include/layout.inc
index 4ef1de6..82c3d11 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -536,7 +536,7 @@ function get_news_changes()
 
     $date->modify("+1 week");
     if ($date->getTimestamp() > $_SERVER["REQUEST_TIME"]) {
-        $link = substr($NEWS_ENTRIES[0]["link"][0]["href"], 14); // Strip 
http://php.net
+        $link = preg_replace('~^(http://php.net/|https://www.php.net/)~', '', 
$NEWS_ENTRIES[0]["link"][0]["href"]);
         $title = $NEWS_ENTRIES[0]["title"];
         return "<a href='{$link}'>{$title}</a>";
     }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to