Update of /cvsroot/gallery/gallery
In directory usw-pr-cvs1:/tmp/cvs-serv580
Modified Files:
ChangeLog search.php
Log Message:
* Fixed a bug where the search function lowercases the result values
that it displays in context. Thanks to Beckett Madden-Woods for the
patch.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gallery/gallery/ChangeLog,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -r1.264 -r1.265
--- ChangeLog 15 Nov 2002 17:48:21 -0000 1.264
+++ ChangeLog 15 Nov 2002 18:00:11 -0000 1.265
@@ -6,6 +6,10 @@
* Tightened up the description of the publisher
+ * Fixed a bug where the search function lowercases the result values
+ that it displays in context. Thanks to Beckett Madden-Woods for the
+ patch.
+
2002-11-13 Bharat Mediratta <bharat@...> 1.3.2-cvs-b28
* Rolled in Joan McGalliard's patch to allow users to add captions
Index: search.php
===================================================================
RCS file: /cvsroot/gallery/gallery/search.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- search.php 11 Sep 2002 04:29:31 -0000 1.17
+++ search.php 15 Nov 2002 18:00:13 -0000 1.18
@@ -99,8 +99,8 @@
$uid = $gallery->user->getUid();
if ($searchAlbum->canRead($uid) || $gallery->user->isAdmin()) {
$albumMatch = 1;
- $searchTitle = eregi_replace($searchstring, "<b>$searchstring</b>",$searchTitle); // cause search word to be bolded
- $searchDescription = eregi_replace($searchstring, "<b>$searchstring</b>",$searchDescription); // cause search word to be bolded
+ $searchTitle = eregi_replace("($searchstring)", "<b>\\1</b>", $searchTitle); // cause search word to be bolded
+ $searchDescription = eregi_replace("($searchstring)", "<b>\\1</b>", $searchDescription); // cause search word to be bolded
$photoURL = makeAlbumUrl($searchAlbum->fields['name']);
$searchdraw["bordercolor"] = $borderColor;
$searchdraw["top"] = true;
@@ -147,7 +147,7 @@
$commentText = "Matching Comments:<br>";
$commentMatch = 1;
}
- $searchComment = eregi_replace($searchstring, "<b>$searchstring</b>",$searchComment);
+ $searchComment = eregi_replace("($searchstring)", "<b>\\1</b>", $searchComment);
$commentText .= $searchComment . "<br><br>";
}
}
@@ -160,8 +160,8 @@
$photoMatch = 1;
$id = $searchAlbum->getPhotoId($j);
// cause search word to be bolded
- $searchCaption = eregi_replace($searchstring, "<b>$searchstring</b>",$searchCaption);
- $searchKeywords = eregi_replace($searchstring, "<b>$searchstring</b>",$searchKeywords);
+ $searchCaption = eregi_replace("($searchstring)", "<b>\\1</b>", $searchCaption);
+ $searchKeywords = eregi_replace("($searchstring)", "<b>\\1</b>", $searchKeywords);
$searchdraw["bordercolor"] = $borderColor;
$searchdraw["top"] = true;
$searchdraw["photolink"] = $searchAlbum->getThumbnailTag($j, $thumbSize);
|