修訂 | 6ed6dabcd8f1b9e0202a50e099510f539eefee6a (tree) |
---|---|
時間 | 2016-12-09 05:05:57 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2406 Include the HTML entitiy pattern of cache/entities.dat
'cache/entities.dat' had a fixed pattern created by
'plugin/update_entities.inc'.
So it should be an application logic shipped with PukiWiki itself.
@@ -1 +0,0 @@ | ||
1 | -(?=[a-zA-Z0-9]{2,8})(?:A(?:Elig|acute|circ|grave|lpha|ring|tilde|uml)|Beta|C(?:cedil|hi)|D(?:agger|elta)|E(?:TH|acute|circ|grave|psilon|ta|uml)|Gamma|I(?:acute|circ|grave|ota|uml)|Kappa|Lambda|Mu|N(?:tilde|u)|O(?:Elig|acute|circ|grave|m(?:ega|icron)|slash|tilde|uml)|P(?:hi|i|rime|si)|Rho|S(?:caron|igma)|T(?:HORN|au|heta)|U(?:acute|circ|grave|psilon|uml)|Xi|Y(?:acute|uml)|Zeta|a(?:acute|c(?:irc|ute)|elig|grave|l(?:efsym|pha)|mp|n(?:d|g)|pos|ring|symp|tilde|uml)|b(?:dquo|eta|rvbar|ull)|c(?:ap|cedil|e(?:dil|nt)|hi|irc|lubs|o(?:ng|py)|rarr|u(?:p|rren))|d(?:Arr|a(?:gger|rr)|e(?:g|lta)|i(?:ams|vide))|e(?:acute|circ|grave|m(?:pty|sp)|nsp|psilon|quiv|t(?:a|h)|u(?:ml|ro)|xist)|f(?:nof|orall|ra(?:c(?:1(?:2|4)|34)|sl))|g(?:amma|e|t)|h(?:Arr|arr|e(?:arts|llip))|i(?:acute|circ|excl|grave|mage|n(?:fin|t)|ota|quest|sin|uml)|kappa|l(?:Arr|a(?:mbda|ng|quo|rr)|ceil|dquo|e|floor|o(?:wast|z)|rm|s(?:aquo|quo)|t)|m(?:acr|dash|i(?:cro|ddot|nus)|u)|n(?:abla|bsp|dash|e|i|ot(?:in)?|sub|tilde|u)|o(?:acute|circ|elig|grave|line|m(?:ega|icron)|plus|r(?:d(?:f|m))?|slash|ti(?:lde|mes)|uml)|p(?:ar(?:a|t)|er(?:mil|p)|hi|i(?:v)?|lusmn|ound|r(?:ime|o(?:d|p))|si)|quot|r(?:Arr|a(?:dic|ng|quo|rr)|ceil|dquo|e(?:al|g)|floor|ho|lm|s(?:aquo|quo))|s(?:bquo|caron|dot|ect|hy|i(?:gma(?:f)?|m)|pades|u(?:b(?:e)?|m|p(?:1|2|3|e)?)|zlig)|t(?:au|h(?:e(?:re4|ta(?:sym)?)|insp|orn)|i(?:lde|mes)|rade)|u(?:Arr|a(?:cute|rr)|circ|grave|ml|psi(?:h|lon)|uml)|weierp|xi|y(?:acute|en|uml)|z(?:eta|w(?:j|nj))) | |
\ No newline at end of file |
@@ -0,0 +1,5 @@ | ||
1 | +<?php | |
2 | +// This pattern was created by 'plugin/update_entities.inc.php' | |
3 | +function get_html_entity_pattern() { | |
4 | + return '(?=[a-zA-Z0-9]{2,8})(?:A(?:Elig|acute|circ|grave|lpha|ring|tilde|uml)|Beta|C(?:cedil|hi)|D(?:agger|elta)|E(?:TH|acute|circ|grave|psilon|ta|uml)|Gamma|I(?:acute|circ|grave|ota|uml)|Kappa|Lambda|Mu|N(?:tilde|u)|O(?:Elig|acute|circ|grave|m(?:ega|icron)|slash|tilde|uml)|P(?:hi|i|rime|si)|Rho|S(?:caron|igma)|T(?:HORN|au|heta)|U(?:acute|circ|grave|psilon|uml)|Xi|Y(?:acute|uml)|Zeta|a(?:acute|c(?:irc|ute)|elig|grave|l(?:efsym|pha)|mp|n(?:d|g)|pos|ring|symp|tilde|uml)|b(?:dquo|eta|rvbar|ull)|c(?:ap|cedil|e(?:dil|nt)|hi|irc|lubs|o(?:ng|py)|rarr|u(?:p|rren))|d(?:Arr|a(?:gger|rr)|e(?:g|lta)|i(?:ams|vide))|e(?:acute|circ|grave|m(?:pty|sp)|nsp|psilon|quiv|t(?:a|h)|u(?:ml|ro)|xist)|f(?:nof|orall|ra(?:c(?:1(?:2|4)|34)|sl))|g(?:amma|e|t)|h(?:Arr|arr|e(?:arts|llip))|i(?:acute|circ|excl|grave|mage|n(?:fin|t)|ota|quest|sin|uml)|kappa|l(?:Arr|a(?:mbda|ng|quo|rr)|ceil|dquo|e|floor|o(?:wast|z)|rm|s(?:aquo|quo)|t)|m(?:acr|dash|i(?:cro|ddot|nus)|u)|n(?:abla|bsp|dash|e|i|ot(?:in)?|sub|tilde|u)|o(?:acute|circ|elig|grave|line|m(?:ega|icron)|plus|r(?:d(?:f|m))?|slash|ti(?:lde|mes)|uml)|p(?:ar(?:a|t)|er(?:mil|p)|hi|i(?:v)?|lusmn|ound|r(?:ime|o(?:d|p))|si)|quot|r(?:Arr|a(?:dic|ng|quo|rr)|ceil|dquo|e(?:al|g)|floor|ho|lm|s(?:aquo|quo))|s(?:bquo|caron|dot|ect|hy|i(?:gma(?:f)?|m)|pades|u(?:b(?:e)?|m|p(?:1|2|3|e)?)|zlig)|t(?:au|h(?:e(?:re4|ta(?:sym)?)|insp|orn)|i(?:lde|mes)|rade)|u(?:Arr|a(?:cute|rr)|circ|grave|ml|psi(?:h|lon)|uml)|weierp|xi|y(?:acute|en|uml)|z(?:eta|w(?:j|nj)))'; | |
5 | +} |
@@ -394,6 +394,11 @@ $NotePattern = '/\(\(((?:(?>(?:(?!\(\()(?!\)\)(?:[^\)]|$)).)+)|(?R))*)\)\)/x'; | ||
394 | 394 | require(DATA_HOME . 'rules.ini.php'); |
395 | 395 | |
396 | 396 | ///////////////////////////////////////////////// |
397 | +// Load HTML Entity pattern | |
398 | +// This pattern is created by 'plugin/update_entities.inc.php' | |
399 | +require(LIB_DIR . 'html_entities.php'); | |
400 | + | |
401 | +///////////////////////////////////////////////// | |
397 | 402 | // 初期設定(その他のグローバル変数) |
398 | 403 | |
399 | 404 | // 現在時刻 |
@@ -408,10 +413,7 @@ if ($usefacemark) $line_rules += $facemark_rules; | ||
408 | 413 | unset($facemark_rules); |
409 | 414 | |
410 | 415 | // 実体参照パターンおよびシステムで使用するパターンを$line_rulesに加える |
411 | -//$entity_pattern = '[a-zA-Z0-9]{2,8}'; | |
412 | -$entity_pattern = trim(join('', file(CACHE_DIR . 'entities.dat'))); | |
413 | - | |
414 | 416 | $line_rules = array_merge(array( |
415 | - '&(#[0-9]+|#x[0-9a-f]+|' . $entity_pattern . ');' => '&$1;', | |
417 | + '&(#[0-9]+|#x[0-9a-f]+|' . get_html_entity_pattern() . ');' => '&$1;', | |
416 | 418 | "\r" => '<br />' . "\n", /* 行末にチルダは改行 */ |
417 | 419 | ), $line_rules); |
@@ -1,7 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: update_entities.inc.php,v 1.15 2007/04/08 10:29:24 henoheno Exp $ | |
4 | -// Copyright (C) 2003-2007 PukiWiki Developers Team | |
3 | +// update_entities.inc.php | |
4 | +// Copyright | |
5 | +// 2003-2007 PukiWiki Development Team | |
5 | 6 | // License: GPL v2 or (at your option) any later version |
6 | 7 | // |
7 | 8 | // Update entities plugin - Update XHTML entities from DTD |
@@ -119,4 +120,3 @@ function plugin_update_entities_create($do = FALSE) | ||
119 | 120 | |
120 | 121 | return $items; |
121 | 122 | } |
122 | -?> |