https://bugzilla.wikimedia.org/show_bug.cgi?id=20275





--- Comment #11 from Aryeh Gregor <[email protected]>  2009-08-26 
23:28:20 UTC ---
(In reply to comment #10)
> Some random thoughts...
> 
> My initial thought on reading this was that LIKE escaping should really be an
> internal function called by the wrapper functions when building the WHERE
> clause, but I couldn't really think of a syntax that wouldn't be clunky,
> unreadable, and backwards compatible.

That would be impossible to use with query(), so we couldn't deploy it without
either rewriting a bunch of old stuff or exposing an extra method anyway.

> However, from that came another idea. Perhaps something like
> http://pastebin.com/m657d3b8a (just a rough idea)

I like that a lot, except that LIKE_PERCENT and LIKE_UNDERSCORE are a bit
clunky.  But the idea of distinguishing based on argument types somehow is
nice.  I'd allow func_get_args()-based input too, to save the array(), like

  $dbr->like( 'page_title', 'Foo_bar', LIKE_PERCENT );

I'm still not totally sure if the first argument should be the left-hand
argument of LIKE, or if that should be prepended manually.  I.e.,

  'page_title' . $dbr->like( 'Foo_bar', LIKE_PERCENT );

I think the latter is cleaner and easier to read, but that's arguable.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to