hyldig Posted August 19, 2015 Share Posted August 19, 2015 Hi. I am not that familiar with PHP, but I have managed to integrate a small php cms-system. However certainly I have this huge problem: Whenever I try to login to the system, I get the following message: "Warning: array_map(): Argument #2 should be an array in settings.php on line 34 Vedligeholdelse filmoversigt - login" Settings.php looks like this - the bold line being line 34: ------------------- session_start();// Hangle Magic Quotes for REQUEST & COOKIE. POST & GET are handled elsewhere.if (!get_magic_quotes_gpc()) slashString_gpc(); function slashString($v) { return is_array($v) ? array_map('slashString', $v) : addslashes($v); } function unSlashString($v) { return is_array($v) ? array_map('unSlashString', $v) : stripslashes($v); } function slashString_gpc() { foreach (array('REQUEST', 'COOKIE') as $gpc) $GLOBALS["_$gpc"] = array_map('slashString', $GLOBALS["_$gpc"]); }db_connect();$sql = "SELECT * FROM " . PDB_PREFIX . "configuration";$result = db_query($sql);while($row = db_fetch_array($result)){ define($row['config_key'], $row['config_value']);} ------------------- Can anyone og you clerver guys explain what the problem is, and what to do to solve it? Best regards Hyldig Quote Link to comment Share on other sites More sharing options...
requinix Posted August 19, 2015 Share Posted August 19, 2015 First, what version of PHP are you using? If it's not at least 5.4 then can you upgrade to at least 5.6? Quote Link to comment Share on other sites More sharing options...
gizmola Posted August 20, 2015 Share Posted August 20, 2015 My goodness that is some really old code. What CMS are we talking here? function slashString_gpc() { foreach (array('REQUEST', 'COOKIE') as $gpc) $GLOBALS["_$gpc"] = array_map('slashString', $GLOBALS["_$gpc"]); } Inside there looks like it should be: function slashString_gpc() { foreach (array('REQUEST', 'COOKIE') as $gpc) $GLOBALS[$gpc] = array_map('slashString', $GLOBALS[$gpc]); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.