diff --git a/conferences/index.php b/conferences/index.php index 14daf183c..1bb5cdc55 100644 --- a/conferences/index.php +++ b/conferences/index.php @@ -29,7 +29,7 @@ $panels = '

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 .= '

'; diff --git a/include/layout.inc b/include/layout.inc index 4ef1de670..82c3d11bb 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 "{$title}"; }