Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1173277
Security.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 30, 11:20 PM
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Oct 2, 11:20 PM (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
760487
Attached To
rINP In-Portal
Security.php
View Options
<?php
/*
* CKFinder
* ========
* http://cksource.com/ckfinder
* Copyright (C) 2007-2013, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*/
if
(!
defined
(
'IN_CKFINDER'
))
exit
;
/**
* @package CKFinder
* @subpackage Utils
* @copyright CKSource - Frederico Knabben
*/
/**
* @package CKFinder
* @subpackage Utils
* @copyright CKSource - Frederico Knabben
*/
class
CKFinder_Connector_Utils_Security
{
/**
* Strip quotes from global arrays
* @access public
*/
public
function
getRidOfMagicQuotes
()
{
if
(
CKFINDER_CONNECTOR_PHP_MODE
<
6
&&
get_magic_quotes_gpc
())
{
if
(!
empty
(
$_GET
))
{
$this
->
stripQuotes
(
$_GET
);
}
if
(!
empty
(
$_POST
))
{
$this
->
stripQuotes
(
$_POST
);
}
if
(!
empty
(
$_COOKIE
))
{
$this
->
stripQuotes
(
$_COOKIE
);
}
if
(!
empty
(
$_FILES
))
{
foreach
(
array_keys
(
$_FILES
)
as
$k
)
{
if
(
isset
(
$_FILES
[
$k
][
'name'
]))
{
$this
->
stripQuotes
(
$_FILES
[
$k
][
'name'
]);
}
}
}
}
}
/**
* Strip quotes from variable
*
* @access public
* @param mixed $var
* @param int $depth current depth
* @param int $howDeep maximum depth
*/
public
function
stripQuotes
(&
$var
,
$depth
=
0
,
$howDeep
=
5
)
{
if
(
is_array
(
$var
))
{
if
(
$depth
++<
$howDeep
)
{
foreach
(
array_keys
(
$var
)
as
$k
)
{
$this
->
stripQuotes
(
$var
[
$k
],
$depth
,
$howDeep
);
}
}
}
else
{
$var
=
stripslashes
(
$var
);
}
}
}
Event Timeline
Log In to Comment