diff -r 56308e61381c -r 846026b8422b class.Address_Book_File.php --- a/class.Address_Book_File.php Wed Oct 26 20:56:15 2011 +0200 +++ b/class.Address_Book_File.php Wed Oct 26 21:44:35 2011 +0200 @@ -1,5 +1,5 @@ fh, LOCK_EX); fputs($this->fh, join(self::FS, $new) . self::RS); flock($this->fh, LOCK_UN); - header("Location: $_SERVER[PHP_SELF]?action=add"); - exit; } public function search_entries($pattern) { + $pattern = trim($pattern); + if (empty($pattern)) return array(); fseek($this->fh, 0, SEEK_SET); + $pattern = preg_replace('|/|', '\/', $pattern); $entries = array(); while ($line = stream_get_line($this->fh, 0, self::RS)) { if ($line === FALSE) break;