Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e1f05a42
Commit
e1f05a42
authored
Jul 23, 2009
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 505592: Make add_see_also and remove_see_also call check_can_change_field
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
d5ea314f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
Bug.pm
Bugzilla/Bug.pm
+17
-1
No files found.
Bugzilla/Bug.pm
View file @
e1f05a42
...
@@ -2426,6 +2426,14 @@ sub add_see_also {
...
@@ -2426,6 +2426,14 @@ sub add_see_also {
# case-sensitive, but most of our DBs are case-insensitive, so we do
# case-sensitive, but most of our DBs are case-insensitive, so we do
# this check case-insensitively.
# this check case-insensitively.
if
(
!
grep
{
lc
(
$_
)
eq
lc
(
$result
)
}
@
{
$self
->
see_also
})
{
if
(
!
grep
{
lc
(
$_
)
eq
lc
(
$result
)
}
@
{
$self
->
see_also
})
{
my
$privs
;
my
$can
=
$self
->
check_can_change_field
(
'see_also'
,
''
,
$result
,
\
$privs
);
if
(
!
$can
)
{
ThrowUserError
(
'illegal_change'
,
{
field
=>
'see_also'
,
newvalue
=>
$result
,
privs
=>
$privs
});
}
push
(
@
{
$self
->
see_also
},
$result
);
push
(
@
{
$self
->
see_also
},
$result
);
}
}
}
}
...
@@ -2433,7 +2441,15 @@ sub add_see_also {
...
@@ -2433,7 +2441,15 @@ sub add_see_also {
sub
remove_see_also
{
sub
remove_see_also
{
my
(
$self
,
$url
)
=
@_
;
my
(
$self
,
$url
)
=
@_
;
my
$see_also
=
$self
->
see_also
;
my
$see_also
=
$self
->
see_also
;
@$see_also
=
grep
{
lc
(
$_
)
ne
lc
(
$url
)
}
@$see_also
;
my
@new_see_also
=
grep
{
lc
(
$_
)
ne
lc
(
$url
)
}
@$see_also
;
my
$privs
;
my
$can
=
$self
->
check_can_change_field
(
'see_also'
,
$see_also
,
\
@new_see_also
,
\
$privs
);
if
(
!
$can
)
{
ThrowUserError
(
'illegal_change'
,
{
field
=>
'see_also'
,
oldvalue
=>
$url
,
privs
=>
$privs
});
}
$self
->
{
see_also
}
=
\
@new_see_also
;
}
}
#####################################################################
#####################################################################
...
...
Write
Preview
Markdown
is supported
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