summaryrefslogtreecommitdiff
path: root/includes/sys_page.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-29 16:21:25 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-29 21:52:07 +0200
commitcc01c906ba63b3797bf2b9ef92a6854fe2ddbefb (patch)
treeea819678100f6a50d67f1f8516e82fdef8a9196b /includes/sys_page.php
parent73175e2b64c85c7a8c528c76452cd82ffa99f925 (diff)
#336: Integration of symfony/http-foundation request
Diffstat (limited to 'includes/sys_page.php')
-rw-r--r--includes/sys_page.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/sys_page.php b/includes/sys_page.php
index 501106ff..df57d08a 100644
--- a/includes/sys_page.php
+++ b/includes/sys_page.php
@@ -1,4 +1,5 @@
<?php
+
use Engelsystem\ValidationResult;
/**
@@ -168,11 +169,8 @@ function strip_request_item($name, $default_value = null)
*/
function test_request_int($name)
{
- $request = request();
- if ($request->has($name)) {
- return preg_match('/^\d*$/', $request->input($name));
- }
- return false;
+ $input = request()->input($name);
+ return preg_match('/^\d*$/', $input);
}
/**
@@ -186,7 +184,11 @@ function strip_request_item_nl($name, $default_value = null)
{
$request = request();
if ($request->has($name)) {
- return preg_replace("/([^\p{L}\p{S}\p{P}\p{Z}\p{N}+\n]{1,})/ui", '', strip_tags($request->get($name)));
+ return preg_replace(
+ "/([^\p{L}\p{S}\p{P}\p{Z}\p{N}+\n]{1,})/ui",
+ '',
+ strip_tags($request->input($name))
+ );
}
return $default_value;
}