4images Issues / Ausgaben > Installation, Update & Configuration

Install of 1.8 failed - undefined function safe_htmlspecialchars()

(1/1)

Ebby:
I'm trying to install a fresh copy of 1.8 on Ubuntu 16.10.

Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g
PHP Version 7.0.8-3ubuntu3
MySQL Version 5.7.16

Install Error:
PHP Fatal error: Uncaught Error: Call to undefined function safe_htmlspecialchars() in /var/www/html/4images/includes/db_myssqli.php:73
Stack trace:
#0 /var/www/html/4images/install.php(253): Db->query('CREATE TABLE ca...')
#1 {main} thrown in /var/html/4images/includes/db_mysqli.php on line 73

Stating the obvious, the safe_htmlspecialchars() function that is defined in functions.php and included by global.php is not working in the mysqli class Db.  I have no idea why it doesn't think it's defined.  PHP 7 thing with a class?

qBass17:
4images is dead...

But....

search in install.php
function addslashes_array($array) {
  foreach ($array as $key => $val) {
    $array[$key] = (is_array($val)) ? addslashes_array($val) : addslashes($val);
  }
  return $array;
}

add after

function safe_htmlspecialchars($chars) {
  // Translate all non-unicode entities
  $chars = preg_replace(
    '/&(?!(#[0-9]+|[a-z]+);)/si',
    '&',
    $chars
  );

  $chars = str_replace(">", ">",   $chars);
  $chars = str_replace("<", "&lt;",   $chars);
  $chars = str_replace('"', "&quot;", $chars);
  return $chars;
}

LG

bigwave:
Hi,

Installed 1.8 successfully with no changes.  Unfortunately some mods don't work which is to be expected.

Am hoping interest picks up by the brilliant coders who originally made it work!!!

Cheers,

Brian

nobby:
Hello,

Nothing happens here in the forum anymore, everyone has withdrawn.

nobby

bigwave:
Hello Nobby,

Please checkout Vierstra's work here:
https://www.4homepages.de/forum/index.php?topic=33101.msg168315#msg168315

This is a brilliant approach which could keep the 4images gallery system working way into the future!!!

No need to reload your images and your hits etc. persist after "sideloading" his template system.

I checked out your alternative to 4images but it looked like too much work migrating over to there - I could always move to WordPress but again, too much work, and WordPress just lacks soul.

Jump in here and I bet you're just as impressed as I am!!!

Brian

Navigation

[0] Message Index

Go to full version