wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17867: LJSUP-7522. incorrect working search by ...

Committer: gprochaev
LJSUP-7522. incorrect working search by tags when user use space

U   trunk/cgi-bin/LJ/Browse.pm
U   trunk/cgi-bin/LJ/Vertical.pm
Modified: trunk/cgi-bin/LJ/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse.pm	2010-12-06 10:56:21 UTC (rev 17866)
+++ trunk/cgi-bin/LJ/Browse.pm	2010-12-06 11:11:28 UTC (rev 17867)
@@ -900,6 +900,10 @@
     my $search   = $args{'search_str'};
     my $vertical = $args{'vertical'};
 
+    ## remove trailing spaces
+    $search =~ s/^\s+(.*?)$/$1/;
+    $search =~ s/(.*?)\s+?$/$1/;
+
     my @entries = ();
     my $comm_list = join ",", @$comms;
     my $dbh = LJ::get_db_reader();

Modified: trunk/cgi-bin/LJ/Vertical.pm
===================================================================
--- trunk/cgi-bin/LJ/Vertical.pm	2010-12-06 10:56:21 UTC (rev 17866)
+++ trunk/cgi-bin/LJ/Vertical.pm	2010-12-06 11:11:28 UTC (rev 17867)
@@ -352,6 +352,10 @@
 
     my $search = $args{'search'};
 
+    ## remove trailing spaces
+    $search =~ s/^\s+(.*?)$/$1/;
+    $search =~ s/(.*?)\s+?$/$1/;
+
     my $dbh = LJ::get_db_writer()
         or die "unable to contact global db master to create vertical";
 

Tags: livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments