Commit eebe5bc8 authored by Sigrid Suski's avatar Sigrid Suski

(!) FILTER_SANITIZE_MAGIC_QUOTES is deprecated, use FILTER_SANITIZE_ADD_SLASHES instead

parent 25600ea5
......@@ -13,10 +13,9 @@
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* @created Thu, Dec 1, 2016 12:03:14
*
*
*
* @created Thu, Dec 1, 2016 by Radek Suski
* @modified 27 May 2020 by Sigrid Suski
*/
namespace Sobi\Input;
......@@ -46,8 +45,6 @@ abstract class Input
* @param string $request
*
* @return int
*
* @since version
*/
public static function Int( $name, $request = 'request', $default = 0 )
{
......@@ -65,8 +62,6 @@ abstract class Input
* @param string $request
*
* @return array
*
* @since version
*/
public static function Arr( $name, $request = 'request', array $default = [] )
{
......@@ -80,12 +75,13 @@ abstract class Input
/**
* Search for indexes within the requested method
* Search for indexes within the requested method.
*
* @param string $search variable name
* @param string $request request method
*
* @return mixed
* @return array
* @throws Exception
*/
static public function Search( $search, $request = 'request' )
{
......@@ -138,8 +134,6 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function Base64( $name, $request = 'request', $default = null )
{
......@@ -152,7 +146,6 @@ abstract class Input
* @param string $request
*
* @return bool
* @since version
*/
public static function Bool( $name, $request = 'request', $default = false )
{
......@@ -165,8 +158,6 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function Cmd( $name, $request = 'request', $default = null )
{
......@@ -179,7 +170,6 @@ abstract class Input
* @param string $request
*
* @return float
* @since version
*/
public static function Double( $name, $request = 'request', $default = 0.0 )
{
......@@ -192,8 +182,6 @@ abstract class Input
* @param string $request
*
* @return float
*
* @since version
*/
public static function Float( $name, $request = 'request', $default = 0.0 )
{
......@@ -201,13 +189,12 @@ abstract class Input
}
/**
* @param string $name
* @param string|null $default
* @param $name
* @param string $request
* @param null $default
*
* @return string
*
* @since version
* @return string|string[]
* @throws Exception
*/
public static function Html( $name, $request = 'request', $default = null )
{
......@@ -242,14 +229,12 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function String( $name, $request = 'request', $default = null )
{
$value = Request::Instance()->{$request}->getString( $name, $default );
return filter_var( $value, FILTER_SANITIZE_MAGIC_QUOTES );
return filter_var( $value, FILTER_SANITIZE_ADD_SLASHES );
}
/**
......@@ -258,8 +243,6 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function Ip4( $name = 'REMOTE_ADDR', $request = 'server', $default = null )
{
......@@ -267,10 +250,7 @@ abstract class Input
}
/**
*
* @return false|string
*
* @since version
*/
public static function Now()
{
......@@ -283,8 +263,6 @@ abstract class Input
* @param string $request
*
* @return mixed
*
* @since version
*/
public static function Raw( $name, $request = 'request', $default = null )
{
......@@ -311,8 +289,6 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function Task( $request = 'request' )
{
......@@ -325,7 +301,6 @@ abstract class Input
*
* @return int
* @throws Exception
* @since version
*/
public static function __callStatic( $name, $arguments = [] )
{
......@@ -366,8 +341,6 @@ abstract class Input
* @param string $request
*
* @return string
*
* @since version
*/
public static function Word( $name, $request = 'request', $default = null )
{
......@@ -378,9 +351,6 @@ abstract class Input
* @param $name
* @param $value
* @param string $request
*
*
* @since version
*/
public static function Set( $name, $value, $request = 'request' )
{
......@@ -413,10 +383,11 @@ abstract class Input
/**
* @param string $name variable name
* @param string $property
* @param null $property
* @param string $request request method
*
* @return string
* @return array|mixed|null
* @throws Exception
*/
static public function File( $name, $property = null, $request = 'files' )
{
......@@ -442,6 +413,7 @@ abstract class Input
$data = Request::Instance()->files->get( $name );
}
}
return ( $property && isset( $data[ $property ] ) ) ? $data[ $property ] : $data;
}
}
......@@ -34,6 +34,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
### 1.0.12 (30 May 2020)
(!) CURL error messages improved and initialisation status added
(!) FILTER_SANITIZE_MAGIC_QUOTES is deprecated, use FILTER_SANITIZE_ADD_SLASHES instead
### 1.0.11 (21 January 2020)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment