Changes in [1535:5878d21ef9b9:1536:31b45740bf86]
- Files:
-
- 3 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
.hgsubstate
r1321 r1485 1 106856ffd55945d2be60e5f623c587c3fb356447inc/libs/clearbricks1 716e99c54652d08c2e4395d5179e817e0f98182d inc/libs/clearbricks -
.hgtags
r1219 r1351 13 13 514d5121a12586b7ff320924d44028b677a01020 2.4.4 14 14 baf879af43beea9764d920c2facd7226e90c5cf3 2.5.1 15 cfad9f2a9f6ec03206ff5db91985208e833a7528 2.5.2 -
CHANGELOG
r1216 r1350 1 Dotclear 2.5.2 - 2013-08-14 2 =========================================================== 3 * Security fix: Fixed potential XSS 4 * Bugfix: l10n Clearbricks library 5 * <tpl:LoopPosition> now works <tpl:Attachments> 6 * Dotclear update check may now be forced (ignoring cache) 7 * Enforce integration of daInstaller plugin 8 * Tags link button is now available on page editor 9 * Default cache age is now 1 week instead of 2 hours 10 * Quick entry dashboard module is not activated by default on new installation 11 * New template {{tpl:BlogParentThemeURL}} (return URL of parent theme of blog's theme if any, URL of blog's theme otherwise) 12 * Fix post comments number on comments deletion 13 * Fix order of backup files 14 * Minor enhancements 15 * Various bug fixes 16 * Various cosmetic adjustments 17 1 18 Dotclear 2.5.1 - 2013-07-20 2 19 =========================================================== -
Makefile
r1046 r1451 69 69 find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \; 70 70 find $(DC)/admin/js/jsToolBar/*.js -exec ./build-tools/min-js.php \{\} \; 71 find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \; 71 72 find $(DC)/admin/js/tool-man/*.js -exec ./build-tools/min-js.php \{\} \; 72 73 find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; -
admin/categories.php
r1179 r1421 31 31 $mov_cat = $mov_cat ? $mov_cat : null; 32 32 if ($mov_cat !== null) { 33 $c = $core->blog->getCategory((integer) $_POST[' del_cat']);33 $c = $core->blog->getCategory((integer) $_POST['mov_cat']); 34 34 if ($c->isEmpty()) { 35 35 throw new Exception(__('This category does not exist.')); … … 141 141 echo '</div>'; 142 142 143 $categories_combo = array(); 144 if (!$rs->isEmpty()) 145 { 146 while ($rs->fetch()) { 147 $catparents_combo[] = $categories_combo[] = new formSelectOption( 148 str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• ').html::escapeHTML($rs->cat_title), 149 $rs->cat_id 150 ); 151 } 152 } 153 143 154 echo '<div class="col">'. 144 155 … … 146 157 '<fieldset><legend>'.__('Add a new category').'</legend>'. 147 158 '<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '. 148 form::field('cat_title',30,255 ).'</label></p>'.159 form::field('cat_title',30,255,'','maximal').'</label></p>'. 149 160 '<p><label for="new_cat_parent">'.__('Parent:').' '. 150 '<select id="new_cat_parent" name="new_cat_parent">'. 151 '<option value="0">'.__('Top level').'</option>'; 152 while ($rs->fetch()) { 153 echo '<option value="'.$rs->cat_id.'">'. 154 str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• '). 155 html::escapeHTML($rs->cat_title).'</option>'; 156 } 157 echo 158 '</select></label></p>'. 161 form::combo('new_cat_parent',array_merge(array(__('(No cat)') => 0),$categories_combo),'','maximal'). 162 '</label></p>'. 159 163 '<p><input type="submit" value="'.__('Create').'" /></p>'. 160 164 $core->formNonce(). … … 164 168 if (!$rs->isEmpty()) 165 169 { 166 $cats = array();167 $dest = array(' ' => '');168 $l = $rs->level;169 $full_name = array($rs->cat_title);170 while ($rs->fetch())171 {172 if ($rs->level < $l) {173 $full_name = array();174 } elseif ($rs->level == $l) {175 array_pop($full_name);176 }177 $full_name[] = html::escapeHTML($rs->cat_title);178 179 $cats[implode(' / ',$full_name)] = $rs->cat_id;180 $dest[implode(' / ',$full_name)] = $rs->cat_id;181 182 $l = $rs->level;183 }184 185 170 echo 186 171 '<form action="categories.php" method="post" id="delete-category">'. 187 172 '<fieldset><legend>'.__('Remove a category').'</legend>'. 188 173 '<p><label for="del_cat">'.__('Choose a category to remove:').' '. 189 form::combo('del_cat',$cat s).'</label></p> '.174 form::combo('del_cat',$categories_combo,'','maximal').'</label></p> '. 190 175 '<p><label for="mov_cat">'.__('And choose the category which will receive its entries:').' '. 191 form::combo('mov_cat', $dest).'</label></p> '.176 form::combo('mov_cat',array_merge(array(__('(No cat)') => ''),$categories_combo),'','maximal').'</label></p> '. 192 177 '<p><input type="submit" value="'.__('Delete').'" class="delete" /></p>'. 193 178 $core->formNonce(). -
admin/index.php
r1535 r1536 326 326 if ($core->auth->check('usage,contentadmin',$core->blog->id)) 327 327 { 328 $categories_combo = array(' ' => ''); 328 # Getting categories 329 $categories_combo = array(__('(No cat)') => ''); 329 330 try { 330 331 $categories = $core->blog->getCategories(array('post_type'=>'post')); 331 while ($categories->fetch()) { 332 $categories_combo[] = new formSelectOption( 333 str_repeat(' ',$categories->level-1). 334 ($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 335 $categories->cat_id 336 ); 332 if (!$categories->isEmpty()) { 333 while ($categories->fetch()) { 334 $catparents_combo[] = $categories_combo[] = new formSelectOption( 335 str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 336 $categories->cat_id 337 ); 338 } 337 339 } 338 340 } catch (Exception $e) { } 339 341 340 342 echo 341 343 '<div id="quick">'. … … 352 354 '<p><label for="cat_id" class="classic">'.__('Category:').' '. 353 355 form::combo('cat_id',$categories_combo).'</label></p>'. 356 ($core->auth->check('categories', $core->blog->id) 357 ? '<div>'. 358 '<p id="new_cat">'.__('Add a new category').'</p>'. 359 '<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'. 360 '<p><label for="new_cat_title">'.__('Title:').' '. 361 form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 362 '<p><label for="new_cat_parent">'.__('Parent:').' '. 363 form::combo('new_cat_parent',$categories_combo,'','maximal'). 364 '</label></p>'. 365 '</div>' 366 : ''). 354 367 '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 355 368 ($core->auth->check('publish',$core->blog->id) -
admin/js/_index.js
r1140 r1418 61 61 }); 62 62 } 63 $('#new_cat').toggleWithLegend( 64 $('#new_cat').parent().children().not('#new_cat'), 65 {} // no cookie on new category as we don't use this every day 66 ); 63 67 } 64 68 -
admin/js/_post.js
r1256 r1417 123 123 hide: $('#post_notes').val() == '' 124 124 }); 125 $('#new_cat').toggleWithLegend( 126 $('#new_cat').parent().children().not('#new_cat'), 127 {} // no cookie on new category as we don't use this every day 128 ); 125 129 $('#post_lang').parent().toggleWithLegend($('#post_lang'),{ 126 130 cookie: 'dcx_post_lang' -
admin/js/_posts_actions.js
r1035 r1419 6 6 matchContains: true 7 7 }); 8 $('#new_cat').toggleWithLegend( 9 $('#new_cat').parent().children().not('#new_cat'), 10 {} // no cookie on new category as we don't use this every day 11 ); 8 12 }); -
admin/js/_users_actions.js
r935 r1449 1 1 jQuery.fn.updatePermissionsForm = function() { 2 2 return this.each(function() { 3 3 4 var perms = {}; 4 5 var re = /^perm\[(.+?)\]\[(.+?)\]$/; … … 12 13 continue; 13 14 } 15 var prop; 14 16 prop = e.name.match(re); 15 17 if (!prop) { … … 20 22 } 21 23 perms[prop[1]][prop[2]] = e; 24 25 // select related permissions for admin 26 if (prop[2] == 'admin') { 27 if (e.checked) { 28 admin(e,perms,re); 29 } 30 $(e).click(function(){ 31 admin(this,perms,re); 32 }); 33 // select related permissions for content admin 34 } else if (prop[2] == 'contentadmin') { 35 if (e.checked) { 36 contentadmin(e,perms,re); 37 } 38 $(e).click(function(){ 39 contentadmin(this,perms,re); 40 }); 41 // select related permissions for media admin 42 } else if (prop[2] == 'media_admin') { 43 if (e.checked) { 44 mediaadmin(e,perms,re); 45 } 46 $(e).click(function(){ 47 mediaadmin(this,perms,re); 48 }); 49 } 22 50 } 23 51 24 // Update elements status 25 var E; 26 for (blog in perms) { 27 for (perm in perms[blog]) { 28 E = perms[blog][perm]; 29 E.onclick = function() {}; 30 31 if (perm == 'admin' && !E.disabled) { 32 perms[blog]['usage'].disabled = E.checked; 33 perms[blog]['publish'].disabled = E.checked; 34 perms[blog]['delete'].disabled = E.checked; 35 perms[blog]['contentadmin'].disabled = E.checked; 36 perms[blog]['categories'].disabled = E.checked; 37 perms[blog]['media'].disabled = E.checked; 38 perms[blog]['media_admin'].disabled = E.checked; 39 E.onclick = function() { $(this.form).updatePermissionsForm(); }; 40 } else if (perm == 'contentadmin' && !E.disabled) { 41 perms[blog]['usage'].checked = E.checked; 42 perms[blog]['publish'].checked = E.checked; 43 perms[blog]['delete'].checked = E.checked; 44 perms[blog]['usage'].disabled = E.checked; 45 perms[blog]['publish'].disabled = E.checked; 46 perms[blog]['delete'].disabled = E.checked; 47 E.onclick = function() { $(this.form).updatePermissionsForm(); }; 48 } else if (perm == 'media_admin' && !E.disabled) { 49 perms[blog]['media'].checked = E.checked; 50 perms[blog]['media'].disabled = E.checked; 51 E.onclick = function() { $(this.form).updatePermissionsForm(); }; 52 } 53 } 52 function admin(E,perms,re) { 53 P = E.name.match(re); 54 55 perms[P[1]]['usage'].checked = E.checked; 56 perms[P[1]]['publish'].checked = E.checked; 57 perms[P[1]]['delete'].checked = E.checked; 58 perms[P[1]]['contentadmin'].checked = E.checked; 59 perms[P[1]]['categories'].checked = E.checked; 60 perms[P[1]]['media'].checked = E.checked; 61 perms[P[1]]['media_admin'].checked = E.checked; 62 perms[P[1]]['usage'].disabled = E.checked; 63 perms[P[1]]['publish'].disabled = E.checked; 64 perms[P[1]]['delete'].disabled = E.checked; 65 perms[P[1]]['contentadmin'].disabled = E.checked; 66 perms[P[1]]['categories'].disabled = E.checked; 67 perms[P[1]]['media'].disabled = E.checked; 68 perms[P[1]]['media_admin'].disabled = E.checked; 54 69 } 70 71 function contentadmin(E,perms,re) { 72 P = E.name.match(re); 73 74 perms[P[1]]['usage'].checked = E.checked; 75 perms[P[1]]['publish'].checked = E.checked; 76 perms[P[1]]['delete'].checked = E.checked; 77 perms[P[1]]['usage'].disabled = E.checked; 78 perms[P[1]]['publish'].disabled = E.checked; 79 perms[P[1]]['delete'].disabled = E.checked; 80 } 81 82 function mediaadmin(E,perms,re) { 83 P = E.name.match(re); 84 85 perms[P[1]]['media'].checked = E.checked; 86 perms[P[1]]['media'].disabled = E.checked; 87 } 88 89 55 90 }); 56 91 }; -
admin/post.php
r1288 r1488 49 49 $post_status = -2; 50 50 } 51 52 # Getting categories53 $categories_combo = array(' ' => '');54 try {55 $categories = $core->blog->getCategories(array('post_type'=>'post'));56 while ($categories->fetch()) {57 $categories_combo[] = new formSelectOption(58 str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title),59 $categories->cat_id60 );61 }62 } catch (Exception $e) { }63 51 64 52 # Status combo … … 218 206 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 219 207 { 208 # Create category 209 if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) { 210 211 $cur_cat = $core->con->openCursor($core->prefix.'category'); 212 $cur_cat->cat_title = $_POST['new_cat_title']; 213 $cur_cat->cat_url = ''; 214 215 $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 216 217 # --BEHAVIOR-- adminBeforeCategoryCreate 218 $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 219 220 $cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 221 222 # --BEHAVIOR-- adminAfterCategoryCreate 223 $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $cat_id); 224 } 225 220 226 $cur = $core->con->openCursor($core->prefix.'post'); 221 227 … … 283 289 } 284 290 } 291 292 # Getting categories 293 $categories_combo = array(__('(No cat)') => ''); 294 try { 295 $categories = $core->blog->getCategories(array('post_type'=>'post')); 296 if (!$categories->isEmpty()) { 297 while ($categories->fetch()) { 298 $catparents_combo[] = $categories_combo[] = new formSelectOption( 299 str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 300 $categories->cat_id 301 ); 302 } 303 } 304 } catch (Exception $e) { } 285 305 286 306 /* DISPLAY … … 443 463 '</label></p>'. 444 464 465 ($core->auth->check('categories', $core->blog->id) ? 466 '<div>'. 467 '<p id="new_cat">'.__('Add a new category').'</p>'. 468 '<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'. 469 '<p><label for="new_cat_title">'.__('Title:').' '. 470 form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 471 '<p><label for="new_cat_parent">'.__('Parent:').' '. 472 form::combo('new_cat_parent',$categories_combo,'','maximal'). 473 '</label></p>'. 474 '</div>' 475 : ''). 476 445 477 '<p><label for="post_status">'.__('Entry status:'). 446 478 form::combo('post_status',$status_combo,$post_status,'','',!$can_publish). -
admin/posts_actions.php
r1179 r1421 16 16 17 17 $params = array(); 18 $action = ''; 18 19 19 20 /* Actions … … 126 127 elseif ($action == 'category' && isset($_POST['new_cat_id'])) 127 128 { 128 try 129 { 130 $core->blog->updPostsCategory($posts_ids,$_POST['new_cat_id']); 129 $new_cat_id = $_POST['new_cat_id']; 130 131 try 132 { 133 if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) 134 { 135 $cur_cat = $core->con->openCursor($core->prefix.'category'); 136 $cur_cat->cat_title = $_POST['new_cat_title']; 137 $cur_cat->cat_url = ''; 138 139 $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 140 141 # --BEHAVIOR-- adminBeforeCategoryCreate 142 $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 143 144 $new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 145 146 # --BEHAVIOR-- adminAfterCategoryCreate 147 $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id); 148 } 149 150 $core->blog->updPostsCategory($posts_ids, $new_cat_id); 131 151 132 152 http::redirect($redir); … … 246 266 echo '<h2 class="page-title">'.__('Change category for entries').'</h2>'; 247 267 248 # categories list249 268 # Getting categories 250 $categories_combo = array( ' '=> '');269 $categories_combo = array(__('(No cat)') => ''); 251 270 try { 252 271 $categories = $core->blog->getCategories(array('post_type'=>'post')); 253 while ($categories->fetch()) { 254 $categories_combo[] = new formSelectOption( 255 str_repeat(' ',$categories->level-1). 256 ($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 257 $categories->cat_id 258 ); 272 if (!$categories->isEmpty()) { 273 while ($categories->fetch()) { 274 $catparents_combo[] = $categories_combo[] = new formSelectOption( 275 str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 276 $categories->cat_id 277 ); 278 } 259 279 } 260 280 } catch (Exception $e) { } … … 265 285 form::combo('new_cat_id',$categories_combo,''). 266 286 '</label> '; 287 288 if ($core->auth->check('categories', $core->blog->id)) { 289 echo 290 '<div>'. 291 '<p id="new_cat">'.__('Add a new category').'</p>'. 292 '<p><label for="new_cat_title">'.__('Title:').' '. 293 form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 294 '<p><label for="new_cat_parent">'.__('Parent:').' '. 295 form::combo('new_cat_parent',$categories_combo,'','maximal'). 296 '</label></p>'. 297 '</div>'; 298 } 267 299 268 300 echo -
admin/preferences.php
r1179 r1375 344 344 ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 345 345 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 346 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 347 '<script type="text/javascript">'."\n". 348 "//<![CDATA[\n". 349 "\$(function() {\n". 350 " \$('#new_pwd').pwstrength({texts: ['". 351 sprintf(__('Password strength: %s'),__('very weak'))."', '". 352 sprintf(__('Password strength: %s'),__('weak'))."', '". 353 sprintf(__('Password strength: %s'),__('mediocre'))."', '". 354 sprintf(__('Password strength: %s'),__('strong'))."', '". 355 sprintf(__('Password strength: %s'),__('very strong'))."']});\n". 356 "});\n". 357 "\n//]]>\n". 358 "</script>\n". 346 359 dcPage::jsPageTabs($default_tab). 347 360 dcPage::jsConfirmClose('user-form'). … … 416 429 '<legend>'.__('Change your password').'</legend>'. 417 430 418 '<p><label for="new_pwd">'.__('New password:'). 419 form::password('new_pwd',20,255).'</label></p>'. 431 '<div class="pw-table">'. 432 '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. 433 form::password('new_pwd',20,255,'','','',false,' data-indicator="pwindicator" ').'</p>'. 434 '<div id="pwindicator">'. 435 ' <div class="bar"></div>'. 436 ' <p class="label no-margin"></p>'. 437 '</div>'. 438 '</div>'. 420 439 421 '<p><label for="new_pwd_c">'.__('Confirm password:'). 422 form::password('new_pwd_c',20,255).'</ label></p>'.440 '<p><label for="new_pwd_c">'.__('Confirm password:').'</label>'. 441 form::password('new_pwd_c',20,255).'</p>'. 423 442 '</fieldset>'. 424 443 425 444 '<p>'.__('If you have changed this user email or password you must provide your current password to save these modifications.').'</p>'. 426 '<p><label for="cur_pwd">'.__('Your password:'). 427 form::password('cur_pwd',20,255).'</ label></p>';445 '<p><label for="cur_pwd">'.__('Your password:').'</label>'. 446 form::password('cur_pwd',20,255).'</p>'; 428 447 } 429 448 -
admin/style/default.css
r1179 r1375 901 901 margin: 0; 902 902 } 903 904 903 /* paragraphe pour bouton Nouveau bidule */ 905 904 p.top-add { … … 1384 1383 color: white; 1385 1384 } 1385 1386 /* --------------------------------------------------------------- password indcator */ 1387 .pw-table { 1388 display: table; 1389 margin-bottom: 1em; 1390 } 1391 .pw-cell { 1392 display: table-cell; 1393 margin-bottom: 1em; 1394 } 1395 #pwindicator { 1396 display: table-cell; 1397 vertical-align: bottom; 1398 padding-left: 1.5em; 1399 height: 3.8em; 1400 } 1401 #pwindicator .bar { 1402 height: 6px; 1403 margin-bottom: 4px; 1404 } 1405 .pw-very-weak .bar { 1406 background: #900; 1407 width: 30px; 1408 } 1409 .pw-weak .bar { 1410 background: #c00; 1411 width: 60px; 1412 } 1413 .pw-mediocre .bar { 1414 background: #f60; 1415 width: 90px; 1416 } 1417 .pw-strong .bar { 1418 background: #060; 1419 width: 120px; 1420 } 1421 .pw-very-strong .bar { 1422 background: #0c0; 1423 width: 150px; 1424 } -
admin/update.php
r1287 r1479 106 106 throw new Exception( 107 107 sprintf(__('Downloaded Dotclear archive seems to be corrupted. '. 108 'Try <a %s>download it</a> again.'),'href="'.$p_url.'?step=download"') 108 'Try <a %s>download it</a> again.'),'href="'.$p_url.'?step=download"'). 109 ' '. 110 __('If this problem persists try to '. 111 '<a href="http://dotclear.org/download">update manually</a>.') 109 112 ); 110 113 } … … 168 171 -------------------------------------------------------- */ 169 172 dcPage::open(__('Dotclear update'), 170 (!$step ? dcPage::jsPageTabs($default_tab) : '') 173 (!$step ? 174 dcPage::jsPageTabs($default_tab). 175 dcPage::jsLoad('js/_update.js') 176 : '') 171 177 ); 172 178 -
inc/admin/lib.dc.page.php
r1256 r1462 160 160 if ($core->error->flag()) { 161 161 echo 162 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</ p></strong>'.162 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 163 163 $core->error->toHTML(). 164 164 '</div>'; … … 466 466 self::jsVar('dotclear.msg.confirm_delete_theme', 467 467 __('Are you sure you want to delete "%s" theme?')). 468 self::jsVar('dotclear.msg.confirm_delete_backup', 469 __('Are you sure you want to delete this backup?')). 468 470 self::jsVar('dotclear.msg.zip_file_content', 469 471 __('Zip file content')). -
inc/admin/lib.pager.php
r1179 r1364 87 87 html::escapeHTML($this->rs->cat_title)); 88 88 } else { 89 $cat_title = __(' None');89 $cat_title = __('(No cat)'); 90 90 } 91 91 -
inc/core/class.dc.blog.php
r1262 r1429 645 645 private function checkCategory($title,$url,$id=null) 646 646 { 647 $strReq = 'SELECT cat_id '. 648 'FROM '.$this->prefix.'category '. 649 "WHERE cat_url = '".$this->con->escape($url)."' ". 650 "AND blog_id = '".$this->con->escape($this->id)."' "; 651 652 if ($id !== null) { 653 $strReq .= 'AND cat_id <> '.(integer) $id.' '; 654 } 647 # Let's check if URL is taken... 648 $strReq = 649 'SELECT cat_url FROM '.$this->prefix.'category '. 650 "WHERE cat_url = '".$this->con->escape($url)."' ". 651 ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 652 "AND blog_id = '".$this->con->escape($this->id)."' ". 653 'ORDER BY cat_url DESC'; 655 654 656 655 $rs = $this->con->select($strReq); 657 656 658 if (!$rs->isEmpty()) { 659 throw new Exception(__('Category URL must be unique.')); 660 } 657 if (!$rs->isEmpty()) 658 { 659 if ($this->con->driver() == 'mysql') { 660 $clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'"; 661 } elseif ($this->con->driver() == 'pgsql') { 662 $clause = "~ '^".$this->con->escape($url)."[0-9]+$'"; 663 } else { 664 $clause = "LIKE '".$this->con->escape($url)."%'"; 665 } 666 $strReq = 667 'SELECT cat_url FROM '.$this->prefix.'category '. 668 "WHERE cat_url ".$clause.' '. 669 ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 670 "AND blog_id = '".$this->con->escape($this->id)."' ". 671 'ORDER BY cat_url DESC '; 672 673 $rs = $this->con->select($strReq); 674 $a = array(); 675 while ($rs->fetch()) { 676 $a[] = $rs->cat_url; 677 } 678 679 natsort($a); 680 $t_url = end($a); 681 682 if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) { 683 $i = (integer) $m[2]; 684 $url = $m[1]; 685 } else { 686 $i = 1; 687 } 688 689 return $url.($i+1); 690 } 691 692 # URL is empty? 693 if ($url == '') { 694 throw new Exception(__('Empty category URL')); 695 } 696 697 return $url; 661 698 } 662 699 … … 680 717 681 718 # Check if title or url are unique 682 $ this->checkCategory($cur->cat_title,$cur->cat_url,$id);719 $cur->cat_url = $this->checkCategory($cur->cat_title,$cur->cat_url,$id); 683 720 684 721 if ($cur->cat_desc !== null) { -
inc/core/class.dc.media.php
r1270 r1381 30 30 31 31 public $thumb_tp = '%s/.%s_%s.jpg'; ///< <b>string</b> Thumbnail file pattern 32 public $thumb_tp_alpha = '%s/.%s_%s.png'; ///< <b>string</b> Thumbnail file pattern (with alpha layer) 32 33 33 34 /** … … 298 299 $f->media_thumb = array(); 299 300 $p = path::info($f->relname); 300 $thumb = sprintf($this->thumb_tp,$this->root.'/'.$p['dirname'],$p['base'],'%s'); 301 $thumb_url = sprintf($this->thumb_tp,$this->root_url.$p['dirname'],$p['base'],'%s'); 301 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 302 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root.'/'.$p['dirname'],$p['base'],'%s'); 303 $thumb_url = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root_url.$p['dirname'],$p['base'],'%s'); 302 304 303 305 # Cleaner URLs … … 921 923 922 924 $p = path::info($file); 923 $thumb = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 925 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 926 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 924 927 925 928 try … … 940 943 $rate = ($s[0] < 100 ? 95 : ($s[0] < 600 ? 90 : 85)); 941 944 $img->resize($s[0],$s[0],$s[1]); 942 $img->output( 'jpeg',$thumb_file,$rate);945 $img->output(($alpha ? 'png' : 'jpeg'),$thumb_file,$rate); 943 946 $img->loadImage($file); 944 947 } … … 959 962 { 960 963 $p = path::info($file->relname); 961 $thumb_old = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 964 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 965 $thumb_old = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 962 966 963 967 $p = path::info($newFile->relname); 964 $thumb_new = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 968 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 969 $thumb_new = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 965 970 966 971 foreach ($this->thumb_sizes as $suffix => $s) { … … 975 980 { 976 981 $p = path::info($f); 977 $thumb = sprintf($this->thumb_tp,'',$p['base'],'%s'); 982 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 983 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),'',$p['base'],'%s'); 978 984 979 985 foreach ($this->thumb_sizes as $suffix => $s) { -
inc/prepend.php
r1233 r1352 123 123 # Constants 124 124 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 125 define('DC_VERSION','2.5. 2-dev');125 define('DC_VERSION','2.5.3-dev'); 126 126 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 127 127 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); -
locales/en/help/user_pref.html
r243 r1487 8 8 <h3>My profile</h3> 9 9 <dl> 10 <dt> Name, First name</dt>10 <dt>Last name, First name</dt> 11 11 <dd>If the display name is empty, the author's name will be displayed 12 12 as his Firstname and Name as set here.</dd> … … 37 37 <dl> 38 38 <dt>Preferred format</dt> 39 <dd>To choose the prefer ed post syntax. Wiki is a simplified syntax39 <dd>To choose the preferred post syntax. Wiki is a simplified syntax 40 40 and will be converted to valid xhtml ; Unless you have a perfect 41 41 understanding of html, we advise you to choose the wiki syntax.</dd> … … 59 59 60 60 <dt>Activate enhanced uploader in media manager</dt> 61 <dd>This option allows you to upload several files at the same time on your server. 62 Needs the presence of Flash plugin in your browser.</dd> 61 <dd>This option allows you to upload several files at the same time on your server.</dd> 63 62 64 63 <dt>Dashboard modules</dt> -
locales/en/main.po
r1256 r1479 1917 1917 msgstr "" 1918 1918 1919 msgid "If this problem persists try to <a href="http://dotclear.org/download">update manually</a>." 1920 msgstr "" 1921 1919 1922 msgid "The following files of your Dotclear installation have been modified so we won't try to update your installation. Please try to <a href=\"http://dotclear.org/download\">update manually</a>." 1920 1923 msgstr "" … … 2139 2142 msgstr "" 2140 2143 2144 msgid "Are you sure you want to delete this backup?" 2145 msgstr "" 2146 2141 2147 msgid "Zip file content" 2142 2148 msgstr "" … … 2790 2796 msgid "The following error was encountered while trying to read the database:" 2791 2797 msgstr "" 2798 2799 msgid "(No cat)" 2800 msgstr "(none)" -
locales/fr/main.po
r1288 r1488 1990 1990 msgstr "L'archive de Dotclear téléchargée semble être corrompue. Essayer de la <a %s>télécharger</a> à nouveau." 1991 1991 1992 msgid "If this problem persists try to <a href="http://dotclear.org/download">update manually</a>." 1993 msgstr "Si le problème persiste essayer de <a href="http://dotclear.org/download">mettre à jour manuellement</a>." 1994 1992 1995 msgid "The following files of your Dotclear installation have been modified so we won't try to update your installation. Please try to <a href=\"http://dotclear.org/download\">update manually</a>." 1993 1996 msgstr "Comme les fichiers suivants de votre installation de Dotclear ont été modifiés, votre installation ne peut être mise à jour. Merci de <a href=\"http://fr.dotclear.org/download\">mettre à jour manuellement</a>." … … 2210 2213 2211 2214 msgid "Users with posts cannot be deleted." 2212 msgstr "Les utilisateurs ayant écrit des billets ne peuvent être effacées."2215 msgstr "Les utilisateurs ayant écrit des billets ne peuvent être supprimés." 2213 2216 2214 2217 #, php-format … … 2251 2254 msgid "Are you sure you want to delete \"%s\" theme?" 2252 2255 msgstr "Êtes-vous certain de vouloir supprimer le thème \"%s\" ?" 2256 2257 msgid "Are you sure you want to delete this backup?" 2258 msgstr "Êtes-vous certain de vouloir supprimer cette sauvegarde ?" 2253 2259 2254 2260 msgid "Zip file content" … … 2940 2946 msgid "Invalid publication date" 2941 2947 msgstr "Date de publication invalide" 2948 2949 msgid "(No cat)" 2950 msgstr "(aucune)" 2951 2952 msgid "Password strength: %s" 2953 msgstr "Force du mot de passe : %s" 2954 2955 msgid "very weak" 2956 msgstr "très faible" 2957 2958 msgid "weak" 2959 msgstr "faible" 2960 2961 msgid "mediocre" 2962 msgstr "moyen" 2963 2964 msgid "strong" 2965 msgstr "fort" 2966 2967 msgid "very strong" 2968 msgstr "très fort" 2969 2970 msgid "This category will be created when you will save your post." 2971 msgstr "Cette catégorie sera créée lorsque vous enregistrerez votre billet." -
locales/fr/plugins.po
r1286 r1445 1166 1166 msgstr "Pages" 1167 1167 1168 msgid "My first page" 1169 msgstr "Ma première page" 1170 1171 msgid "This is your first page. When you\'re ready to blog, log in to edit or delete it." 1172 msgstr "Ceci est votre première page. Quand vous serez prêt à bloguer, connectez-vous pour l'éditer ou la supprimer." 1173 1168 1174 #, php-format 1169 1175 msgid "%d page" -
plugins/antispam/filters/class.dc.filter.iplookup.php
r1179 r1361 44 44 } 45 45 46 $match = array();47 48 46 $bls = $this->getServers(); 49 47 $bls = preg_split('/\s*,\s*/',$bls); 50 48 51 foreach ($bls as $bl) 52 { 49 foreach ($bls as $bl) { 53 50 if ($this->dnsblLookup($ip,$bl)) { 54 $match[] = $bl; 51 // Pass by reference $status to contain matching DNSBL 52 $status = $bl; 53 return true; 55 54 } 56 }57 58 if (!empty($match)) {59 $status = substr(implode(', ',$match),0,128);60 return true;61 55 } 62 56 } -
plugins/antispam/filters/class.dc.filter.linkslookup.php
r1179 r1366 64 64 private function getLinks($text) 65 65 { 66 $res = array(); 67 68 # href attribute on "a" tags 69 if (preg_match_all('/<a ([^>]+)>/ms', $text, $match, PREG_SET_ORDER)) 70 { 71 for ($i = 0; $i<count($match); $i++) 72 { 73 if (preg_match('/href="(http:\/\/[^"]+)"/ms', $match[$i][1], $matches)) { 74 $res[] = $matches[1]; 75 } 76 } 77 } 78 79 return $res; 66 // href attribute on "a" tags is second match 67 preg_match_all('|<a.*?href="(http.*?)"|', $text, $parts); 68 69 return $parts[1]; 80 70 } 81 71 } -
plugins/antispam/inc/lib.dc.antispam.php
r1179 r1478 75 75 if (($count = self::countSpam($core)) > 0) { 76 76 $str = ($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'); 77 $icons['comments'][0] .= '</ a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count).'</span>';77 $icons['comments'][0] .= '</span></a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count); 78 78 } 79 79 } … … 83 83 if (($count = self::countSpam($core)) > 0) { 84 84 $str = ($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'); 85 return '</ a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count).'</span>';85 return '</span></a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count); 86 86 } else { 87 87 return ''; -
plugins/attachments/_admin.php
r1179 r1467 36 36 '<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'. 37 37 '<ul>'. 38 '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'" '.38 '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'" '. 39 39 'title="'.$f->basename.'">'.$ftitle.'</a></li>'. 40 40 '<li>'.$f->media_dtstr.'</li>'. -
plugins/pages/_define.php
r1179 r1442 16 16 /* Description*/ "Serve entries as simple web pages", 17 17 /* Author */ "Olivier Meunier", 18 /* Version */ '1. 2',18 /* Version */ '1.3', 19 19 array( 20 20 'permissions' => 'contentadmin,pages', … … 22 22 ) 23 23 ); 24 ?>
Note: See TracChangeset
for help on using the changeset viewer.