Skip to content

Commit

Permalink
Merge pull request #14 from InternationalRoadTransportUnion/master
Browse files Browse the repository at this point in the history
PHP 7 compatibility updates
  • Loading branch information
lux committed May 3, 2018
2 parents 3fa2cb3 + 9990952 commit d7f590c
Show file tree
Hide file tree
Showing 69 changed files with 667 additions and 227 deletions.
4 changes: 4 additions & 0 deletions inc/app/cms/boxes/admintools/uninstalled/index.php
@@ -1,5 +1,9 @@
<?php

// As http://www.sitellite.org/apps.xml does not return expected application list
// this box is ignored.
return;

$data = @join ('', @file ('http://www.sitellite.org/apps.xml'));
if (! $data) {
return;
Expand Down
7 changes: 5 additions & 2 deletions inc/app/cms/boxes/delete/index.php
Expand Up @@ -100,7 +100,10 @@
}
}
// index page cannot be deleted
if ((count ($failed) > 0) || (in_array('index',$id))) {
if ((count ($failed) > 0) ||
(is_array ($id) && in_array ('index', $id)) ||
(! is_array ($id) && 'index' === $id))
{
page_title (intl_get ('An Error Occurred'));
echo '<p>' . $rex->error . '</p>';
echo '<p>' . intl_get ('The following items were not deleted') . ':</p>';
Expand All @@ -124,7 +127,7 @@

session_set ('sitellite_alert', intl_get ('The items have been deleted.'));

if (! empty ($parameters['_return']) && $parameters['_return'] != site_prefix () . '/index/' . $parameters['_key'][0] && ! strpos ($parameters['_return'], $parameters['_key'][0])) {
if (! empty ($parameters['_return']) && $parameters['_return'] != site_prefix () . '/index/' . $parameters['_key'][0] && ! ('' !== $parameters['_key'][0] && strpos ($parameters['_return'], $parameters['_key'][0]))) {
header ('Location: ' . $parameters['_return']);
exit;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/app/cms/boxes/services/webhooks/index.php
Expand Up @@ -56,7 +56,7 @@
foreach (explode ("\n", appconf ('cms_webhooks')) as $url) {
$url = trim ($url);
if (! empty ($url)) {
$req =& new HTTP_request ($url);
$req = new HTTP_request ($url);
$req->setMethod ('POST');
$req->addPostData ('event', $parameters['transition']);
$req->addPostData ('summary', $parameters['message']);
Expand Down
2 changes: 1 addition & 1 deletion inc/app/cms/forms/add/sitellite_filesystem/index.php
Expand Up @@ -116,7 +116,7 @@ function cms_cancel_action (f) {
$this->widgets['submit_button']->buttons[2]->extra = 'onclick="return cms_cancel (this.form)"';
}

function show () {
function show ($template = '') {
return loader_box ('cms/user/preferences/level') . parent::show ();
}

Expand Down
2 changes: 1 addition & 1 deletion inc/app/cms/forms/edit/sitellite_filesystem/index.php
Expand Up @@ -180,7 +180,7 @@ function cms_cancel_action (f) {
}*/
}

function show () {
function show ($template = '') {
return loader_box ('cms/user/preferences/level') . parent::show ();
}

Expand Down
6 changes: 6 additions & 0 deletions inc/app/multilingual/boxes/index/index.php
Expand Up @@ -104,8 +104,14 @@
foreach ($list as $item) {
$parameters['list'][$item->{$r->key}] = $tr->get ($item->{$r->key});
if ($parameters['list'][$item->{$r->key}]->collection) {
if (! is_object ($parameters['list'][$item->{$r->key}])) {
$parameters['list'][$item->{$r->key}] = new stdClass;
}
$parameters['list'][$item->{$r->key}]->title = multilingual_filter_title ($parameters['list'][$item->{$r->key}]->collection, $item->{$r->key});
} else {
if (! is_object ($parameters['list'][$item->{$r->key}])) {
$parameters['list'][$item->{$r->key}] = new stdClass;
}
$parameters['list'][$item->{$r->key}]->title = multilingual_filter_title ($cgi->_collection, $item->{$r->key});
}
}
Expand Down
18 changes: 9 additions & 9 deletions inc/app/myadm/docs/fr/001-about-myadm.html
@@ -1,12 +1,12 @@
<h1>Au sujet Du Gestionnaire De Base de données</h1>
<h1>Au sujet Du Gestionnaire De Base de données</h1>

<p>Le gestionnaire de base de données est une couche d'accès direct à
la base de données fondamentale de MySQL sous Sitellite.&nbsp; Il vient
préinstallé, et est très maniable pour des utilisateurs de puissance et
les lotisseurs en faisant de bas niveau rapide et sale édite.<br />
<p>Le gestionnaire de base de données est une couche d'accès direct à
la base de données fondamentale de MySQL sous Sitellite.&nbsp; Il vient
préinstallé, et est très maniable pour des utilisateurs de puissance et
les lotisseurs en faisant de bas niveau rapide et sale édite.<br />
</p>
<p>La
partie la plus maniable du gestionnaire de base de données est
probablement la coquille de SQL, qui vous permet d'exécuter des
questions arbitraires de SQL contre la base de données, qui est grande
pour examiner hors du nouveaux code et idées.</p>
partie la plus maniable du gestionnaire de base de données est
probablement la coquille de SQL, qui vous permet d'exécuter des
questions arbitraires de SQL contre la base de données, qui est grande
pour examiner hors du nouveaux code et idées.</p>
2 changes: 1 addition & 1 deletion inc/app/myadm/docs/languages.php
Expand Up @@ -10,7 +10,7 @@
en = English
fr = "Français"
fr = "Français"
;
; THE END
Expand Down
2 changes: 1 addition & 1 deletion inc/app/siteblog/forms/edit/settings.php
Expand Up @@ -73,7 +73,7 @@
[created]
type = calendar
alt = Posted On
alt = "Posted On"
setValue = "eval: date ('Y-m-d H:i:s')"
nullable = false
showsTime = true
Expand Down
Expand Up @@ -78,7 +78,7 @@ function update(&$subject, $event, $data = null)
} else {
$this->setTarget($this->_target);
}
$this->_bar =& new Console_ProgressBar(
$this->_bar = new Console_ProgressBar(
'* ' . $this->_target . ' %fraction% KB [%bar%] %percent%', '=>', '-',
79, (isset($data['content-length'])? round($data['content-length'] / 1024): 100)
);
Expand All @@ -105,9 +105,9 @@ function update(&$subject, $event, $data = null)
// to be able to see the progress bar
$url = 'http://pear.php.net/get/HTML_QuickForm-stable';

$req =& new HTTP_Request($url);
$req = new HTTP_Request($url);

$download =& new HTTP_Request_DownloadListener();
$download = new HTTP_Request_DownloadListener();
$req->attach($download);
$req->sendRequest(false);
?>
22 changes: 11 additions & 11 deletions inc/app/siteconnector/lib/Ext/PEAR/SOAP/Base.php
Expand Up @@ -191,7 +191,7 @@ function &_raiseSoapFault($str, $detail = '', $actorURI = '', $code = null, $mod
$fault =& $str;
} else {
if (!$code) $code = $is_instance?$this->_myfaultcode:'Client';
$fault =& new SOAP_Fault($str,
$fault = new SOAP_Fault($str,
$code,
$actorURI,
$detail,
Expand Down Expand Up @@ -454,7 +454,7 @@ function _serializeValue(&$value, $name = '', $type = false, $elNamespace = NULL

$array_type = $array_type_prefix = '';
if ($numtypes != 1) {
$arrayTypeQName =& new QName($arrayType);
$arrayTypeQName = new QName($arrayType);
$arrayType = $arrayTypeQName->name;
$array_types = array();
$array_val = NULL;
Expand Down Expand Up @@ -540,8 +540,8 @@ function _serializeValue(&$value, $name = '', $type = false, $elNamespace = NULL
$xml_attr = '';
if (count($attributes) > 0) {
foreach ($attributes as $k => $v) {
$kqn =& new QName($k);
$vqn =& new QName($v);
$kqn = new QName($k);
$vqn = new QName($v);
$xml_attr .= ' '.$kqn->fqn().'="'.$vqn->fqn().'"';
}
}
Expand Down Expand Up @@ -637,7 +637,7 @@ function _getType(&$value) {
if ($this->_isBase64($value)) {
$type = 'base64Binary';
} else {
$dt =& new SOAP_Type_dateTime($value);
$dt = new SOAP_Type_dateTime($value);
if ($dt->toUnixtime() != -1) {
$type = 'dateTime';
#$value = $dt->toSOAP();
Expand Down Expand Up @@ -751,7 +751,7 @@ function &_decode(&$soapval)
if ($t && class_exists($t)) $classname = $t;
}
}
$return =& new $classname;
$return = new $classname;
} else {
$return = array();
}
Expand Down Expand Up @@ -893,7 +893,7 @@ function &_makeMimeMessage(&$xml, $encoding = SOAP_DEFAULT_ENCODING)
// see http://www.w3.org/TR/SOAP-attachments
// now we have to mime encode the message
$params = array('content_type' => 'multipart/related; type=text/xml');
$msg =& new Mail_mimePart('', $params);
$msg = new Mail_mimePart('', $params);
// add the xml part
$params['content_type'] = 'text/xml';
$params['charset'] = $encoding;
Expand Down Expand Up @@ -921,7 +921,7 @@ function &_makeDIMEMessage(&$xml)
// encode any attachments
// see http://search.ietf.org/internet-drafts/draft-nielsen-dime-soap-00.txt
// now we have to DIME encode the message
$dime =& new Net_DIME_Message();
$dime = new Net_DIME_Message();
$msg =& $dime->encodeData($xml,SOAP_ENVELOP,NULL,NET_DIME_TYPE_URI);

// add the attachements
Expand All @@ -947,7 +947,7 @@ function _decodeMimeMessage(&$data, &$headers, &$attachments)
$params['decode_headers'] = TRUE;

// XXX lame thing to have to do for decoding
$decoder =& new Mail_mimeDecode($data);
$decoder = new Mail_mimeDecode($data);
$structure = $decoder->decode($params);

if (isset($structure->body)) {
Expand Down Expand Up @@ -989,7 +989,7 @@ function _decodeDIMEMessage(&$data, &$headers, &$attachments)

// XXX this SHOULD be moved to the transport layer, e.g. PHP itself
// should handle parsing DIME ;)
$dime =& new Net_DIME_Message();
$dime = new Net_DIME_Message();
$err = $dime->decodeData($data);
if ( PEAR::isError($err) ) {
$this->_raiseSoapFault('Failed to decode the DIME message!','','','Server');
Expand All @@ -1013,7 +1013,7 @@ function _decodeDIMEMessage(&$data, &$headers, &$attachments)

function __set_type_translation($type, $class=NULL)
{
$tq =& new QName($type);
$tq = new QName($type);
if (!$class) {
$class = $tq->name;
}
Expand Down
24 changes: 12 additions & 12 deletions inc/app/siteconnector/lib/Ext/PEAR/SOAP/Client.php
Expand Up @@ -146,7 +146,7 @@ function SOAP_Client($endpoint, $wsdl = false, $portName = false, $proxy_params=
if ($wsdl) {
$this->__endpointType = 'wsdl';
// instantiate wsdl class
$this->_wsdl =& new SOAP_WSDL($this->_endpoint, $this->__proxy_params);
$this->_wsdl = new SOAP_WSDL($this->_endpoint, $this->__proxy_params);
if ($this->_wsdl->fault) {
$this->_raiseSoapFault($this->_wsdl->fault);
}
Expand Down Expand Up @@ -197,7 +197,7 @@ function addHeader(&$soap_value)
$this->headersOut[] =& $soap_value;
} else if (gettype($soap_value) == 'array') {
// name, value, namespace, mustunderstand, actor
$this->headersOut[] =& new SOAP_Header($soap_value[0], NULL, $soap_value[1], $soap_value[2], $soap_value[3]);;
$this->headersOut[] = new SOAP_Header($soap_value[0], NULL, $soap_value[1], $soap_value[2], $soap_value[3]);;
} else {
$this->_raiseSoapFault("Don't understand the header info you provided. Must be array or SOAP_Header.");
}
Expand Down Expand Up @@ -434,7 +434,7 @@ function &__generate($method, &$params, $namespace = false, $soapAction = false)
if (gettype($nparams[$name]) != 'object' ||
!is_a($nparams[$name],'soap_value')) {
// type is a qname likely, split it apart, and get the type namespace from wsdl
$qname =& new QName($part['type']);
$qname = new QName($part['type']);
if ($qname->ns)
$type_namespace = $this->_wsdl->namespaces[$qname->ns];
else if (isset($part['namespace']))
Expand All @@ -445,7 +445,7 @@ function &__generate($method, &$params, $namespace = false, $soapAction = false)
$type = $qname->name;
$pqname = $name;
if ($xmlns) $pqname = '{'.$xmlns.'}'.$name;
$nparams[$name] =& new SOAP_Value($pqname, $qname->fqn(), $nparams[$name],$attrs);
$nparams[$name] = new SOAP_Value($pqname, $qname->fqn(), $nparams[$name],$attrs);
} else {
// wsdl fixups to the soap value
}
Expand All @@ -465,30 +465,30 @@ function &__generate($method, &$params, $namespace = false, $soapAction = false)
if (!isset($this->__options['style']) || $this->__options['style'] == 'rpc') {
$this->__options['style'] = 'rpc';
$this->docparams = true;
$mqname =& new QName($method, $namespace);
$methodValue =& new SOAP_Value($mqname->fqn(), 'Struct', $params);
$mqname = new QName($method, $namespace);
$methodValue = new SOAP_Value($mqname->fqn(), 'Struct', $params);
$soap_msg =& $this->_makeEnvelope($methodValue, $this->headersOut, $this->_encoding,$this->__options);
} else {
if (!$params) {
$mqname =& new QName($method, $namespace);
$mqname = new QName($method, $namespace);
$mynull = NULL;
$params =& new SOAP_Value($mqname->fqn(), 'Struct', $mynull);
$params = new SOAP_Value($mqname->fqn(), 'Struct', $mynull);
} elseif ($this->__options['input'] == 'parse') {
if (is_array($params)) {
$nparams = array();
$keys = array_keys($params);
foreach ($keys as $k) {
if (gettype($params[$k]) != 'object') {
$nparams[] =& new SOAP_Value($k, false, $params[$k]);
$nparams[] = new SOAP_Value($k, false, $params[$k]);
} else {
$nparams[] =& $params[$k];
}
}
$params =& $nparams;
}
if ($this->__options['parameters']) {
$mqname =& new QName($method, $namespace);
$params =& new SOAP_Value($mqname->fqn(), 'Struct', $params);
$mqname = new QName($method, $namespace);
$params = new SOAP_Value($mqname->fqn(), 'Struct', $params);
}
}
$soap_msg =& $this->_makeEnvelope($params, $this->headersOut, $this->_encoding,$this->__options);
Expand Down Expand Up @@ -534,7 +534,7 @@ function &__generate($method, &$params, $namespace = false, $soapAction = false)
function &__parse(&$response, $encoding, &$attachments)
{
// parse the response
$response =& new SOAP_Parser($response, $encoding, $attachments);
$response = new SOAP_Parser($response, $encoding, $attachments);
if ($response->fault) {
return $this->_raiseSoapFault($response->fault);
}
Expand Down
16 changes: 8 additions & 8 deletions inc/app/siteconnector/lib/Ext/PEAR/SOAP/Fault.php
Expand Up @@ -60,18 +60,18 @@ function SOAP_Fault($faultstring = 'unknown error', $faultcode = 'Client', $faul
*/
function message()
{
$msg =& new SOAP_Base();
$msg = new SOAP_Base();
$params = array();
$params[] =& new SOAP_Value('faultcode', 'QName', 'SOAP-ENV:'.$this->code);
$params[] =& new SOAP_Value('faultstring', 'string', $this->message);
$params[] =& new SOAP_Value('faultactor', 'anyURI', $this->error_message_prefix);
$params[] = new SOAP_Value('faultcode', 'QName', 'SOAP-ENV:'.$this->code);
$params[] = new SOAP_Value('faultstring', 'string', $this->message);
$params[] = new SOAP_Value('faultactor', 'anyURI', $this->error_message_prefix);
if (isset($this->backtrace)) {
$params[] =& new SOAP_Value('detail', 'string', $this->backtrace);
$params[] = new SOAP_Value('detail', 'string', $this->backtrace);
} else {
$params[] =& new SOAP_Value('detail', 'string', $this->userinfo);
$params[] = new SOAP_Value('detail', 'string', $this->userinfo);
}

$methodValue =& new SOAP_Value('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
$methodValue = new SOAP_Value('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
$headers = NULL;
return $msg->_makeEnvelope($methodValue, $headers);
}
Expand All @@ -88,7 +88,7 @@ function getFault()
{
global $SOAP_OBJECT_STRUCT;
if ($SOAP_OBJECT_STRUCT) {
$fault =& new stdClass();
$fault = new stdClass();
$fault->faultcode = $this->code;
$fault->faultstring = $this->message;
$fault->faultactor = $this->error_message_prefix;
Expand Down

0 comments on commit d7f590c

Please sign in to comment.