You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice: Only variables should be assigned by reference in ./include/functions_config.inc.php on line 1426.
From ChatGPT
The error occurs because PHP no longer allows assigning a reference (&) directly to the return value of a function. The specific problematic line is:
$_groups =& serendipity_db_query(...);
This is not valid in modern PHP versions because a function's return value is not considered a variable that can hold a reference.
ChatGPT want to change the function like this:
function &serendipity_getGroups($authorid, $sequence = false) {
global $serendipity;
// Funktionsrückgabewert in eine normale Variable speichern
$_groups = serendipity_db_query(
"SELECT g.id AS confkey,
g.name AS confvalue,
g.id AS id,
g.name AS name
FROM {$serendipity['dbPrefix']}authorgroups AS ag
LEFT OUTER JOIN {$serendipity['dbPrefix']}groups AS g
ON g.id = ag.groupid
WHERE ag.authorid = " . (int)$authorid,
false,
'assoc'
);
if (!is_array($_groups)) {
$groups = array();
} else {
// Referenz auf das Array setzen
$groups = $_groups;
}
if ($sequence) {
$rgroups = array();
foreach ($groups as $grouprow) {
$rgroups[] = $grouprow['confkey'];
}
} else {
// Referenz auf Gruppen setzen
$rgroups = $groups;
}
return $rgroups;
}
Didn't try it until now. Any recommendations?
The text was updated successfully, but these errors were encountered:
Another =& is on line 1120. Got a notice when I opened the static pages overview in backend.
1116 function &serendipity_getPermissions($authorid) {
1117 global $serendipity;
1118
1119 // Get group information
1120 $groups =& serendipity_db_query("SELECT ag.groupid, g.name, gc.property, gc.value
1121 FROM {$serendipity['dbPrefix']}authorgroups AS ag
1122 LEFT OUTER JOIN {$serendipity['dbPrefix']}groups AS g
1123 ON ag.groupid = g.id
1124 LEFT OUTER JOIN {$serendipity['dbPrefix']}groupconfig AS gc
1125 ON gc.id = g.id
1126 WHERE ag.authorid = " . (int)$authorid);
1127 $perm = array('membership' => array());
1128 if (is_array($groups)) {
1129 foreach($groups AS $group) {
1130 $perm['membership'][$group['groupid']] = $group['groupid'];
1131 $perm[$group['groupid']][$group['property']] = $group['value'];
1132 }
1133 }
1134 return $perm;
1135 }
Notice: Only variables should be assigned by reference in ./include/functions_config.inc.php on line 1426.
From ChatGPT
ChatGPT want to change the function like this:
Didn't try it until now. Any recommendations?
The text was updated successfully, but these errors were encountered: