Get_magic_quotes_gpc in PHP8.
Solved
Max747
Posted messages
264
Status
Member
-
Max747 Posted messages 264 Status Member -
Max747 Posted messages 264 Status Member -
Hello,
An error message appears as below:
With this script:
I think I found the solution by modifying line 23 as below:
Is this modification correct?
Otherwise, what should be done for it to be correct?
Note that I have no more error message.
Thank you.
Configuration: Windows / Firefox 93.0
An error message appears as below:
With this script:
<?php /* General functions */ function multi_lignes($ch) { // Replaces line breaks in a string with <br />. return str_replace(array("\n"), '<br />', $ch); } function motif($fichier_interface, $motifs, $valeurs) { // Opens a file from the interface folder and changes the patterns passed as arguments to their value. $fnom = 'interface/'.$fichier_interface.'.html'; $f = fopen($fnom, 'rb'); $html = fread($f, filesize ($fnom)); $html = str_replace($motifs, $valeurs, $html); fclose($f); return $html; } function encode($ch) { // This function is applied to strings that will be used with SimpleXML. if (get_magic_quotes_gpc()) $ch = stripslashes($ch); return htmlspecialchars($ch, ENT_COMPAT); } function det_img($qcm, $num_quest) { // Deletes, if it exists, the image linked to a question of a QCM. // The image to delete is qcm/$qcm/imgq_$numquest.*** $dossier_qcm = opendir('qcm/'.$qcm); while (( ($fichier = readdir($dossier_qcm)) ) != false) { if (substr($fichier, 0, strlen('imgq_'.$num_quest)) == 'imgq_'.$num_quest) { unlink('qcm/'.$qcm.'/'.$fichier); break; } } closedir($dossier_qcm); } function XMLpropre($xml) { // Removes line breaks and spaces from an XML document so that it can be read correctly by javascript. return preg_replace('/>\n*\s*</', '><', $xml); } ?> I think I found the solution by modifying line 23 as below:
<?php /* General functions */ function multi_lignes($ch) { // Replaces line breaks in a string with <br />. return str_replace(array("\n"), '<br />', $ch); } function motif($fichier_interface, $motifs, $valeurs) { // Opens a file from the interface folder and changes the patterns passed as arguments to their value. $fnom = 'interface/'.$fichier_interface.'.html'; $f = fopen($fnom, 'rb'); $html = fread($f, filesize ($fnom)); $html = str_replace($motifs, $valeurs, $html); fclose($f); return $html; } function encode($ch) { // This function is applied to strings that will be used with SimpleXML. $ch = stripslashes($ch); return htmlspecialchars($ch, ENT_COMPAT); } function det_img($qcm, $num_quest) { // Deletes, if it exists, the image linked to a question of a QCM. // The image to delete is qcm/$qcm/imgq_$numquest.*** $dossier_qcm = opendir('qcm/'.$qcm); while (( ($fichier = readdir($dossier_qcm)) ) != false) { if (substr($fichier, 0, strlen('imgq_'.$num_quest)) == 'imgq_'.$num_quest) { unlink('qcm/'.$qcm.'/'.$fichier); break; } } closedir($dossier_qcm); } function XMLpropre($xml) { // Removes line breaks and spaces from an XML document so that it can be read correctly by javascript. return preg_replace('/>\n*\s*</', '><', $xml); } ?> Is this modification correct?
Otherwise, what should be done for it to be correct?
Note that I have no more error message.
Thank you.
Configuration: Windows / Firefox 93.0