Dotclear

Changeset 2596:62f32566c15f


Ignore:
Timestamp:
12/02/13 15:27:54 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Check all required fields in blog creation, removes unnecessary notice, fixes #1616

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/blog.php

    r2566 r2596  
    2121 
    2222# Create a blog 
    23 if (!isset($_POST['id']) && !empty($_POST['blog_id'])) 
     23if (!isset($_POST['id']) && (isset($_POST['create']))) 
    2424{ 
    2525     $cur = $core->con->openCursor($core->prefix.'blog'); 
     
    8484     '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '; 
    8585 
    86      if ($blog_id) { 
    87           echo 
    88           '<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>'; 
    89      } 
    90  
    9186     echo 
    9287     '<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '. 
     
    9994     form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'. 
    10095 
    101      '<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'. 
     96     '<p><input type="submit" accesskey="s" name="create" value="'.__('Create').'" /></p>'. 
    10297     '</form>'; 
    10398 
  • inc/core/class.dc.core.php

    r2595 r2596  
    989989     private function getBlogCursor($cur) 
    990990     { 
    991           if ($cur->blog_id !== null 
    992           && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) { 
     991          if (($cur->blog_id !== null 
     992               && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) || 
     993               (!$cur->blog_id)) { 
    993994               throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 
    994995          } 
    995996 
    996           if ($cur->blog_name !== null && $cur->blog_name == '') { 
     997          if (($cur->blog_name !== null && $cur->blog_name == '') || 
     998               (!$cur->blog_name)) { 
    997999               throw new Exception(__('No blog name')); 
    9981000          } 
    9991001 
    1000           if ($cur->blog_url !== null && $cur->blog_url == '') { 
     1002          if (($cur->blog_url !== null && $cur->blog_url == '') || 
     1003               (!$cur->blog_url)) { 
    10011004               throw new Exception(__('No blog URL')); 
    10021005          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map