Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
919a4e75
Commit
919a4e75
authored
Aug 06, 2014
by
Leigh B Stoller
Browse files
Fix MATCH statement. Also improve search.
parent
c4e5bb42
Changes
1
Show whitespace changes
Inline
Side-by-side
www/showimageid_list.php3
View file @
919a4e75
...
...
@@ -45,7 +45,7 @@ $extraclause = "";
PAGEHEADER
(
"Image Search"
);
if
(
isset
(
$searchfor
)
&&
isset
(
$searchby
))
{
if
(
!
preg_match
(
'/^[
-
\w\:,\.\+]+$/'
,
$searchfor
))
{
if
(
!
preg_match
(
'/^[\w\:,\.\+]+$/'
,
$searchfor
))
{
USERERROR
(
"Illegal characters in search clause"
,
1
);
}
if
(
$searchby
==
"nodetype"
)
{
...
...
@@ -68,8 +68,8 @@ if (isset($searchfor) && isset($searchby)) {
}
elseif
(
$searchby
==
"namedesc"
)
{
$safe_searchfor
=
addslashes
(
$searchfor
);
$extraclause
=
"and (match (i.imagename,iv.description) "
.
"against('
$
safe_searchfor
'))"
;
$extraclause
=
"and (match (i
v
.imagename,iv.description) "
.
"against('
*${
safe_searchfor
}*
'))"
;
}
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment