Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/controller/rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ protected function _prepare_basic_auth()
// most other servers
elseif (\Input::server('HTTP_AUTHORIZATION'))
{
if (strpos(strtolower(\Input::server('HTTP_AUTHORIZATION')), 'basic') === 0)
if (strpos(strtolower((string) \Input::server('HTTP_AUTHORIZATION')), 'basic') === 0)
{
list($username, $password) = explode(':', base64_decode(substr(\Input::server('HTTP_AUTHORIZATION'), 6)));
list($username, $password) = explode(':', base64_decode(substr((string) \Input::server('HTTP_AUTHORIZATION'), 6)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions classes/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ protected function _from_xml($string, $recursive = false)
static $escape_keys = array();
$recursive or $escape_keys = array('_xmlns' => 'xmlns');

if ( ! $recursive and strpos($string, 'xmlns') !== false and preg_match_all('/(\<.+?\>)/s', $string, $matches))
if ( ! $recursive and strpos((string) $string, 'xmlns') !== false and preg_match_all('/(\<.+?\>)/s', (string) $string, $matches))
{
foreach ($matches[1] as $tag)
{
Expand Down Expand Up @@ -568,7 +568,7 @@ protected static function pretty_json($data)
$new_json = "";
$indent_level = 0;
$in_string = false;
$len = strlen($json);
$len = strlen((string) $json);

for ($c = 0; $c < $len; $c++)
{
Expand Down
6 changes: 3 additions & 3 deletions classes/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Html
*/
public static function anchor($href, $text = null, $attr = array(), $secure = null)
{
if ( ! preg_match('#^(\w+://|javascript:|\#)# i', $href))
if ( ! preg_match('#^(\w+://|javascript:|\#)# i', (string) $href))
{
$urlparts = explode('?', $href, 2);
$href = \Uri::create($urlparts[0], array(), isset($urlparts[1]) ? $urlparts[1] : array(), $secure);
Expand Down Expand Up @@ -129,9 +129,9 @@ public static function mail_to($email, $text = null, $subject = null, $attr = ar
*/
public static function mail_to_safe($email, $text = null, $subject = null, $attr = array())
{
$text or $text = str_replace('@', '[at]', $email);
$text or $text = str_replace('@', '[at]', (string) $email);

$email = explode("@", $email);
$email = explode("@", (string) $email);

$subject and $subject = '?subject='.$subject;

Expand Down
6 changes: 3 additions & 3 deletions classes/input.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function protocol()
*/
public static function is_ajax()
{
return (static::server('HTTP_X_REQUESTED_WITH') !== null) and strtolower(static::server('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest';
return (static::server('HTTP_X_REQUESTED_WITH') !== null) and strtolower((string) static::server('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest';
}

/**
Expand Down Expand Up @@ -225,7 +225,7 @@ public static function cookie($index = null, $default = null)
*/
public static function server($index = null, $default = null)
{
return (func_num_args() === 0) ? $_SERVER : \Arr::get($_SERVER, strtoupper($index), $default);
return (func_num_args() === 0) ? $_SERVER : \Arr::get($_SERVER, strtoupper((string) $index), $default);
}

/**
Expand Down Expand Up @@ -263,7 +263,7 @@ public static function headers($index = null, $default = null)
}
}

return empty($headers) ? $default : ((func_num_args() === 0) ? $headers : \Arr::get(array_change_key_case($headers), strtolower($index), $default));
return empty($headers) ? $default : ((func_num_args() === 0) ? $headers : \Arr::get(array_change_key_case($headers), strtolower((string) $index), $default));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions classes/request/driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function __construct($resource, array $options, $method = null)
*/
public function set_method($method)
{
$this->method = strtoupper($method);
$this->method = strtoupper((string) $method);
return $this;
}

Expand Down Expand Up @@ -341,7 +341,7 @@ protected function mime_in_header($mime, $accept_header)
}

// match on generic mime type
$mime = substr($mime, 0, strpos($mime, '/')).'/*';
$mime = substr((string) $mime, 0, strpos((string) $mime, '/')).'/*';
if (in_array($mime, $accept_mimes))
{
return true;
Expand Down
2 changes: 1 addition & 1 deletion classes/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function _init()
if (\Config::get('security.csrf_autoload', false))
{
$check_token_methods = \Config::get('security.csrf_autoload_methods', array('post', 'put', 'delete'));
if (in_array(strtolower(\Input::method()), $check_token_methods) and ! static::check_token())
if (in_array(strtolower((string) \Input::method()), $check_token_methods) and ! static::check_token())
{
if (\Config::get('security.csrf_bad_request_on_fail', false))
{
Expand Down
6 changes: 3 additions & 3 deletions classes/str.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function truncate($string, $limit, $continuation = '...', $is_html
// Handle special characters.
preg_match_all('/&[a-z]+;/i', strip_tags($string), $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
// fix preg_match_all broken multibyte support
if (MBSTRING and strlen($string !== mb_strlen($string)))
if (MBSTRING and strlen((string) $string) !== mb_strlen((string) $string))
{
$correction = 0;
foreach ($matches as $index => $match)
Expand All @@ -66,7 +66,7 @@ public static function truncate($string, $limit, $continuation = '...', $is_html
// Handle all the html tags.
preg_match_all('/<[^>]+>([^<]*)/', $string, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
// fix preg_match_all broken multibyte support
if (MBSTRING and strlen($string !== mb_strlen($string)))
if (MBSTRING and strlen((string) $string) !== mb_strlen((string) $string))
{
$correction = 0;
foreach ($matches as $index => $match)
Expand Down Expand Up @@ -327,7 +327,7 @@ public static function is_serialized($string)
*/
public static function is_html($string)
{
return strlen(strip_tags($string)) < strlen($string);
return strlen(strip_tags((string) $string)) < strlen((string) $string);
}

// multibyte functions
Expand Down
2 changes: 1 addition & 1 deletion classes/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function add_field($name, $label, $rules)
{
$field = $this->add($name, $label);

is_array($rules) or $rules = explode('|', $rules);
is_array($rules) or $rules = explode('|', (string) $rules);

foreach ($rules as $rule)
{
Expand Down