Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
0b7b22f1
Commit
0b7b22f1
authored
Jul 19, 2014
by
pupi1985
Committed by
Scott
Oct 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a convenient function to fetch arrays from $_POST array
parent
3c46cb94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
qa-base.php
qa-include/qa-base.php
+17
-0
No files found.
qa-include/qa-base.php
View file @
0b7b22f1
...
...
@@ -973,6 +973,23 @@
return
isset
(
$_POST
[
$field
])
?
preg_replace
(
'/\r\n?/'
,
"
\n
"
,
trim
(
qa_gpc_to_string
(
$_POST
[
$field
])))
:
null
;
}
function
qa_post_array
(
$field
)
/*
Return an array for incoming POST field, or null if it's not defined.
While we're at it, trim() surrounding white space for each value and convert them to Unix line endings.
*/
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
if
(
isset
(
$_POST
[
$field
]))
{
$result
=
array
();
foreach
(
$_POST
[
$field
]
as
$key
=>
$value
)
$result
[
$key
]
=
preg_replace
(
'/\r\n?/'
,
"
\n
"
,
trim
(
qa_gpc_to_string
(
$value
)));
return
$result
;
}
return
null
;
}
function
qa_clicked
(
$name
)
/*
...
...
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