berichten: lege inhoud/samenvatting afvangen (PHP 8.1 deprecations)
Een leeg bericht (create_empty_bericht) gaf base64_decode(null); de deprecation kwam lokaal voor de JSON van getAdminBerichten, waardoor 'nieuw bericht' vastliep. saveBericht vangt lege velden ook af. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,7 +124,7 @@ class Berichten extends MY_Controller {
|
||||
foreach ( $berichten ? $berichten : [] as $bericht )
|
||||
{
|
||||
$bericht->datum = mysql2date( $bericht->startdatum );
|
||||
$bericht->inhoud = nl2br( base64_decode( $bericht->inhoud ) );
|
||||
$bericht->inhoud = nl2br( base64_decode( $bericht->inhoud ?? '' ) );
|
||||
}
|
||||
return $berichten;
|
||||
}
|
||||
@@ -239,9 +239,9 @@ class Berichten extends MY_Controller {
|
||||
return;
|
||||
}
|
||||
$berichtID = $this->uri->segment( 4 );
|
||||
$datum = str_replace( '/', '-', $this->input->post( 'datum' ));
|
||||
$samenvatting = $this->input->post( 'samenvatting' );
|
||||
$inhoud = $this->input->post( 'inhoud' );
|
||||
$datum = str_replace( '/', '-', $this->input->post( 'datum' ) ?? '');
|
||||
$samenvatting = $this->input->post( 'samenvatting' ) ?? '';
|
||||
$inhoud = $this->input->post( 'inhoud' ) ?? '';
|
||||
$samenvatting = stripslashes( implode( "", explode( "\\", $samenvatting )));
|
||||
if (! $samenvatting || ! strlen( $samenvatting )> 3){
|
||||
$this->deletebericht($berichtID);
|
||||
|
||||
Reference in New Issue
Block a user