diff --git a/pmcalendar.php b/pmcalendar.php index 6ee6b6f..8f71909 100644 --- a/pmcalendar.php +++ b/pmcalendar.php @@ -201,12 +201,13 @@ if ($act == 'newevent') { we('1'); } else if ($act == 'edityanqi') { $id = r('id'); - $idx = r('idx'); + $idx = (int)r('idx'); $del = r('del'); $content = stripslashes(r('content')); $dict = array(); $event = DB::getone("select yanqi_history from calendar where id={$id}"); - $yanqi_history = $event['yanqi_history']; + + $yanqi_history = json_decode($event['yanqi_history'],true); if(!$del) { $yanqi_history[$idx]['reason'] = $content; }