[Bio] / Sprout / CustomAttributes.pm Repository:
ViewVC logotype

Diff of /Sprout/CustomAttributes.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33, Tue Aug 12 06:06:02 2008 UTC revision 1.34, Wed Aug 13 15:47:32 2008 UTC
# Line 2201  Line 2201 
2201      # Copy the pattern into the return area.      # Copy the pattern into the return area.
2202      $escapedValue = $sqlPattern;      $escapedValue = $sqlPattern;
2203      # Check the pattern. Is it generic or exact?      # Check the pattern. Is it generic or exact?
2204      if ($sqlPattern =~ /%$/) {      if ($sqlPattern =~ /(.+)%$/) {
2205          # Yes, it is. We need a LIKE clause and we must escape the underscores          # Yes, it is. We need a LIKE clause and we must escape the underscores
2206          # and percents in the pattern.          # and percents in the pattern (except for the last one, of course).
2207            $escapedValue = $1;
2208          $escapedValue =~ s/(%|_)/\\$1/g;          $escapedValue =~ s/(%|_)/\\$1/g;
2209            $escapedValue .= "%";
2210          $sqlClause = "$tableName($fieldName) LIKE ?";          $sqlClause = "$tableName($fieldName) LIKE ?";
2211      } else {      } else {
2212          # No, it isn't. We use an equality clause.          # No, it isn't. We use an equality clause.

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3