Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php8.x #28

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion html.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function elem_finalize($elem)
*/
function elem_has_class($elem, $c)
{
if (@in_array($c, $elem['class'])) {
if (is_array($elem) && is_array($elem['class']) && @in_array($c, $elem['class'])) {
return true;
} else {
return false;
Expand Down
3 changes: 0 additions & 3 deletions json.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
// break;
case 'POST':
foreach ($_POST as $key=>$val) {
if (get_magic_quotes_gpc()) {
$val = stripslashes($val);
}
$dec = @json_decode($val, true);
if ($dec === NULL) {
$err = response('Error decoding the argument '.quot($key).' => '.var_dump_inl($val), 400);
Expand Down
8 changes: 5 additions & 3 deletions module_glue.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ function render_object($args)
log_msg('debug', 'render_object: '.quot($obj['name']).' was handled by '.quot($temp[0]));
$temp = array_values($ret);
// make sure object has a tailing newline
if (0 < strlen($temp[0]) && substr($temp[0], -1) != "\n") {
if (!empty($temp[0]) && 0 < strlen($temp[0]) && substr($temp[0], -1) != "\n") {
$temp[0] .= nl();
}
body_append($temp[0]);
Expand Down Expand Up @@ -1476,8 +1476,10 @@ function upload_files($args)
if ($s === false) {
$r = invoke_hook_while('upload', false, $args);
if (count($r) == 1) {
$s = array_pop(array_values($r));
log_msg('info', 'upload_object: '.quot($fn).' was handled by '.quot(array_pop(array_keys($r))));
$tmp_vals = array_values($r);
$tmp_keys = array_keys($r);
$s = array_pop($tmp_vals);
log_msg('info', 'upload_object: '.quot($fn).' was handled by '.quot(array_pop($tmp_keys)));
}
}
// check fallback hook last
Expand Down
8 changes: 5 additions & 3 deletions module_page.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ function page_delete_page($args)
function page_has_reference($args)
{
$obj = $args['obj'];
if (array_pop(expl('.', $obj['name'])) != 'page') {
$tmp = expl('.', $obj['name']);
if (array_pop($tmp) != 'page') {
return false;
}

Expand Down Expand Up @@ -186,10 +187,11 @@ function page_render_page_early($args)
function page_serve_resource($args)
{
$obj = $args['obj'];
if (array_pop(expl('.', $obj['name'])) != 'page') {
$tmp = expl('.', $obj['name']);
if (array_pop($tmp) != 'page') {
return false;
}
$pn = get_first_item(expl('.', $obj['name']));
$pn = get_first_item($tmp);

if (!empty($obj['page-background-file'])) {
$fn = CONTENT_DIR.'/'.$pn.'/shared/'.$obj['page-background-file'];
Expand Down