[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/conf/ -> _formatting.php (source)

   1  <?php
   2  /**

   3   * This is b2evolution's formatting config file.

   4   *

   5   * This file sets how b2evolution will parse and format texts (posts, comments, etc.)

   6   * Last significant changes to this file: version 1.6

   7   *

   8   * @todo Move as much as possible to $Settings / $UserSettings

   9   * @package conf

  10   */
  11  if( !defined('EVO_CONFIG_LOADED') ) die( 'Please, do not access this page directly.' );
  12  
  13  
  14  // ** Formatting **

  15  
  16  /**

  17   * Automatically balance unmatched tags in posts and comments.

  18   *

  19   * Choose the formatting options for your posts:

  20   *  0 to disable

  21   *  1 to ensable

  22   *

  23   * @todo fp>This should be moved to the backoffice. Checkbox for each blog.

  24   *

  25   * @global integer 0|1

  26   */
  27  $use_balanceTags = 1;
  28  
  29  
  30  /**

  31   * Choose formatting options for comments

  32   * 'never'   : option will never be used

  33   * 'opt-in'  : option will be used only if user explicitely asks for it

  34   * 'opt-out' : option will be used by default, but user can refuse

  35   * 'always'  : option will always be used

  36   *

  37   * @todo fp> remove and let Auto-P handle the comment formatting.

  38   */
  39  $comments_use_autobr = 'opt-out';    // automatically change line breaks to <br />

  40  
  41  
  42  /*

  43   * Validity & Security Checking

  44   *

  45   * Posts and comments should be checked to see if they contain valid XHTML code

  46   * and no invalid code (javascript, styles, CSS, etc...)

  47   */
  48  
  49  # Html checking will validate posts and comments to a subset of valid XHTML.

  50  # This will also do much cleaner security checking than the next option.

  51  # Note: This option requires the PHP XML module. If your PHP installation doesn't have it

  52  # disable html_checker and use security_checker.

  53  /*

  54   * @todo fp>This should be moved to the backoffice. Checbox for each blog. This checkbox should NOT be editable by the blog owner.

  55   * Only the system admin should be adble to edit this. Special "Admin" tab on the blog settings.

  56   */
  57  $use_html_checker = 1;
  58  # Security checking will check for illegal javascript hacks in posts/comments

  59  # and for CSS in comments. However, this may be a bit harsh on your posts :]

  60  /*

  61   * @todo fp>This should be moved to the backoffice. Checbox for each blog. This checkbox should NOT be editable by the blog owner.

  62   * Only the system admin should be adble to edit this. Special "Admin" tab on the blog settings.

  63   */
  64  $use_security_checker = 0;
  65  # WARNING: disabling both $use_html_checker and $use_security_checker is suicidal !

  66  
  67  // Set this to true if you want to enforce XHTML strict

  68  /*

  69   * @todo fp>This should be moved to the backoffice. Checbox for each blog

  70   * @todo fp>It would however be interesting to have additional settings like use_strict, for things like: allow_tables, allow_objects (flash)

  71   */
  72  $use_strict =  false;
  73  
  74  # Set this to true to allow id && style as core attributes for posts

  75  $posts_allow_css_tweaks = false;
  76  
  77  # ONLY CHANGE THE FOLLOWING IF YOU KNOW WHAT YOU'RE DOING

  78  $posts_allow_javascript = false;
  79  $posts_allow_script_tags = false;
  80  $posts_allow_iframes = false;
  81  $posts_allow_objects = false;
  82  
  83  # set this to true to allow id && style as core attributes for comments

  84  # WARNING : This would allow spammers to post hidden content in comments

  85  #           enable it at your own risk !

  86  $comments_allow_css_tweaks = false;
  87  
  88  /*

  89   * HTML Checker params:

  90   *

  91   * The params are defined twice: once for the posts and once for the comments.

  92   * Typically you'll be more restrictive on comments.

  93   *

  94   * Adapted from XHTML-1.0-Transitional/Strict by fplanque

  95   * http://www.w3.org/TR/2002/REC-xhtml1-20020801/dtds.html#a_dtd_XHTML-1.0-Strict

  96   */
  97  
  98  // DEFINITION of allowed XHTML code for POSTS (posted in the backoffice)

  99  
 100  /**

 101   * Allowed Entity classes

 102   */
 103  if( $posts_allow_script_tags )
 104  {
 105      define( 'E_script_tags', 'script noscript' );
 106  }
 107  else
 108  {
 109      define( 'E_script_tags', '' );
 110  }
 111  
 112  if( $use_strict )
 113  {
 114      define('E_special_pre', 'br span bdo');            // Strict

 115      define('E_special', E_special_pre.' img '.E_script_tags);        // Strict

 116  }
 117  else
 118  {
 119      define('E_special_extra', 'img' );                            // Transitional

 120      define('E_special_basic', 'br span bdo' );            // Transitional

 121      define('E_special', E_special_basic.' '.E_special_extra.' '.E_script_tags );    // Transitional

 122  }
 123  
 124  if( $use_strict )
 125  {
 126      define('E_fontstyle', 'tt i b big small');                // Strict

 127  }
 128  else
 129  {
 130      define('E_fontstyle_extra', 'big small font' );            // Transitional

 131      define('E_fontstyle_basic', 'tt i b u s strike' );    // Transitional

 132      define('E_fontstyle', E_fontstyle_basic.' '.E_fontstyle_extra );    // Transitional

 133  }
 134  
 135  if( $use_strict )
 136  {
 137      define('E_phrase', 'em strong dfn code q samp kbd var cite abbr acronym sub sup'); // Strict

 138  }
 139  else
 140  {
 141      define('E_phrase_extra', 'sub sup');                                                                                             // Transitional

 142      define('E_phrase_basic', 'em strong dfn code q samp kbd var cite abbr acronym');    // Transitional

 143      define('E_phrase', E_phrase_basic.' '.E_phrase_extra );                                                     // Transitional

 144  }
 145  
 146  define('E_misc_inline', 'ins del');
 147  define('E_misc', E_misc_inline);
 148  define('E_inline', 'a '.E_special.' '.E_fontstyle.' '.E_phrase );
 149  define('E_Iinline', '#PCDATA '.E_inline.' '.E_misc_inline );
 150  define('E_heading', 'h1 h2 h3 h4 h5 h6');
 151  
 152  if( $use_strict )
 153  {
 154      define('E_list', 'ul ol dl');                // Strict

 155  }
 156  else
 157  {
 158      define('E_list', 'ul ol dl menu dir');    // Transitional

 159  }
 160  
 161  if( $use_strict )
 162  {
 163      define('E_blocktext', 'pre hr blockquote address');            // Strict

 164  }
 165  else
 166  {
 167      define('E_blocktext', 'pre hr blockquote address center');    // Transitional

 168  }
 169  
 170  if( $posts_allow_iframes )
 171  {
 172      define('E_block', 'p '.E_heading.' div '.E_list.' '.E_blocktext.' fieldset table iframe');
 173  }
 174  else
 175  {
 176      define('E_block', 'p '.E_heading.' div '.E_list.' '.E_blocktext.' fieldset table');
 177  }
 178  
 179  if( $use_strict ) define('E_Bblock', E_block.' '.E_misc );            // Strict only

 180  
 181  if( $posts_allow_objects )
 182  {
 183      define('E_Flow', '#PCDATA '.E_block.' '.E_inline.' '.E_misc.' object' );
 184  }
 185  else
 186  {
 187      define('E_Flow', '#PCDATA '.E_block.' '.E_inline.' '.E_misc );
 188  }
 189  define('E_a_content', '#PCDATA '.E_special.' '.E_fontstyle.' '.E_phrase.' '.E_misc_inline );
 190  
 191  if( $use_strict )
 192  {
 193      define('E_pre_content', '#PCDATA a '.E_fontstyle.' '.E_phrase.' '.E_special_pre.' '.E_misc_inline ); // Strict

 194  }
 195  else
 196  {
 197      define('E_pre_content', '#PCDATA a '.E_special_basic.' '.E_fontstyle_basic.' '.E_phrase_basic.' '.E_misc_inline ); // Transitional

 198  }
 199  
 200  // Allowed Attribute classes

 201  define('A_coreattrs', 'class title'.( $posts_allow_css_tweaks ? ' id style' : '' )
 202                      .( $posts_allow_javascript ? ' onmouseover onmouseout onclick' : '' )  );
 203  define('A_i18n', 'lang xml:lang dir');
 204  define('A_attrs', A_coreattrs.' '.A_i18n);
 205  
 206  if( !$use_strict ) define('A_TextAlign', 'align');                                    // Transitional only

 207  
 208  define('A_cellhalign', 'align char charoff');
 209  define('A_cellvalign', 'valign');
 210  
 211  // Array showing what tags are allowed and what their allowed subtags are.

 212  $allowed_tags = array
 213  (
 214      'body' => E_Flow, // Remember this is not a true body, just a post body
 215      'div' => E_Flow,
 216      'p' => E_Iinline,
 217      'h1' => E_Iinline,
 218      'h2' => E_Iinline,
 219      'h3' => E_Iinline,
 220      'h4' => E_Iinline,
 221      'h5' => E_Iinline,
 222      'h6' => E_Iinline,
 223      'ul' => 'li',
 224      'ol' => 'li',
 225  );
 226  
 227  if( !$use_strict )
 228  {
 229      $allowed_tags += array
 230      (
 231          'menu' => 'li',        // Transitional only
 232          'dir' => 'li',        // Transitional only
 233      );
 234  }
 235  
 236  $allowed_tags += array
 237  (
 238      'li' => E_Flow,
 239      'dl' => 'dt dd',
 240      'dt' => E_Iinline,
 241      'dd' => E_Flow,
 242  );
 243  
 244  if( $use_strict )
 245  {
 246      $allowed_tags += array
 247      (
 248          'address' => E_Iinline,                                                        // Strict
 249      );
 250  }
 251  else
 252  {
 253      $allowed_tags += array
 254      (
 255          'address' => '#PCDATA '.E_inline.' '.E_misc_inline,        // Transitional
 256      );
 257  }
 258  
 259  $allowed_tags += array
 260      (
 261          'hr' => '',
 262          'pre' => E_pre_content,
 263      );
 264  
 265  if( $use_strict )
 266  {
 267      $allowed_tags += array
 268      (
 269          'blockquote' => E_Bblock,        // Strict
 270      );
 271  }
 272  else
 273  {
 274      $allowed_tags += array
 275      (
 276          'blockquote' => E_Flow,                    // Transitional
 277          'center' => E_Flow,                    // Transitional only
 278      );
 279  }
 280  
 281  $allowed_tags += array
 282  (
 283      'ins' => E_Flow,
 284      'del' => E_Flow,
 285      'a' => E_a_content,
 286      'span' => E_Iinline,
 287      'bdo' => E_Iinline,
 288      'br' => '',
 289      'em' => E_Iinline,
 290      'strong' => E_Iinline,
 291      'dfn' => E_Iinline,
 292      'code' => E_Iinline,
 293      'samp' => E_Iinline,
 294      'kbd' => E_Iinline,
 295      'var' => E_Iinline,
 296      'cite' => E_Iinline,
 297      'abbr' => E_Iinline,
 298      'acronym' => E_Iinline,
 299      'q' => E_Iinline,
 300      'sub' => E_Iinline,
 301      'sup' => E_Iinline,
 302      'tt' => E_Iinline,
 303      'i' => E_Iinline,
 304      'b' => E_Iinline,
 305      'big' => E_Iinline,
 306      'small' => E_Iinline,
 307  );
 308  
 309  if( !$use_strict )
 310  {
 311      $allowed_tags += array
 312      (
 313          'u' => E_Iinline,                        // Transitional only
 314          's' => E_Iinline,                        // Transitional only
 315          'strike' => E_Iinline,            // Transitional only
 316          'font' => E_Iinline,                // Transitional only
 317      );
 318  }
 319  
 320  $allowed_tags += array
 321  (
 322      'img' => '',
 323      'fieldset' => '#PCDATA legend '.E_block.' '.E_inline.' '.E_misc,
 324      'legend' => E_Iinline,
 325      'table' => 'caption col colgroup thead tfoot tbody tr',
 326      'caption' => E_Iinline,
 327      'thead' => 'tr',
 328      'tfoot' => 'tr',
 329      'tbody' => 'tr',
 330      'colgroup' => 'col',
 331      'tr' => 'th td',
 332      'th' => E_Flow,
 333      'td' => E_Flow,
 334  );
 335  
 336  if( $posts_allow_script_tags )
 337  {
 338      $allowed_tags += array
 339      (
 340          'script' => '#PCDATA',
 341          'noscript' => E_Flow,
 342      );
 343  }
 344  
 345  // Array showing allowed attributes for tags

 346  if( $use_strict )
 347  {
 348      $allowed_attributes = array
 349      (
 350          'div' => A_attrs,                                // Strict
 351          'p' => A_attrs,                                // Strict
 352          'h1' => A_attrs,                                // Strict
 353          'h2' => A_attrs,                                // Strict
 354          'h3' => A_attrs,                                // Strict
 355          'h4' => A_attrs,                                // Strict
 356          'h5' => A_attrs,                                // Strict
 357          'h6' => A_attrs,                                // Strict
 358          'ul' => A_attrs,    // Strict
 359          'ol' => A_attrs,    // Strict
 360          'li' => A_attrs,                            // Strict
 361          'dl' => A_attrs,                    // Strict
 362          'hr' => A_attrs,                                                            // Strict
 363          'pre' => A_attrs.' xml:space',                                // Strict
 364          'a' => A_attrs.' charset type href hreflang rel rev shape coords',            // Strict
 365          'br' => A_coreattrs,                // Strict
 366          'img' => A_attrs.' src alt longdesc height width usemap ismap',    // Strict
 367          'legend' => A_attrs,                            // Strict
 368          'table' => A_attrs.' summary width border frame rules cellspacing cellpadding',  // Strict
 369          'caption' => A_attrs,                        // Strict
 370          'tr' => A_attrs.' '.A_cellhalign.' '.A_cellvalign,    // Strict
 371          'th' => A_attrs.' abbr axis headers scope rowspan colspan '.A_cellhalign.' '.A_cellvalign,    // Strict
 372          'td' => A_attrs.' abbr axis headers scope rowspan colspan '.A_cellhalign.' '.A_cellvalign,    // Strict
 373      );
 374  }
 375  else
 376  {
 377      $allowed_attributes = array
 378      (
 379          'div' => A_attrs.' '.A_TextAlign,        // Transitional
 380          'p' => A_attrs.' '.A_TextAlign,        // Transitional
 381          'h1' => A_attrs.' '.A_TextAlign,        // Transitional
 382          'h2' => A_attrs.' '.A_TextAlign,        // Transitional
 383          'h3' => A_attrs.' '.A_TextAlign,        // Transitional
 384          'h4' => A_attrs.' '.A_TextAlign,        // Transitional
 385          'h5' => A_attrs.' '.A_TextAlign,        // Transitional
 386          'h6' => A_attrs.' '.A_TextAlign,        // Transitional
 387          'ul' => A_attrs.' type compact',    // Transitional
 388          'ol' => A_attrs.' type compact start',    // Transitional
 389          'menu' => A_attrs.' compact',    // Transitional only
 390          'dir' => A_attrs.' compact',    // Transitional only
 391          'li' => A_attrs.' type value',    // Transitional
 392          'dl' => A_attrs.' compact',    // Transitional
 393          'hr' => A_attrs.' align noshade size width',        // Transitional
 394          'pre' => A_attrs.' width xml:space',                        // Transitional
 395          'center' => A_attrs,                    // Transitional only
 396          'a' => A_attrs.' charset type href hreflang rel rev shape coords target',    // Transitional
 397          'br' => A_coreattrs.' clear',    // Transitional
 398          'u' => A_attrs,                        // Transitional only
 399          's' => A_attrs,                        // Transitional only
 400          'strike' => A_attrs,            // Transitional only
 401          'font' => A_coreattrs.' '.A_i18n.' size color face',    // Transitional only
 402          'img' => A_attrs.' src alt name longdesc height width usemap ismap align border hspace vspace',    // Transitional
 403          'legend' => A_attrs.' align',                // Transitional
 404          'table' => A_attrs.' summary width border frame rules cellspacing cellpadding align bgcolor',                                // Transitional
 405          'caption' => A_attrs.' align',                                                                                                // Transitional
 406          'tr' => A_attrs.' '.A_cellhalign.' '.A_cellvalign.' bgcolor',                                                                // Transitional
 407          'th' => A_attrs.' abbr axis headers scope rowspan colspan '.A_cellhalign.' '.A_cellvalign.' nowrap bgcolor width height',    // Transitional
 408          'td' => A_attrs.' abbr axis headers scope rowspan colspan '.A_cellhalign.' '.A_cellvalign.' nowrap bgcolor width height',    // Transitional
 409      );
 410  }
 411  $allowed_attributes += array
 412  (
 413      'fieldset' => A_attrs,
 414  
 415      'ins' => A_attrs.' cite datetime',
 416      'del' => A_attrs.' cite datetime',
 417      'blockquote' => A_attrs.' cite',
 418      'span' => A_attrs,
 419      'bdo' => A_coreattrs.' lang xml:lang dir',
 420      'dt' => A_attrs,
 421      'dd' => A_attrs,
 422  
 423      'address' => A_attrs,
 424  
 425      'em' => A_attrs,
 426      'strong' => A_attrs,
 427      'dfn' => A_attrs,
 428      'code' => A_attrs,
 429      'samp' => A_attrs,
 430      'kbd' => A_attrs,
 431      'var' => A_attrs,
 432      'cite' => A_attrs,
 433      'abbr' => A_attrs,
 434      'acronym' => A_attrs,
 435      'q' => A_attrs.' cite',
 436      'sub' => A_attrs,
 437      'sup' => A_attrs,
 438      'tt' => A_attrs,
 439      'i' => A_attrs,
 440      'b' => A_attrs,
 441      'big' => A_attrs,
 442      'small' => A_attrs,
 443      'colgroup' => A_attrs.' span width cellhalign cellvalign',
 444      'col' => A_attrs.' span width cellhalign cellvalign',
 445      'thead' => A_attrs.' '.A_cellhalign.' '.A_cellvalign,
 446      'tfoot' => A_attrs.' '.A_cellhalign.' '.A_cellvalign,
 447      'tbody' => A_attrs.' '.A_cellhalign.' '.A_cellvalign,
 448  
 449  );
 450  
 451  $allowed_uri_scheme = array
 452  (
 453      'http',
 454      'https',
 455      'ftp',
 456      'gopher',
 457      'nntp',
 458      'news',
 459      'mailto',
 460      'irc',
 461      'aim',
 462      'icq'
 463  );
 464  
 465  if( $posts_allow_javascript )
 466  {
 467      $allowed_uri_scheme[] = 'javascript';
 468  }
 469  
 470  if( $posts_allow_script_tags )
 471  {
 472      $allowed_attributes += array
 473      (
 474          'script' => 'type',
 475          'noscript' => '',
 476      );
 477  }
 478  
 479  if( $posts_allow_iframes )
 480  {
 481      $allowed_tags += array
 482      (
 483          'iframe' => '',
 484      );
 485      $allowed_attributes += array
 486      (
 487           'iframe' => A_attrs.' '.A_TextAlign.' src width height frameborder marginwidth marginheight scrolling',        // Transitional
 488      );
 489  }
 490  
 491  if( $posts_allow_objects )
 492  {
 493      $allowed_tags += array
 494      (
 495          'object' => 'param embed',
 496        'param' => '',
 497        'embed' => '',
 498      );
 499      $allowed_attributes += array
 500      (
 501        'object' => 'codebase classid id height width align',
 502        'param' => 'name value',
 503        'embed' => 'src type height width wmode quality bgcolor name align allowScriptAccess pluginspage',
 504      );
 505      $allowed_uri_scheme[] = 'clsid';
 506  }
 507  
 508  
 509  
 510  // -----------------------------------------------------------------------------

 511  
 512  // DEFINITION of allowed XHTML code for COMMENTS (posted from the public blog pages)

 513  
 514  # here is a list of the tags that are allowed in the comments.

 515  # all tags not in this list will be filtered out anyway before we do any checking

 516  $comment_allowed_tags = '<p><ul><ol><li><dl><dt><dd><address><blockquote><ins><del><span><bdo><br><em><strong><dfn><code><samp><kdb><var><cite><abbr><acronym><q><sub><sup><tt><i><b><big><small>';
 517  
 518  // Allowed Entity classes

 519  define('C_E_special_pre', 'br span bdo');
 520  define('C_E_special', C_E_special_pre);
 521  define('C_E_fontstyle', 'tt i b big small');
 522  define('C_E_phrase', 'em strong dfn code q samp kbd var cite abbr acronym sub sup');
 523  define('C_E_misc_inline', 'ins del');
 524  define('C_E_misc', C_E_misc_inline);
 525  define('C_E_inline', 'a '.C_E_special.' '.C_E_fontstyle.' '.C_E_phrase );
 526  define('C_E_Iinline', '#PCDATA '.C_E_inline.' '.C_E_misc_inline );
 527  define('C_E_heading', '');
 528  define('C_E_list', 'ul ol dl');
 529  define('C_E_blocktext', 'hr blockquote address');
 530  define('C_E_block', 'p '.C_E_heading.' div '.C_E_list.' '.C_E_blocktext.' table');
 531  define('C_E_Bblock', C_E_block.' '.C_E_misc );
 532  define('C_E_Flow', '#PCDATA '.C_E_block.' '.C_E_inline.' '.C_E_misc );
 533  define('C_E_a_content', '#PCDATA '.C_E_special.' '.C_E_fontstyle.' '.C_E_phrase.' '.C_E_misc_inline );
 534  define('C_E_pre_content', '#PCDATA a '.C_E_fontstyle.' '.C_E_phrase.' '.C_E_special_pre.' '.C_E_misc_inline );
 535  
 536  // Allowed Attribute classes

 537  define('C_A_coreattrs', 'class title'.( $comments_allow_css_tweaks ? ' id style' : '' ) );
 538  define('C_A_i18n', 'lang xml:lang dir');
 539  define('C_A_attrs', C_A_coreattrs.' '.C_A_i18n);
 540  define('C_A_cellhalign', 'align char charoff');
 541  define('C_A_cellvalign', 'valign');
 542  
 543  /**

 544   * Array showing what tags are allowed and what their allowed subtags are.

 545   * @global array

 546   */
 547  $comments_allowed_tags = array
 548  (
 549      'body' => E_Flow, // Remember this is not a true body, just a comment body
 550      'p' => C_E_Iinline,
 551      'ul' => 'li',
 552      'ol' => 'li',
 553      'li' => C_E_Flow,
 554      'dl' => 'dt dd',
 555      'dt' => C_E_Iinline,
 556      'dd' => C_E_Flow,
 557      'address' => C_E_Iinline,
 558      'hr' => '',
 559  );
 560  if( $use_strict )
 561  {
 562      $comments_allowed_tags += array
 563      (
 564          'blockquote' => C_E_Bblock,        // XHTML-1.0-Strict
 565      );
 566  }
 567  else
 568  {
 569      $comments_allowed_tags += array
 570      (
 571          'blockquote' => C_E_Flow,                // XHTML-1.0-Transitional
 572      );
 573  }
 574  $comments_allowed_tags += array
 575  (
 576      'ins' => C_E_Flow,
 577      'del' => C_E_Flow,
 578  //    'a' => C_E_a_content,  // Allowing this will call for a whole lot of comment spam!!!

 579      'span' => C_E_Iinline,
 580      'bdo' => C_E_Iinline,
 581      'br' => '',
 582      'em' => C_E_Iinline,
 583      'strong' => C_E_Iinline,
 584      'dfn' => C_E_Iinline,
 585      'code' => C_E_Iinline,
 586      'samp' => C_E_Iinline,
 587      'kbd' => C_E_Iinline,
 588      'var' => C_E_Iinline,
 589      'cite' => C_E_Iinline,
 590      'abbr' => C_E_Iinline,
 591      'acronym' => C_E_Iinline,
 592      'q' => C_E_Iinline,
 593      'sub' => C_E_Iinline,
 594      'sup' => C_E_Iinline,
 595      'tt' => C_E_Iinline,
 596      'i' => C_E_Iinline,
 597      'b' => C_E_Iinline,
 598      'big' => C_E_Iinline,
 599      'small' => C_E_Iinline,
 600  );
 601  
 602  
 603  /**

 604   * Array showing allowed attributes for tags.

 605   * @global array

 606   */
 607  $comments_allowed_attributes = array
 608  (
 609      'p' => C_A_attrs,
 610      'ul' => C_A_attrs,
 611      'ol' => C_A_attrs,
 612      'li' => C_A_attrs,
 613      'dl' => C_A_attrs,
 614      'dt' => C_A_attrs,
 615      'dd' => C_A_attrs,
 616      'address' => C_A_attrs,
 617      'blockquote' => C_A_attrs.' cite',
 618      'ins' => C_A_attrs.' cite datetime',
 619      'del' => C_A_attrs.' cite datetime',
 620      'a' => C_A_attrs.' charset type href hreflang rel rev shape coords',
 621      'span' => C_A_attrs,
 622      'bdo' => C_A_coreattrs.' lang xml:lang dir',
 623      'br' => C_A_coreattrs,
 624      'em' => C_A_attrs,
 625      'strong' => C_A_attrs,
 626      'dfn' => C_A_attrs,
 627      'code' => C_A_attrs,
 628      'samp' => C_A_attrs,
 629      'kbd' => C_A_attrs,
 630      'var' => C_A_attrs,
 631      'cite' => C_A_attrs,
 632      'abbr' => C_A_attrs,
 633      'acronym' => C_A_attrs,
 634      'q' => C_A_attrs.' cite',
 635      'sub' => C_A_attrs,
 636      'sup' => C_A_attrs,
 637      'tt' => C_A_attrs,
 638      'i' => C_A_attrs,
 639      'b' => C_A_attrs,
 640      'big' => C_A_attrs,
 641      'small' => C_A_attrs,
 642  );
 643  
 644  
 645  /**

 646   * URI schemes allowed for URLs in comments and user profiles:

 647   * @global array

 648   */
 649  $comments_allowed_uri_scheme = array
 650  (
 651      'http',
 652      'https',
 653      'ftp',
 654      'gopher',
 655      'nntp',
 656      'news',
 657      'mailto',
 658      'irc',
 659      'aim',
 660      'icq'
 661  );
 662  
 663  
 664  // Array showing URI attributes

 665  $uri_attrs = array
 666  (
 667      'xmlns',
 668      'profile',
 669      'href',
 670      'src',
 671      'cite',
 672      'classid',
 673      'codebase',
 674      'data',
 675      'archive',
 676      'usemap',
 677      'longdesc',
 678      'action'
 679  );
 680  
 681  
 682  /**

 683   * Translation of HTML entities and special characters.

 684   * @global array

 685   */
 686  $b2_htmltrans = array(
 687      // '&#8211;' => ' ', '&#8212;' => ' ', '&#8216;' => ' ', '&#8217;' => ' ',

 688      // '&#8220;' => ' ', '&#8221;' => ' ', '&#8226;' => ' ', '&#8364;' => ' ',

 689      '&lt;' => '&#60;',    '&gt;' => '&#62;',
 690      '&sp;' => '&#32;', '&excl;' => '&#33;', '&quot;' => '&#34;', '&num;' => '&#35;',
 691      '&dollar;' =>  '&#36;', '&percnt;' => '&#37;', '&amp;' => '&#38;', '&apos;' => '&#39;',
 692      '&lpar;' => '&#40;', '&rpar;' => '&#41;',
 693      '&ast;' => '&#42;', '&plus;' => '&#43;', '&comma;' => '&#44;', '&hyphen;' => '&#45;',
 694      '&minus;' => '&#45;', '&period;' => '&#46;', '&sol;' => '&#47;', '&colon;' => '&#58;',
 695      '&semi;' => '&#59;', '&lt;' => '&#60;',
 696      '&equals;' => '&#61;', '&gt;' => '&#62;', '&quest;' => '&#63;', '&commat;' => '&#64;',
 697      '&lsqb;' => '&#91;', '&bsol;' => '&#92;', '&rsqb;' => '&#93;', '&circ;' => '&#94;',
 698      '&lowbar;' => '&#95;', '&horbar;' => '&#95;',
 699      '&grave;' => '&#96;', '&lcub;' => '&#123;', '&verbar;' => '&#124;', '&rcub;' => '&#125;',
 700      '&tilde;' => '&#126;', '&lsquor;' => '&#130;', '&ldquor;' => '&#132;',
 701      '&ldots;' => '&#133;', '&Scaron;' => '&#138;', '&lsaquo;' => '&#139;', '&OElig;' => '&#140;',
 702      '&lsquo;' => '&#145;', '&rsquor;' => '&#145;', '&rsquo;' => '&#146;',
 703      '&ldquo;' => '&#147;', '&rdquor;' => '&#147;', '&rdquo;' => '&#148;', '&bull;' => '&#149;',
 704      '&ndash;' => '&#150;', '&endash;' => '&#150;', '&mdash;' => '&#151;', '&emdash;' => '&#151;',
 705      '&tilde;' => '&#152;', '&trade;' => '&#153;',
 706      '&scaron;' => '&#154;', '&rsaquo;' => '&#155;', '&oelig;' => '&#156;', '&Yuml;' => '&#159;',
 707      '&nbsp;' => '&#160;', '&iexcl;' => '&#161;', '&cent;' => '&#162;', '&pound;' => '&#163;',
 708      '&curren;' => '&#164;', '&yen;' => '&#165;',
 709      '&brvbar;' => '&#166;', '&brkbar;' => '&#166;', '&sect;' => '&#167;', '&uml;' => '&#168;',
 710      '&die;' => '&#168;', '&copy;' => '&#169;', '&ordf;' => '&#170;', '&laquo;' => '&#171;',
 711      '&not;' => '&#172;', '&shy;' => '&#173;',
 712      '&reg;' => '&#174;', '&macr;' => '&#175;', '&hibar;' => '&#175;', '&deg;' => '&#176;',
 713      '&plusmn;' => '&#177;', '&sup2;' => '&#178;', '&sup3;' => '&#179;', '&acute;' => '&#180;',
 714      '&micro;' => '&#181;', '&para;' => '&#182;',
 715      '&middot;' => '&#183;', '&cedil;' => '&#184;', '&sup1;' => '&#185;', '&ordm;' => '&#186;',
 716      '&raquo;' => '&#187;', '&frac14;' => '&#188;', '&frac12;' => '&#189;', '&half;' => '&#189;',
 717      '&frac34;' => '&#190;', '&iquest;' => '&#191;',
 718      '&Agrave;' => '&#192;', '&Aacute;' => '&#193;', '&Acirc;' => '&#194;', '&Atilde;' => '&#195;',
 719      '&Auml;' => '&#196;', '&Aring;' => '&#197;', '&AElig;' => '&#198;', '&Ccedil;' => '&#199;',
 720      '&Egrave;' => '&#200;', '&Eacute;' => '&#201;',
 721      '&Ecirc;' => '&#202;', '&Euml;' => '&#203;', '&Igrave;' => '&#204;', '&Iacute;' => '&#205;',
 722      '&Icirc;' => '&#206;', '&Iuml;' => '&#207;', '&ETH;' => '&#208;', '&Ntilde;' => '&#209;',
 723      '&Ograve;' => '&#210;', '&Oacute;' => '&#211;',
 724      '&Ocirc;' => '&#212;', '&Otilde;' => '&#213;', '&Ouml;' => '&#214;', '&times;' => '&#215;',
 725      '&Oslash;' => '&#216;', '&Ugrave;' => '&#217;', '&Uacute;' => '&#218;', '&Ucirc;' => '&#219;',
 726      '&Uuml;' => '&#220;', '&Yacute;' => '&#221;',
 727      '&THORN;' => '&#222;', '&szlig;' => '&#223;', '&agrave;' => '&#224;', '&aacute;' => '&#225;',
 728      '&acirc;' => '&#226;', '&atilde;' => '&#227;', '&auml;' => '&#228;', '&aring;' => '&#229;',
 729      '&aelig;' => '&#230;', '&ccedil;' => '&#231;',
 730      '&egrave;' => '&#232;', '&eacute;' => '&#233;', '&ecirc;' => '&#234;', '&euml;' => '&#235;',
 731      '&igrave;' => '&#236;', '&iacute;' => '&#237;', '&icirc;' => '&#238;', '&iuml;' => '&#239;',
 732      '&eth;' => '&#240;', '&ntilde;' => '&#241;',
 733      '&ograve;' => '&#242;', '&oacute;' => '&#243;', '&ocirc;' => '&#244;', '&otilde;' => '&#245;',
 734      '&ouml;' => '&#246;', '&divide;' => '&#247;', '&oslash;' => '&#248;', '&ugrave;' => '&#249;',
 735      '&uacute;' => '&#250;', '&ucirc;' => '&#251;',
 736      '&uuml;' => '&#252;', '&yacute;' => '&#253;', '&thorn;' => '&#254;', '&yuml;' => '&#255;',
 737      '&OElig;' => '&#338;', '&oelig;' => '&#339;', '&Scaron;' => '&#352;', '&scaron;' => '&#353;',
 738      '&Yuml;' => '&#376;', '&fnof;' => '&#402;',
 739      '&circ;' => '&#710;', '&tilde;' => '&#732;', '&Alpha;' => '&#913;', '&Beta;' => '&#914;',
 740      '&Gamma;' => '&#915;', '&Delta;' => '&#916;', '&Epsilon;' => '&#917;', '&Zeta;' => '&#918;',
 741      '&Eta;' => '&#919;', '&Theta;' => '&#920;',
 742      '&Iota;' => '&#921;', '&Kappa;' => '&#922;', '&Lambda;' => '&#923;',
 743      '&Mu;' => '&#924;', '&Nu;' => '&#925;', '&Xi;' => '&#926;',
 744      '&Omicron;' => '&#927;', '&Pi;' => '&#928;', '&Rho;' => '&#929;', '&Sigma;' => '&#931;',
 745      '&Tau;' => '&#932;', '&Upsilon;' => '&#933;', '&Phi;' => '&#934;',
 746      '&Chi;' => '&#935;', '&Psi;' => '&#936;', '&Omega;' => '&#937;',
 747      '&alpha;' => '&#945;', '&beta;' => '&#946;', '&gamma;' => '&#947;', '&delta;' => '&#948;',
 748      '&epsilon;' => '&#949;', '&zeta;' => '&#950;', '&eta;' => '&#951;',
 749      '&theta;' => '&#952;', '&iota;' => '&#953;', '&kappa;' => '&#954;', '&lambda;' => '&#955;',
 750      '&mu;' => '&#956;', '&nu;' => '&#957;', '&xi;' => '&#958;',
 751      '&omicron;' => '&#959;', '&pi;' => '&#960;', '&rho;' => '&#961;', '&sigmaf;' => '&#962;',
 752      '&sigma;' => '&#963;', '&tau;' => '&#964;', '&upsilon;' => '&#965;', '&phi;' => '&#966;',
 753      '&chi;' => '&#967;', '&psi;' => '&#968;',
 754      '&omega;' => '&#969;', '&thetasym;' => '&#977;', '&upsih;' => '&#978;', '&piv;' => '&#982;',
 755      '&ensp;' => '&#8194;', '&emsp;' => '&#8195;', '&thinsp;' => '&#8201;', '&zwnj;' => '&#8204;',
 756      '&zwj;' => '&#8205;', '&lrm;' => '&#8206;',
 757      '&rlm;' => '&#8207;', '&ndash;' => '&#8211;', '&mdash;' => '&#8212;', '&lsquo;' => '&#8216;',
 758      '&rsquo;' => '&#8217;', '&sbquo;' => '&#8218;', '&ldquo;' => '&#8220;', '&rdquo;' => '&#8221;',
 759      '&bdquo;' => '&#8222;', '&dagger;' => '&#8224;',
 760      '&Dagger;' => '&#8225;', '&bull;' => '&#8226;', '&hellip;' => '&#8230;', '&permil;' => '&#8240;',
 761      '&prime;' => '&#8242;', '&Prime;' => '&#8243;', '&lsaquo;' => '&#8249;', '&rsaquo;' => '&#8250;',
 762      '&oline;' => '&#8254;', '&frasl;' => '&#8260;',
 763      '&euro;' => '&#8364;', '&image;' => '&#8465;', '&weierp;' => '&#8472;', '&real;' => '&#8476;',
 764      '&trade;' => '&#8482;', '&alefsym;' => '&#8501;', '&larr;' => '&#8592;', '&uarr;' => '&#8593;',
 765      '&rarr;' => '&#8594;', '&darr;' => '&#8595;',
 766      '&harr;' => '&#8596;', '&crarr;' => '&#8629;', '&lArr;' => '&#8656;', '&uArr;' => '&#8657;',
 767      '&rArr;' => '&#8658;', '&dArr;' => '&#8659;', '&hArr;' => '&#8660;', '&forall;' => '&#8704;',
 768      '&part;' => '&#8706;', '&exist;' => '&#8707;',
 769      '&empty;' => '&#8709;', '&nabla;' => '&#8711;', '&isin;' => '&#8712;', '&notin;' => '&#8713;',
 770      '&ni;' => '&#8715;', '&prod;' => '&#8719;', '&sum;' => '&#8721;', '&minus;' => '&#8722;',
 771      '&lowast;' => '&#8727;', '&radic;' => '&#8730;',
 772      '&prop;' => '&#8733;', '&infin;' => '&#8734;', '&ang;' => '&#8736;', '&and;' => '&#8743;',
 773      '&or;' => '&#8744;', '&cap;' => '&#8745;', '&cup;' => '&#8746;', '&int;' => '&#8747;',
 774      '&there4;' => '&#8756;', '&sim;' => '&#8764;',
 775      '&cong;' => '&#8773;', '&asymp;' => '&#8776;', '&ne;' => '&#8800;', '&equiv;' => '&#8801;',
 776      '&le;' => '&#8804;', '&ge;' => '&#8805;', '&sub;' => '&#8834;', '&sup;' => '&#8835;',
 777      '&nsub;' => '&#8836;', '&sube;' => '&#8838;',
 778      '&supe;' => '&#8839;', '&oplus;' => '&#8853;', '&otimes;' => '&#8855;', '&perp;' => '&#8869;',
 779      '&sdot;' => '&#8901;', '&lceil;' => '&#8968;', '&rceil;' => '&#8969;', '&lfloor;' => '&#8970;',
 780      '&rfloor;' => '&#8971;', '&lang;' => '&#9001;',
 781      '&rang;' => '&#9002;', '&loz;' => '&#9674;', '&spades;' => '&#9824;', '&clubs;' => '&#9827;',
 782      '&hearts;' => '&#9829;', '&diams;' => '&#9830;'
 783  );
 784  
 785  
 786  /**

 787   * Translation of invalid Unicode references range to valid range.

 788   * These are Windows CP1252 specific characters.

 789   * They would look weird on non-Windows browsers.

 790   * If you've ever pasted text from MSWord, you'll understand.

 791   * @global array

 792   */
 793  $b2_htmltranswinuni = array(
 794      '&#128;' => '&#8364;', // the Euro sign
 795      '&#130;' => '&#8218;',
 796      '&#131;' => '&#402;',
 797      '&#132;' => '&#8222;',
 798      '&#133;' => '&#8230;',
 799      '&#134;' => '&#8224;',
 800      '&#135;' => '&#8225;',
 801      '&#136;' => '&#710;',
 802      '&#137;' => '&#8240;',
 803      '&#138;' => '&#352;',
 804      '&#139;' => '&#8249;',
 805      '&#140;' => '&#338;',
 806      '&#142;' => '&#382;',
 807      '&#145;' => '&#8216;',
 808      '&#146;' => '&#8217;',
 809      '&#147;' => '&#8220;',
 810      '&#148;' => '&#8221;',
 811      '&#149;' => '&#8226;',
 812      '&#150;' => '&#8211;',
 813      '&#151;' => '&#8212;',
 814      '&#152;' => '&#732;',
 815      '&#153;' => '&#8482;',
 816      '&#154;' => '&#353;',
 817      '&#155;' => '&#8250;',
 818      '&#156;' => '&#339;',
 819      '&#158;' => '&#382;',
 820      '&#159;' => '&#376;'
 821  );
 822  
 823  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics