Changeset 957:3560dcbe4d0c for admin/post.php
- Timestamp:
- 11/04/12 12:06:02 (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r933 r957 88 88 unset($rs); 89 89 90 # Validation flag 91 $bad_dt = false; 90 92 91 93 # Get entry informations … … 167 169 $post_dt = ''; 168 170 } else { 169 $post_dt = strtotime($_POST['post_dt']); 170 $post_dt = date('Y-m-d H:i',$post_dt); 171 try 172 { 173 $post_dt = strtotime($_POST['post_dt']); 174 if ($post_dt == false || $post_dt == -1) { 175 $bad_dt = true; 176 throw new Exception(__('Invalid publication date')); 177 } 178 $post_dt = date('Y-m-d H:i',$post_dt); 179 } 180 catch (Exception $e) 181 { 182 $core->error->add($e->getMessage()); 183 } 171 184 } 172 185 … … 190 203 191 204 # Create or update post 192 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post )205 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 193 206 { 194 207 $cur = $core->con->openCursor($core->prefix.'post'); … … 427 440 428 441 '<p><label for="post_dt">'.__('Published on:'). 429 form::field('post_dt',16,16,$post_dt ).442 form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 430 443 '</label></p>'. 431 444
Note: See TracChangeset
for help on using the changeset viewer.