Skip to content

Commit

Permalink
PHP7: Applications: Code updated to avoid PHP7 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
olegiv committed Mar 21, 2018
1 parent d24a72e commit 03e45d2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
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/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
2 changes: 2 additions & 0 deletions inc/app/sitesearch/boxes/stats/index/index.php
Expand Up @@ -42,6 +42,8 @@

// indexing info

$data = new stdClass;

/*
$data = $logger->getCurrentIndex ();
if (! $data) {
Expand Down
2 changes: 1 addition & 1 deletion inc/app/sitewiki/forms/edit/index.php
Expand Up @@ -75,7 +75,7 @@ function SitewikiEditForm () {
}
}

function show () {
function show ($template = '') {
if (! $this->editable) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/app/xed/boxes/editor/index.php
Expand Up @@ -20,7 +20,7 @@ function WysiwygEditorForm () {
$b->extra = 'onclick="return xed_window_cancel (this.form)"';
}

function show () {
function show ($template = '') {
echo '<script language="javascript" type="text/javascript">
function xed_window_submit (f) {
opener.document.forms[f.elements["form_name"].value].elements[f.elements["field_name"].value].value = xed_get_source ("body");
Expand Down

0 comments on commit 03e45d2

Please sign in to comment.