mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Merge pull request #4013 from Icinga/feature/support-for-php-7.4-4009
Support for PHP 7.4
This commit is contained in:
commit
3900929a0d
16
.travis.yml
16
.travis.yml
@ -1,13 +1,13 @@
|
|||||||
language: php
|
language: php
|
||||||
dist: trusty
|
dist: xenial
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- '5.6'
|
- '5.6'
|
||||||
- '7.0'
|
|
||||||
- '7.1'
|
- '7.1'
|
||||||
- '7.2'
|
- '7.2'
|
||||||
- '7.3'
|
- '7.3'
|
||||||
|
- '7.4'
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -15,18 +15,26 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- env: CHECK=phpcs
|
||||||
|
php: '7.4'
|
||||||
- env: CHECK=phpcs
|
- env: CHECK=phpcs
|
||||||
php: '7.3'
|
php: '7.3'
|
||||||
- env: CHECK=phpcs
|
- env: CHECK=phpcs
|
||||||
php: '7.0'
|
php: '7.2'
|
||||||
|
- env: CHECK=phpcs
|
||||||
|
php: '7.1'
|
||||||
- env: CHECK=phpcs
|
- env: CHECK=phpcs
|
||||||
php: '5.6'
|
php: '5.6'
|
||||||
- env: CHECK=syntax
|
- env: CHECK=syntax
|
||||||
php: 'nightly'
|
php: 'nightly'
|
||||||
|
- env: CHECK=syntax
|
||||||
|
php: '7.4'
|
||||||
- env: CHECK=syntax
|
- env: CHECK=syntax
|
||||||
php: '7.3'
|
php: '7.3'
|
||||||
- env: CHECK=syntax
|
- env: CHECK=syntax
|
||||||
php: '7.0'
|
php: '7.2'
|
||||||
|
- env: CHECK=syntax
|
||||||
|
php: '7.1'
|
||||||
- env: CHECK=syntax
|
- env: CHECK=syntax
|
||||||
php: '5.6'
|
php: '5.6'
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
@ -320,7 +320,7 @@ class ResourceConfigForm extends ConfigForm
|
|||||||
if ($this->getElement('resource_validation')->isChecked() && parent::isValid($formData)) {
|
if ($this->getElement('resource_validation')->isChecked() && parent::isValid($formData)) {
|
||||||
$inspection = static::inspectResource($this);
|
$inspection = static::inspectResource($this);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -69,7 +69,7 @@ class UserBackendConfigForm extends ConfigForm
|
|||||||
$externalBackends = $this->config->toArray();
|
$externalBackends = $this->config->toArray();
|
||||||
array_walk(
|
array_walk(
|
||||||
$externalBackends,
|
$externalBackends,
|
||||||
function (& $authBackendCfg) {
|
function (&$authBackendCfg) {
|
||||||
if (! isset($authBackendCfg['backend']) || $authBackendCfg['backend'] !== 'external') {
|
if (! isset($authBackendCfg['backend']) || $authBackendCfg['backend'] !== 'external') {
|
||||||
$authBackendCfg = null;
|
$authBackendCfg = null;
|
||||||
}
|
}
|
||||||
@ -397,7 +397,7 @@ class UserBackendConfigForm extends ConfigForm
|
|||||||
if ($this->getElement('backend_validation')->isChecked() && parent::isValid($formData)) {
|
if ($this->getElement('backend_validation')->isChecked() && parent::isValid($formData)) {
|
||||||
$inspection = static::inspectUserBackend($this);
|
$inspection = static::inspectUserBackend($this);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -229,7 +229,7 @@ class UserGroupBackendForm extends ConfigForm
|
|||||||
if (isset($formData['backend_validation']) && parent::isValid($formData)) {
|
if (isset($formData['backend_validation']) && parent::isValid($formData)) {
|
||||||
$inspection = static::inspectUserBackend($this);
|
$inspection = static::inspectUserBackend($this);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -350,7 +350,7 @@ class RoleForm extends RepositoryForm
|
|||||||
return $success ? $this->translate('Role removed') : $this->translate('Role removal failed');
|
return $success ? $this->translate('Role removed') : $this->translate('Role removal failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function sortPermissions(& $permissions)
|
protected function sortPermissions(&$permissions)
|
||||||
{
|
{
|
||||||
return uasort($permissions, function ($a, $b) {
|
return uasort($permissions, function ($a, $b) {
|
||||||
if (isset($a['isUsagePerm'])) {
|
if (isset($a['isUsagePerm'])) {
|
||||||
|
@ -170,7 +170,7 @@ class Web extends EmbeddedWeb
|
|||||||
return $this->viewRenderer;
|
return $this->viewRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function hasAccessToSharedNavigationItem(& $config, Config $navConfig)
|
private function hasAccessToSharedNavigationItem(&$config, Config $navConfig)
|
||||||
{
|
{
|
||||||
// TODO: Provide a more sophisticated solution
|
// TODO: Provide a more sophisticated solution
|
||||||
|
|
||||||
|
@ -297,7 +297,9 @@ class Donut
|
|||||||
'r' => sprintf('%F', $this->radius),
|
'r' => sprintf('%F', $this->radius),
|
||||||
'fill' => 'transparent',
|
'fill' => 'transparent',
|
||||||
'stroke-width' => $this->getThickness(),
|
'stroke-width' => $this->getThickness(),
|
||||||
'stroke-dasharray' => sprintf('%F', $slice[0]) . ' ' . sprintf('%F', (99.9 - $slice[0])), // 99.9 prevents gaps (slight overlap)
|
'stroke-dasharray' => sprintf('%F', $slice[0])
|
||||||
|
. ' '
|
||||||
|
. sprintf('%F', (99.9 - $slice[0])), // 99.9 prevents gaps (slight overlap)
|
||||||
'stroke-dashoffset' => sprintf('%F', $offset)
|
'stroke-dashoffset' => sprintf('%F', $offset)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -889,13 +889,17 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$legacyControlHandling = version_compare(PHP_VERSION, '7.3.0') < 0;
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$cookie = '';
|
$cookie = '';
|
||||||
$entries = array();
|
$entries = array();
|
||||||
do {
|
do {
|
||||||
|
if ($legacyControlHandling) {
|
||||||
// Do not request the pagination control as a critical extension, as we want the
|
// Do not request the pagination control as a critical extension, as we want the
|
||||||
// server to return results even if the paged search request cannot be satisfied
|
// server to return results even if the paged search request cannot be satisfied
|
||||||
ldap_control_paged_result($ds, $pageSize, false, $cookie);
|
ldap_control_paged_result($ds, $pageSize, false, $cookie);
|
||||||
|
}
|
||||||
|
|
||||||
if ($serverSorting && $query->hasOrder()) {
|
if ($serverSorting && $query->hasOrder()) {
|
||||||
ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array(
|
ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array(
|
||||||
@ -910,7 +914,10 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
$query,
|
$query,
|
||||||
array_values($fields),
|
array_values($fields),
|
||||||
0,
|
0,
|
||||||
($serverSorting || ! $query->hasOrder()) && $limit ? $offset + $limit : 0
|
($serverSorting || ! $query->hasOrder()) && $limit ? $offset + $limit : 0,
|
||||||
|
0,
|
||||||
|
LDAP_DEREF_NEVER,
|
||||||
|
$legacyControlHandling ? null : $pageSize
|
||||||
);
|
);
|
||||||
if ($results === false) {
|
if ($results === false) {
|
||||||
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
||||||
@ -976,7 +983,7 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
&& ($entry = ldap_next_entry($ds, $entry))
|
&& ($entry = ldap_next_entry($ds, $entry))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (false === @ldap_control_paged_result_response($ds, $results, $cookie)) {
|
if ($legacyControlHandling && false === @ldap_control_paged_result_response($ds, $results, $cookie)) {
|
||||||
// If the page size is greater than or equal to the sizeLimit value, the server should ignore the
|
// If the page size is greater than or equal to the sizeLimit value, the server should ignore the
|
||||||
// control as the request can be satisfied in a single page: https://www.ietf.org/rfc/rfc2696.txt
|
// control as the request can be satisfied in a single page: https://www.ietf.org/rfc/rfc2696.txt
|
||||||
// This applies no matter whether paged search requests are permitted or not. You're done once you
|
// This applies no matter whether paged search requests are permitted or not. You're done once you
|
||||||
@ -993,7 +1000,7 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
ldap_free_result($results);
|
ldap_free_result($results);
|
||||||
} while ($cookie && (! $serverSorting || $limit === 0 || count($entries) < $limit));
|
} while ($cookie && (! $serverSorting || $limit === 0 || count($entries) < $limit));
|
||||||
|
|
||||||
if ($cookie) {
|
if ($legacyControlHandling && $cookie) {
|
||||||
// A sequence of paged search requests is abandoned by the client sending a search request containing a
|
// A sequence of paged search requests is abandoned by the client sending a search request containing a
|
||||||
// pagedResultsControl with the size set to zero (0) and the cookie set to the last cookie returned by
|
// pagedResultsControl with the size set to zero (0) and the cookie set to the last cookie returned by
|
||||||
// the server: https://www.ietf.org/rfc/rfc2696.txt
|
// the server: https://www.ietf.org/rfc/rfc2696.txt
|
||||||
@ -1219,6 +1226,7 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
* @param int $sizelimit Enables you to limit the count of entries fetched
|
* @param int $sizelimit Enables you to limit the count of entries fetched
|
||||||
* @param int $timelimit Sets the number of seconds how long is spend on the search
|
* @param int $timelimit Sets the number of seconds how long is spend on the search
|
||||||
* @param int $deref
|
* @param int $deref
|
||||||
|
* @param int $pageSize The page size to request (Only supported with PHP v7.3+)
|
||||||
*
|
*
|
||||||
* @return resource|bool A search result identifier or false on error
|
* @return resource|bool A search result identifier or false on error
|
||||||
*
|
*
|
||||||
@ -1230,7 +1238,8 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
$attrsonly = 0,
|
$attrsonly = 0,
|
||||||
$sizelimit = 0,
|
$sizelimit = 0,
|
||||||
$timelimit = 0,
|
$timelimit = 0,
|
||||||
$deref = LDAP_DEREF_NEVER
|
$deref = LDAP_DEREF_NEVER,
|
||||||
|
$pageSize = null
|
||||||
) {
|
) {
|
||||||
$queryString = (string) $query;
|
$queryString = (string) $query;
|
||||||
$baseDn = $query->getBase() ?: $this->getDn();
|
$baseDn = $query->getBase() ?: $this->getDn();
|
||||||
@ -1285,6 +1294,20 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
throw new LogicException('LDAP scope %s not supported by ldapSearch', $scope);
|
throw new LogicException('LDAP scope %s not supported by ldapSearch', $scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$serverctrls = [];
|
||||||
|
if ($pageSize !== null) {
|
||||||
|
$serverctrls[] = [
|
||||||
|
'oid' => LDAP_CONTROL_PAGEDRESULTS,
|
||||||
|
// Do not request the pagination control as a critical extension, as we want the
|
||||||
|
// server to return results even if the paged search request cannot be satisfied
|
||||||
|
'iscritical' => false,
|
||||||
|
'value' => [
|
||||||
|
'size' => $pageSize,
|
||||||
|
'cookie' => ''
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return @$function(
|
return @$function(
|
||||||
$this->getConnection(),
|
$this->getConnection(),
|
||||||
$baseDn,
|
$baseDn,
|
||||||
@ -1293,7 +1316,8 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
$attrsonly,
|
$attrsonly,
|
||||||
$sizelimit,
|
$sizelimit,
|
||||||
$timelimit,
|
$timelimit,
|
||||||
$deref
|
$deref,
|
||||||
|
$serverctrls
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
|||||||
*
|
*
|
||||||
* @throws ProgrammingError In case no valid section name is available
|
* @throws ProgrammingError In case no valid section name is available
|
||||||
*/
|
*/
|
||||||
protected function extractSectionName(& $config, $keyColumn)
|
protected function extractSectionName(&$config, $keyColumn)
|
||||||
{
|
{
|
||||||
if (! is_array($config) && !$config instanceof ConfigObject) {
|
if (! is_array($config) && !$config instanceof ConfigObject) {
|
||||||
throw new ProgrammingError('$config is neither an array nor a ConfigObject');
|
throw new ProgrammingError('$config is neither an array nor a ConfigObject');
|
||||||
|
@ -68,7 +68,7 @@ class Format
|
|||||||
return sprintf('%0.2f d', $value / 86400);
|
return sprintf('%0.2f d', $value / 86400);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function formatForUnits($value, & $units, $base)
|
protected static function formatForUnits($value, &$units, $base)
|
||||||
{
|
{
|
||||||
$sign = '';
|
$sign = '';
|
||||||
if ($value < 0) {
|
if ($value < 0) {
|
||||||
|
@ -1120,7 +1120,7 @@ class Form extends Zend_Form
|
|||||||
* @param Zend_Form $form
|
* @param Zend_Form $form
|
||||||
* @param array $defaults
|
* @param array $defaults
|
||||||
*/
|
*/
|
||||||
protected function preserveDefaults(Zend_Form $form, array & $defaults)
|
protected function preserveDefaults(Zend_Form $form, array &$defaults)
|
||||||
{
|
{
|
||||||
foreach ($form->getElements() as $name => $element) {
|
foreach ($form->getElements() as $name => $element) {
|
||||||
if ((array_key_exists($name, $defaults)
|
if ((array_key_exists($name, $defaults)
|
||||||
|
@ -95,7 +95,7 @@ class FormHints extends Zend_Form_Decorator_Abstract
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function recurseForm(Form $form, & $entirelyRequired = null, $elementsPassed = false)
|
protected function recurseForm(Form $form, &$entirelyRequired = null, $elementsPassed = false)
|
||||||
{
|
{
|
||||||
$requiredLabels = array();
|
$requiredLabels = array();
|
||||||
if ($form->getRequiredCue() !== null) {
|
if ($form->getRequiredCue() !== null) {
|
||||||
|
@ -59,13 +59,6 @@ class View extends Zend_View_Abstract
|
|||||||
*/
|
*/
|
||||||
const CHARSET = 'UTF-8';
|
const CHARSET = 'UTF-8';
|
||||||
|
|
||||||
/**
|
|
||||||
* Flag to register stream wrapper
|
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $useViewStream = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registered helper functions
|
* Registered helper functions
|
||||||
*/
|
*/
|
||||||
@ -86,13 +79,6 @@ class View extends Zend_View_Abstract
|
|||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = array())
|
||||||
{
|
{
|
||||||
$this->useViewStream = (bool) ini_get('short_open_tag') ? false : true;
|
|
||||||
if ($this->useViewStream) {
|
|
||||||
if (!in_array('zend.view', stream_get_wrappers())) {
|
|
||||||
stream_wrapper_register('zend.view', '\Icinga\Web\ViewStream');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$config['helperPath']['Icinga\\Web\\View\\Helper\\'] = Icinga::app()->getLibraryDir('Icinga/Web/View/Helper');
|
$config['helperPath']['Icinga\\Web\\View\\Helper\\'] = Icinga::app()->getLibraryDir('Icinga/Web/View/Helper');
|
||||||
|
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
@ -258,12 +244,9 @@ class View extends Zend_View_Abstract
|
|||||||
// Exporting global variables to view scripts:
|
// Exporting global variables to view scripts:
|
||||||
$$k = $v;
|
$$k = $v;
|
||||||
}
|
}
|
||||||
if ($this->useViewStream) {
|
|
||||||
include 'zend.view://' . func_get_arg(0);
|
|
||||||
} else {
|
|
||||||
include func_get_arg(0);
|
include func_get_arg(0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accesses a helper object from within a script
|
* Accesses a helper object from within a script
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
|
|
||||||
|
|
||||||
namespace Icinga\Web;
|
|
||||||
|
|
||||||
use Zend_View_Stream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is used in Icinga\Web\View to imitate PHP's short_open_tag
|
|
||||||
*/
|
|
||||||
class ViewStream extends Zend_View_Stream
|
|
||||||
{
|
|
||||||
}
|
|
@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
|
|||||||
protected function _compileRegex()
|
protected function _compileRegex()
|
||||||
{
|
{
|
||||||
$raw = str_replace(' ', '', $this->dtd_regex);
|
$raw = str_replace(' ', '', $this->dtd_regex);
|
||||||
if ($raw{0} != '(') {
|
if ($raw[0] != '(') {
|
||||||
$raw = "($raw)";
|
$raw = "($raw)";
|
||||||
}
|
}
|
||||||
$el = '[#a-zA-Z0-9_.-]+';
|
$el = '[#a-zA-Z0-9_.-]+';
|
||||||
|
2
library/vendor/HTMLPurifier/Encoder.php
vendored
2
library/vendor/HTMLPurifier/Encoder.php
vendored
@ -159,7 +159,7 @@ class HTMLPurifier_Encoder
|
|||||||
|
|
||||||
$len = strlen($str);
|
$len = strlen($str);
|
||||||
for ($i = 0; $i < $len; $i++) {
|
for ($i = 0; $i < $len; $i++) {
|
||||||
$in = ord($str{$i});
|
$in = ord($str[$i]);
|
||||||
$char .= $str[$i]; // append byte to char
|
$char .= $str[$i]; // append byte to char
|
||||||
if (0 == $mState) {
|
if (0 == $mState) {
|
||||||
// When mState is zero we expect either a US-ASCII character
|
// When mState is zero we expect either a US-ASCII character
|
||||||
|
@ -75,7 +75,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform
|
|||||||
if (isset($attr['size'])) {
|
if (isset($attr['size'])) {
|
||||||
// normalize large numbers
|
// normalize large numbers
|
||||||
if ($attr['size'] !== '') {
|
if ($attr['size'] !== '') {
|
||||||
if ($attr['size']{0} == '+' || $attr['size']{0} == '-') {
|
if ($attr['size'][0] == '+' || $attr['size'][0] == '-') {
|
||||||
$size = (int)$attr['size'];
|
$size = (int)$attr['size'];
|
||||||
if ($size < -2) {
|
if ($size < -2) {
|
||||||
$attr['size'] = '-2';
|
$attr['size'] = '-2';
|
||||||
|
2
library/vendor/Zend/Filter/Compress/Zip.php
vendored
2
library/vendor/Zend/Filter/Compress/Zip.php
vendored
@ -227,7 +227,7 @@ class Zend_Filter_Compress_Zip extends Zend_Filter_Compress_CompressAbstract
|
|||||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||||
$statIndex = $zip->statIndex($i);
|
$statIndex = $zip->statIndex($i);
|
||||||
$currName = $statIndex['name'];
|
$currName = $statIndex['name'];
|
||||||
if (($currName{0} == '/') ||
|
if (($currName[0] == '/') ||
|
||||||
(substr($currName, 0, 2) == '..') ||
|
(substr($currName, 0, 2) == '..') ||
|
||||||
(substr($currName, 0, 4) == './..')
|
(substr($currName, 0, 4) == './..')
|
||||||
)
|
)
|
||||||
|
12
library/vendor/Zend/Json/Decoder.php
vendored
12
library/vendor/Zend/Json/Decoder.php
vendored
@ -317,7 +317,7 @@ class Zend_Json_Decoder
|
|||||||
$i = $this->_offset;
|
$i = $this->_offset;
|
||||||
$start = $i;
|
$start = $i;
|
||||||
|
|
||||||
switch ($str{$i}) {
|
switch ($str[$i]) {
|
||||||
case '{':
|
case '{':
|
||||||
$this->_token = self::LBRACE;
|
$this->_token = self::LBRACE;
|
||||||
break;
|
break;
|
||||||
@ -344,14 +344,14 @@ class Zend_Json_Decoder
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$chr = $str{$i};
|
$chr = $str[$i];
|
||||||
|
|
||||||
if ($chr == '\\') {
|
if ($chr == '\\') {
|
||||||
$i++;
|
$i++;
|
||||||
if ($i >= $str_length) {
|
if ($i >= $str_length) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$chr = $str{$i};
|
$chr = $str[$i];
|
||||||
switch ($chr) {
|
switch ($chr) {
|
||||||
case '"' :
|
case '"' :
|
||||||
$result .= '"';
|
$result .= '"';
|
||||||
@ -423,7 +423,7 @@ class Zend_Json_Decoder
|
|||||||
return($this->_token);
|
return($this->_token);
|
||||||
}
|
}
|
||||||
|
|
||||||
$chr = $str{$i};
|
$chr = $str[$i];
|
||||||
if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {
|
if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {
|
||||||
if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s',
|
if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s',
|
||||||
$str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) {
|
$str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) {
|
||||||
@ -483,7 +483,7 @@ class Zend_Json_Decoder
|
|||||||
$i += 5;
|
$i += 5;
|
||||||
break;
|
break;
|
||||||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||||
$utf8 .= $chrs{$i};
|
$utf8 .= $chrs[$i];
|
||||||
break;
|
break;
|
||||||
case ($ord_chrs_c & 0xE0) == 0xC0:
|
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||||
@ -541,7 +541,7 @@ class Zend_Json_Decoder
|
|||||||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||||
}
|
}
|
||||||
|
|
||||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case ((0x7F & $bytes) == $bytes):
|
case ((0x7F & $bytes) == $bytes):
|
||||||
|
14
library/vendor/Zend/Json/Encoder.php
vendored
14
library/vendor/Zend/Json/Encoder.php
vendored
@ -556,17 +556,17 @@ class Zend_Json_Encoder
|
|||||||
case 2:
|
case 2:
|
||||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
return chr(0x07 & (ord($utf8{0}) >> 2))
|
return chr(0x07 & (ord($utf8[0]) >> 2))
|
||||||
. chr((0xC0 & (ord($utf8{0}) << 6))
|
. chr((0xC0 & (ord($utf8[0]) << 6))
|
||||||
| (0x3F & ord($utf8{1})));
|
| (0x3F & ord($utf8[1])));
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||||
return chr((0xF0 & (ord($utf8{0}) << 4))
|
return chr((0xF0 & (ord($utf8[0]) << 4))
|
||||||
| (0x0F & (ord($utf8{1}) >> 2)))
|
| (0x0F & (ord($utf8[1]) >> 2)))
|
||||||
. chr((0xC0 & (ord($utf8{1}) << 6))
|
. chr((0xC0 & (ord($utf8[1]) << 6))
|
||||||
| (0x7F & ord($utf8{2})));
|
| (0x7F & ord($utf8[2])));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignoring UTF-32 for now, sorry
|
// ignoring UTF-32 for now, sorry
|
||||||
|
12
library/vendor/Zend/Registry.php
vendored
12
library/vendor/Zend/Registry.php
vendored
@ -189,16 +189,4 @@ class Zend_Registry extends ArrayObject
|
|||||||
{
|
{
|
||||||
parent::__construct($array, $flags);
|
parent::__construct($array, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $index
|
|
||||||
* @returns mixed
|
|
||||||
*
|
|
||||||
* Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).
|
|
||||||
*/
|
|
||||||
public function offsetExists($index)
|
|
||||||
{
|
|
||||||
return array_key_exists($index, $this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
6
library/vendor/Zend/Validate/Isbn.php
vendored
6
library/vendor/Zend/Validate/Isbn.php
vendored
@ -165,7 +165,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract
|
|||||||
$isbn10 = str_replace($this->_separator, '', $value);
|
$isbn10 = str_replace($this->_separator, '', $value);
|
||||||
$sum = 0;
|
$sum = 0;
|
||||||
for ($i = 0; $i < 9; $i++) {
|
for ($i = 0; $i < 9; $i++) {
|
||||||
$sum += (10 - $i) * $isbn10{$i};
|
$sum += (10 - $i) * $isbn10[$i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// checksum
|
// checksum
|
||||||
@ -183,9 +183,9 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract
|
|||||||
$sum = 0;
|
$sum = 0;
|
||||||
for ($i = 0; $i < 12; $i++) {
|
for ($i = 0; $i < 12; $i++) {
|
||||||
if ($i % 2 == 0) {
|
if ($i % 2 == 0) {
|
||||||
$sum += $isbn13{$i};
|
$sum += $isbn13[$i];
|
||||||
} else {
|
} else {
|
||||||
$sum += 3 * $isbn13{$i};
|
$sum += 3 * $isbn13[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// checksum
|
// checksum
|
||||||
|
10
library/vendor/lessphp/lessc.inc.php
vendored
10
library/vendor/lessphp/lessc.inc.php
vendored
@ -662,7 +662,7 @@ class lessc {
|
|||||||
|
|
||||||
// check for a rest
|
// check for a rest
|
||||||
$last = end($args);
|
$last = end($args);
|
||||||
if ($last[0] == "rest") {
|
if (is_array($last) && $last[0] == "rest") {
|
||||||
$rest = array_slice($orderedValues, count($args) - 1);
|
$rest = array_slice($orderedValues, count($args) - 1);
|
||||||
$this->set($last[1], $this->reduce(array("list", " ", $rest)));
|
$this->set($last[1], $this->reduce(array("list", " ", $rest)));
|
||||||
}
|
}
|
||||||
@ -746,7 +746,7 @@ class lessc {
|
|||||||
if ($suffix !== null &&
|
if ($suffix !== null &&
|
||||||
$subProp[0] == "assign" &&
|
$subProp[0] == "assign" &&
|
||||||
is_string($subProp[1]) &&
|
is_string($subProp[1]) &&
|
||||||
$subProp[1]{0} != $this->vPrefix)
|
$subProp[1][0] != $this->vPrefix)
|
||||||
{
|
{
|
||||||
$subProp[2] = array(
|
$subProp[2] = array(
|
||||||
'list', ' ',
|
'list', ' ',
|
||||||
@ -1857,7 +1857,7 @@ class lessc {
|
|||||||
$this->pushEnv();
|
$this->pushEnv();
|
||||||
$parser = new lessc_parser($this, __METHOD__);
|
$parser = new lessc_parser($this, __METHOD__);
|
||||||
foreach ($args as $name => $strValue) {
|
foreach ($args as $name => $strValue) {
|
||||||
if ($name{0} != '@') $name = '@'.$name;
|
if ($name[0] != '@') $name = '@'.$name;
|
||||||
$parser->count = 0;
|
$parser->count = 0;
|
||||||
$parser->buffer = (string)$strValue;
|
$parser->buffer = (string)$strValue;
|
||||||
if (!$parser->propertyValue($value)) {
|
if (!$parser->propertyValue($value)) {
|
||||||
@ -2516,7 +2516,7 @@ class lessc_parser {
|
|||||||
$hidden = true;
|
$hidden = true;
|
||||||
if (!isset($block->args)) {
|
if (!isset($block->args)) {
|
||||||
foreach ($block->tags as $tag) {
|
foreach ($block->tags as $tag) {
|
||||||
if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) {
|
if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) {
|
||||||
$hidden = false;
|
$hidden = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2570,7 +2570,7 @@ class lessc_parser {
|
|||||||
protected function fixTags($tags) {
|
protected function fixTags($tags) {
|
||||||
// move @ tags out of variable namespace
|
// move @ tags out of variable namespace
|
||||||
foreach ($tags as &$tag) {
|
foreach ($tags as &$tag) {
|
||||||
if ($tag{0} == $this->lessc->vPrefix)
|
if ($tag[0] == $this->lessc->vPrefix)
|
||||||
$tag[0] = $this->lessc->mPrefix;
|
$tag[0] = $this->lessc->mPrefix;
|
||||||
}
|
}
|
||||||
return $tags;
|
return $tags;
|
||||||
|
@ -120,7 +120,7 @@ class IdoResourcePage extends Form
|
|||||||
$inspection = ResourceConfigForm::inspectResource($this);
|
$inspection = ResourceConfigForm::inspectResource($this);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
if ($showLog) {
|
if ($showLog) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -94,7 +94,7 @@ class CliUtils
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function objectStateFlags($type, & $row)
|
public function objectStateFlags($type, &$row)
|
||||||
{
|
{
|
||||||
$extra = array();
|
$extra = array();
|
||||||
if ($row->{$type . '_in_downtime'}) {
|
if ($row->{$type . '_in_downtime'}) {
|
||||||
|
@ -140,7 +140,10 @@ class MonitoringWizard extends Wizard implements SetupWizard
|
|||||||
$setup->addStep(
|
$setup->addStep(
|
||||||
new BackendStep(array(
|
new BackendStep(array(
|
||||||
'backendConfig' => $pageData['setup_monitoring_backend'],
|
'backendConfig' => $pageData['setup_monitoring_backend'],
|
||||||
'resourceConfig' => array_diff_key($pageData['setup_monitoring_ido'], array('skip_validation' => null)) //TODO: Prefer a new backend once implemented.
|
'resourceConfig' => array_diff_key(
|
||||||
|
$pageData['setup_monitoring_ido'], //TODO: Prefer a new backend once implemented.
|
||||||
|
array('skip_validation' => null)
|
||||||
|
)
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ class AuthBackendPage extends Form
|
|||||||
|
|
||||||
$inspection = UserBackendConfigForm::inspectUserBackend($self);
|
$inspection = UserBackendConfigForm::inspectUserBackend($self);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -97,7 +97,7 @@ class LdapResourcePage extends Form
|
|||||||
if (isset($formData['backend_validation']) && parent::isValid($formData)) {
|
if (isset($formData['backend_validation']) && parent::isValid($formData)) {
|
||||||
$inspection = ResourceConfigForm::inspectResource($this);
|
$inspection = ResourceConfigForm::inspectResource($this);
|
||||||
if ($inspection !== null) {
|
if ($inspection !== null) {
|
||||||
$join = function ($e) use (& $join) {
|
$join = function ($e) use (&$join) {
|
||||||
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
return is_string($e) ? $e : join("\n", array_map($join, $e));
|
||||||
};
|
};
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -127,8 +127,7 @@ class ArrayToTextTableHelper
|
|||||||
$this->printHeading();
|
$this->printHeading();
|
||||||
|
|
||||||
$rc = count($this->rows);
|
$rc = count($this->rows);
|
||||||
for ($i = 0; $i < $rc;
|
for ($i = 0; $i < $rc; $i++) {
|
||||||
$i++) {
|
|
||||||
$this->printRow($i);
|
$this->printRow($i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
ICINGAWEB_HOME=${ICINGAWEB_HOME:="$(dirname "$(readlink -f "$(dirname "$0")")")"}
|
ICINGAWEB_HOME=${ICINGAWEB_HOME:="$(dirname "$(readlink -f "$(dirname "$0")")")"}
|
||||||
PHPCS_VERSION=${PHPCS_VERSION:=3.3.2}
|
PHPCS_VERSION=${PHPCS_VERSION:=3.5.3}
|
||||||
MOCKERY_VERSION=${MOCKERY_VERSION:=0.9.9}
|
MOCKERY_VERSION=${MOCKERY_VERSION:=0.9.9}
|
||||||
HAMCREST_VERSION=${HAMCREST_VERSION:=2.0.0}
|
HAMCREST_VERSION=${HAMCREST_VERSION:=2.0.0}
|
||||||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7}
|
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user