Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
d720a82c
Commit
d720a82c
authored
12 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
remove() implemented for Input class
parent
a12aaeb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/Input.class.php
+25
-1
25 additions, 1 deletion
inc/Input.class.php
with
25 additions
and
1 deletion
inc/Input.class.php
+
25
−
1
View file @
d720a82c
...
...
@@ -30,7 +30,8 @@ class Input {
/**
* Check if a parameter was set
*
* Basically a wrapper around isset
* Basically a wrapper around isset. When called on the $post and $get subclasses,
* the parameter is set to $_POST or $_GET and to $_REQUEST
*
* @see isset
* @param string $name Parameter name
...
...
@@ -40,6 +41,29 @@ class Input {
return
isset
(
$this
->
access
[
$name
]);
}
/**
* Remove a parameter from the superglobals
*
* Basically a wrapper around unset. When NOT called on the $post and $get subclasses,
* the parameter will also be removed from $_POST or $_GET
*
* @see isset
* @param string $name Parameter name
* @return bool
*/
public
function
remove
(
$name
)
{
if
(
isset
(
$this
->
access
[
$name
]))
{
unset
(
$this
->
access
[
$name
]);
}
// also remove from sub classes
if
(
isset
(
$this
->
post
)
&&
isset
(
$_POST
[
$name
]))
{
unset
(
$_POST
[
$name
]);
}
if
(
isset
(
$this
->
get
)
&&
isset
(
$_GET
[
$name
]))
{
unset
(
$_GET
[
$name
]);
}
}
/**
* Access a request parameter without any type conversion
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment