From 3b97c5ec44702052661770859b3f2c7a3d32b538 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 1 Jun 2006 23:29:28 +0200 Subject: fix php warning in common.php during getRevisions A php warning can occur when the page name used in a revision check clashes with a namespace (sub-directory) in the same directory. The strpos() call generates the warning as the offset used is longer than the directory name. darcs-hash:20060601212928-9b6ab-2d9399ba71fbfcae6e797977476e2f5daa50cf7f.gz --- inc/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 1016c40d6..9638fb204 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1171,7 +1171,7 @@ function getRevisions($id){ if (is_dir($revd) && $dh = opendir($revd)) { while (($file = readdir($dh)) !== false) { if (substr($file, 0, $clid_len)===$clid) { - $p = strpos($file, '.', $clid_len+1); + $p = @strpos($file, '.', $clid_len+1); if (!$p===false) { $revs[] = substr($file, $clid_len+1, $p-$clid_len-1); } -- cgit v1.2.3