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

PHP 8.1 deprecated & date issue #11

Open
instantflorian opened this issue Jul 23, 2022 · 0 comments
Open

PHP 8.1 deprecated & date issue #11

instantflorian opened this issue Jul 23, 2022 · 0 comments

Comments

@instantflorian
Copy link
Contributor

modify_file.phtml / save_file.phtml:
Deprecated-Meldung wegen leerem htmlspecialchars beim WYSIWYG-Editor
Fatal Error, wenn ungültiges Release-Datum angegeben

Vorschlag:
Abfrage date_released mit input file=date und Lösch-Checkbox

<tr>
    	<td><label for="released"><?php echo $DGTEXT['THRELEASED']; ?></label>:</td>
    	<td>
    		<input type="date" name="released" id="released" value="<?php if($data->released > 1): echo date('Y-m-d', $data->released); endif; ?>" />
		<input type="checkbox" name="delete_datereleased" id="delete_datereleased" value="yes" /><label for="delete_datereleased"><?php echo $TEXT['DELETE']; ?></label>
    	</td>
 </tr>

Prüfung, ob description leer

<tr>
    	<td colspan="2">
    		<?php 
			if ($data->description != null) {
				show_wysiwyg_editor("description","description",htmlspecialchars($data->description), "100%", "400"); 
			} else {
				show_wysiwyg_editor("description","description","", "100%", "400"); 
			}
			?>
    	</td>
    </tr>

Anpassung der save_file.php

if ($released <> '') {
	$rdate = strtotime($released);	
	if ($rdate==false || isset($_POST['delete_datereleased'])  && $_POST['delete_datereleased']  == 'yes') {
		$qs = $database->query("UPDATE `".TABLE_PREFIX.$tablename."_files` SET `released` = '' WHERE `file_id` = '$file_id' AND `page_id` = '$page_id'");
	} else {
		$qs = $database->query("UPDATE `".TABLE_PREFIX.$tablename."_files` SET `released` = '$rdate' WHERE `file_id` = '$file_id' AND `page_id` = '$page_id'");
	}
}	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant