Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
543df477
Commit
543df477
authored
Feb 27, 2017
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api, missing check for existing method.
parent
b7f438d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
ApiControllerBase.php
...e/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
+21
-18
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
View file @
543df477
...
@@ -132,6 +132,8 @@ class ApiControllerBase extends ControllerRoot
...
@@ -132,6 +132,8 @@ class ApiControllerBase extends ControllerRoot
$dispatchError
=
null
;
$dispatchError
=
null
;
// check number of parameters using reflection
// check number of parameters using reflection
$object_info
=
new
\ReflectionObject
(
$this
);
$object_info
=
new
\ReflectionObject
(
$this
);
if
(
$object_info
->
hasMethod
(
$callMethodName
))
{
// only inspect parameters if object exists
$req_c
=
$object_info
->
getMethod
(
$callMethodName
)
->
getNumberOfRequiredParameters
();
$req_c
=
$object_info
->
getMethod
(
$callMethodName
)
->
getNumberOfRequiredParameters
();
if
(
$req_c
>
count
(
$dispatcher
->
getParams
()))
{
if
(
$req_c
>
count
(
$dispatcher
->
getParams
()))
{
$dispatchError
=
'action '
.
$dispatcher
->
getActionName
()
.
$dispatchError
=
'action '
.
$dispatcher
->
getActionName
()
.
...
@@ -151,6 +153,7 @@ class ApiControllerBase extends ControllerRoot
...
@@ -151,6 +153,7 @@ class ApiControllerBase extends ControllerRoot
$this
->
response
->
send
();
$this
->
response
->
send
();
return
false
;
return
false
;
}
}
}
return
true
;
return
true
;
}
}
...
...
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