Specify the regular expression correctly.
Change-Id: If5124bf1d3e5e122fdf32cfce679eec1bd7d7fb9
diff --git a/tools/wg/ecd.php b/tools/wg/ecd.php
index 6973d74..ae92eb6 100755
--- a/tools/wg/ecd.php
+++ b/tools/wg/ecd.php
@@ -39,7 +39,7 @@
$dates = array();
foreach(glob("/home/data/httpd/writable/projects/{$wg}-*.html") as $file) {
$matches = array();
- if (preg_match('^\/home\/data\/httpd\/writable\/projects\/(?<wg>.+)\-(?<date>\d\d\d\d\-\d\d\-\d\d)\-(?<time>.+)\.html$', $file, $matches)) {
+ if (preg_match('/^\/home\/data\/httpd\/writable\/projects\/(?<wg>.+)\-(?<date>\d\d\d\d\-\d\d\-\d\d)\-(?<time>\d\d\d\d)\.html$/', $file, $matches)) {
$dates[$matches['date']] = $matches['date']; // eliminate duplicates
}
}
@@ -47,7 +47,9 @@
if ($dates) {
$Nav->addNavSeparator("Previous Reports", null);
krsort($dates);
+ $count = 0;
foreach($dates as $date) {
+ if ($count++ >= 12) break;
$Nav->addCustomNav("{$date}", "?date={$date}", "_self", 2);
}
}