Opened 21 years ago
Closed 19 years ago
#914 closed defect (bug) (fixed)
wrong search string escaping/slashes
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.1 | Priority: | normal |
| Severity: | minor | Version: | 2.0.7 |
| Component: | Template | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Search for ' and
\' will appear in the input field.
" ->
\
& -> &
Attachments (2)
Change History (21)
#5
@
21 years ago
Even if we get rid of the extra addslashes, searches will still show a single set of slashes. \' instead of
\'. We can either add stripslashes to Kubrick's templates, or not addslashes by default when processing GPC in the blog header. Not adding slashes by default and instead relying on those functions that query the DB to addslashes as appropriate seems to be the cleanest way to do this, but that should wait until after 1.5.1.
#6
@
21 years ago
I also prefer not adding slashes by default and escape strings only for DB operations.
Now, as I understand, the choice is between leaving the bug in 1.5.1 or applying the dirty "stripslashes in Kubrick" hack before reorganizing all that code. My choice was the second.
Which is the less evil of the two?
#8
@
19 years ago
- Keywords has-patch commit added
- Milestone set to 2.1
914.diff
- create wp_search_query() template tag which echos the query.
#9
@
19 years ago
Whatcha think, wp_search_query() or the_search_query()? Or maybe just the_search()? These are important questions. :-)
#10
@
19 years ago
the_search_query() or search_query()
the wp_blah() ones usually accept a query string with a bunch of parameters.
#13
@
19 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 1.5 to 2.0.7
Found the same problem in 2.0.7
' (single quote) becomes
\' with magic_quotes_gpc on (7 backslashes, then single quote),
or
\' (magic_quotes_gpc=off) (3 backslashes, quote)
#14
@
19 years ago
With one of the default themes? If you're having problems with a third party theme, that theme needs to be changed.
#17
@
19 years ago
- Resolution set to worksforme
- Status changed from reopened to closed
thenlich, please upgrade to the most recent version of the theme (the one in 2.0.7). Re-open with a URL demonstrating the issue, if it persists.
In classes.php $qs? is added slashes again, despite the fact that is has passed through add_magic_quotes function before.
For database use the search string needs slashes, but when writing it to the templates is does not. I have added striptags calls in the template pages.