mirror of
https://github.com/php/web-news.git
synced 2026-03-23 23:02:11 +01:00
Fix regular expression matching list names
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$requestUri = $_SERVER['REQUEST_URI'];
|
||||
$matches = array();
|
||||
|
||||
// Paging through group messages
|
||||
if (preg_match('#^/(php|svn|ug.+)/start/([0-9]+)#', $requestUri, $matches)) {
|
||||
if (preg_match('#^/(php.+|svn.+|ug.+)/start/([0-9]+)#', $requestUri, $matches)) {
|
||||
$_GET['group'] = $matches[1];
|
||||
$_GET['i'] = $matches[2];
|
||||
include 'group.php';
|
||||
@@ -14,7 +15,7 @@ if (preg_match('#^/(php|svn|ug.+)/start/([0-9]+)#', $requestUri, $matches)) {
|
||||
}
|
||||
|
||||
// Individual post
|
||||
if (preg_match('#^/(php|svn|ug.+)/([0-9]+)#', $requestUri, $matches)) {
|
||||
if (preg_match('#^/(php.+|svn.+|ug.+)/([0-9]+)#', $requestUri, $matches)) {
|
||||
$_GET['group'] = $matches[1];
|
||||
$_GET['article'] = $matches[2];
|
||||
include 'article.php';
|
||||
@@ -22,7 +23,7 @@ if (preg_match('#^/(php|svn|ug.+)/([0-9]+)#', $requestUri, $matches)) {
|
||||
}
|
||||
|
||||
// Newsgroup main page
|
||||
if (preg_match('#^/(php|svn|ug[^/]+)(/)?$#', $requestUri, $matches)) {
|
||||
if (preg_match('#^/(php.+|svn.+|ug.+)(/)?$#', $requestUri, $matches)) {
|
||||
$_GET['group'] = $matches[1];
|
||||
include 'group.php';
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user