Advertisement
Guest User

CloCkWeRX

a guest
Oct 27th, 2008
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.74 KB | None | 0 0
  1. Index: Text/Wiki/Parse/BBCode/Blockquote.php
  2. ===================================================================
  3. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Blockquote.php,v
  4. retrieving revision 1.4
  5. diff -u -r1.4 Blockquote.php
  6. --- Text/Wiki/Parse/BBCode/Blockquote.php 21 Feb 2006 22:47:53 -0000 1.4
  7. +++ Text/Wiki/Parse/BBCode/Blockquote.php 27 Oct 2008 16:09:32 -0000
  8. @@ -10,28 +10,29 @@
  9. *
  10. * PHP versions 4 and 5
  11. *
  12. - * @category Text
  13. - * @package Text_Wiki
  14. - * @author Bertrand Gugger <bertrand@toggg.com>
  15. - * @copyright 2005 bertrand Gugger
  16. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  17. - * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  18. - * @link http://pear.php.net/package/Text_Wiki
  19. + * @category Text
  20. + * @package Text_Wiki
  21. + * @author Bertrand Gugger <bertrand@toggg.com>
  22. + * @copyright 2005 bertrand Gugger
  23. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  24. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  25. + * @link http://pear.php.net/package/Text_Wiki
  26. */
  27.  
  28. /**
  29. * Block-quoted text rule parser class (with nesting) for BBCode.
  30. *
  31. - * @category Text
  32. - * @package Text_Wiki
  33. - * @author Bertrand Gugger <bertrand@toggg.com>
  34. - * @copyright 2005 bertrand Gugger
  35. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  36. - * @version Release: @package_version@
  37. - * @link http://pear.php.net/package/Text_Wiki
  38. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  39. + * @category Text
  40. + * @package Text_Wiki
  41. + * @author Bertrand Gugger <bertrand@toggg.com>
  42. + * @copyright 2005 bertrand Gugger
  43. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  44. + * @version Release: @package_version@
  45. + * @link http://pear.php.net/package/Text_Wiki
  46. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  47. */
  48. -class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse {
  49. +class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse
  50. +{
  51.  
  52. /**
  53. * The regular expression used to parse the source text and find
  54. @@ -60,6 +61,7 @@
  55. * - 'name' => the author indicator (optional)
  56. *
  57. * @param array &$matches The array of matches from parse().
  58. + *
  59. * @return string Delimited by start/end tokens to be used as
  60. * placeholder in the source text surrounding the text to be quoted.
  61. * @access public
  62. @@ -69,11 +71,9 @@
  63. // nested block ?
  64. if (array_key_exists(3, $matches)) {
  65. $this->_level++;
  66. - $expsub = preg_replace_callback(
  67. - $this->regex,
  68. - array(&$this, 'process'),
  69. - $matches[2]
  70. - );
  71. + $expsub = preg_replace_callback($this->regex,
  72. + array(&$this, 'process'),
  73. + $matches[2]);
  74. $this->_level--;
  75. } else {
  76. $expsub = $matches[2];
  77. @@ -84,7 +84,9 @@
  78. if (isset($matches[1])) {
  79. $options['name'] = $matches[1];
  80. }
  81. +
  82. $statok = $this->wiki->addToken($this->rule, $options);
  83. +
  84. $options['type'] = 'end';
  85. return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
  86. }
  87. Index: Text/Wiki/Parse/BBCode/Bold.php
  88. ===================================================================
  89. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Bold.php,v
  90. retrieving revision 1.3
  91. diff -u -r1.3 Bold.php
  92. --- Text/Wiki/Parse/BBCode/Bold.php 21 Feb 2006 22:47:53 -0000 1.3
  93. +++ Text/Wiki/Parse/BBCode/Bold.php 27 Oct 2008 16:09:32 -0000
  94. @@ -10,28 +10,29 @@
  95. *
  96. * PHP versions 4 and 5
  97. *
  98. - * @category Text
  99. - * @package Text_Wiki
  100. - * @author Bertrand Gugger <bertrand@toggg.com>
  101. - * @copyright 2005 bertrand Gugger
  102. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  103. - * @version CVS: $Id: Bold.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
  104. - * @link http://pear.php.net/package/Text_Wiki
  105. + * @category Text
  106. + * @package Text_Wiki
  107. + * @author Bertrand Gugger <bertrand@toggg.com>
  108. + * @copyright 2005 bertrand Gugger
  109. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  110. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  111. + * @link http://pear.php.net/package/Text_Wiki
  112. */
  113.  
  114. /**
  115. * Bold text rule parser class for BBCode.
  116. *
  117. - * @category Text
  118. - * @package Text_Wiki
  119. - * @author Bertrand Gugger <bertrand@toggg.com>
  120. - * @copyright 2005 bertrand Gugger
  121. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  122. - * @version Release: @package_version@
  123. - * @link http://pear.php.net/package/Text_Wiki
  124. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  125. + * @category Text
  126. + * @package Text_Wiki
  127. + * @author Bertrand Gugger <bertrand@toggg.com>
  128. + * @copyright 2005 bertrand Gugger
  129. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  130. + * @version Release: @package_version@
  131. + * @link http://pear.php.net/package/Text_Wiki
  132. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  133. */
  134. -class Text_Wiki_Parse_Bold extends Text_Wiki_Parse {
  135. +class Text_Wiki_Parse_Bold extends Text_Wiki_Parse
  136. +{
  137.  
  138. /**
  139. * The regular expression used to parse the source text and find
  140. @@ -50,6 +51,7 @@
  141. * emphasized text. The text itself is left in the source.
  142. *
  143. * @param array &$matches The array of matches from parse().
  144. + *
  145. * @return A pair of delimited tokens to be used as a placeholder in
  146. * the source text surrounding the text to be emphasized.
  147. * @access public
  148. @@ -57,7 +59,7 @@
  149. function process(&$matches)
  150. {
  151. $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
  152. - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  153. + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  154. return $start . $matches[1] . $end;
  155. }
  156. }
  157. Index: Text/Wiki/Parse/BBCode/Code.php
  158. ===================================================================
  159. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Code.php,v
  160. retrieving revision 1.3
  161. diff -u -r1.3 Code.php
  162. --- Text/Wiki/Parse/BBCode/Code.php 21 Feb 2006 22:47:53 -0000 1.3
  163. +++ Text/Wiki/Parse/BBCode/Code.php 27 Oct 2008 16:09:32 -0000
  164. @@ -10,28 +10,29 @@
  165. *
  166. * PHP versions 4 and 5
  167. *
  168. - * @category Text
  169. - * @package Text_Wiki
  170. - * @author Bertrand Gugger <bertrand@toggg.com>
  171. - * @copyright 2005 bertrand Gugger
  172. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  173. - * @version CVS: $Id: Code.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
  174. - * @link http://pear.php.net/package/Text_Wiki
  175. + * @category Text
  176. + * @package Text_Wiki
  177. + * @author Bertrand Gugger <bertrand@toggg.com>
  178. + * @copyright 2005 bertrand Gugger
  179. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  180. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  181. + * @link http://pear.php.net/package/Text_Wiki
  182. */
  183.  
  184. /**
  185. * Code block rule parser class for BBCode.
  186. *
  187. - * @category Text
  188. - * @package Text_Wiki
  189. - * @author Bertrand Gugger <bertrand@toggg.com>
  190. - * @copyright 2005 bertrand Gugger
  191. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  192. - * @version Release: @package_version@
  193. - * @link http://pear.php.net/package/Text_Wiki
  194. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  195. + * @category Text
  196. + * @package Text_Wiki
  197. + * @author Bertrand Gugger <bertrand@toggg.com>
  198. + * @copyright 2005 bertrand Gugger
  199. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  200. + * @version Release: @package_version@
  201. + * @link http://pear.php.net/package/Text_Wiki
  202. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  203. */
  204. -class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
  205. +class Text_Wiki_Parse_Code extends Text_Wiki_Parse
  206. +{
  207.  
  208. /**
  209. * The regular expression used to parse the source text and find
  210. @@ -50,6 +51,7 @@
  211. * - 'attr' => type empty
  212. *
  213. * @param array &$matches The array of matches from parse().
  214. + *
  215. * @return A delimited token to be used as a placeholder in
  216. * the source text and containing the original block of text
  217. * @access public
  218. @@ -58,6 +60,6 @@
  219. {
  220. return $this->wiki->addToken($this->rule, array(
  221. 'text' => $matches[1],
  222. - 'attr' => array('type' => '') ) );
  223. + 'attr' => array('type' => '')));
  224. }
  225. }
  226. Index: Text/Wiki/Parse/BBCode/Colortext.php
  227. ===================================================================
  228. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Colortext.php,v
  229. retrieving revision 1.5
  230. diff -u -r1.5 Colortext.php
  231. --- Text/Wiki/Parse/BBCode/Colortext.php 21 Feb 2006 22:47:53 -0000 1.5
  232. +++ Text/Wiki/Parse/BBCode/Colortext.php 27 Oct 2008 16:09:33 -0000
  233. @@ -10,28 +10,29 @@
  234. *
  235. * PHP versions 4 and 5
  236. *
  237. - * @category Text
  238. - * @package Text_Wiki
  239. - * @author Bertrand Gugger <bertrand@toggg.com>
  240. - * @copyright 2005 bertrand Gugger
  241. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  242. - * @version CVS: $Id: Colortext.php,v 1.5 2006/02/21 22:47:53 toggg Exp $
  243. - * @link http://pear.php.net/package/Text_Wiki
  244. + * @category Text
  245. + * @package Text_Wiki
  246. + * @author Bertrand Gugger <bertrand@toggg.com>
  247. + * @copyright 2005 bertrand Gugger
  248. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  249. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  250. + * @link http://pear.php.net/package/Text_Wiki
  251. */
  252.  
  253. /**
  254. * Colored text rule parser class (with nesting) for BBCode.
  255. *
  256. - * @category Text
  257. - * @package Text_Wiki
  258. - * @author Bertrand Gugger <bertrand@toggg.com>
  259. - * @copyright 2005 bertrand Gugger
  260. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  261. - * @version Release: @package_version@
  262. - * @link http://pear.php.net/package/Text_Wiki
  263. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  264. + * @category Text
  265. + * @package Text_Wiki
  266. + * @author Bertrand Gugger <bertrand@toggg.com>
  267. + * @copyright 2005 bertrand Gugger
  268. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  269. + * @version Release: @package_version@
  270. + * @link http://pear.php.net/package/Text_Wiki
  271. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  272. */
  273. -class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
  274. +class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse
  275. +{
  276.  
  277. /**
  278. * The regular expression used to parse the source text and find
  279. @@ -61,6 +62,7 @@
  280. * - 'color' => the color indicator
  281. *
  282. * @param array &$matches The array of matches from parse().
  283. + *
  284. * @return string Delimited by start/end tokens to be used as
  285. * placeholder in the source text surrounding the text to be colored.
  286. * @access public
  287. @@ -70,11 +72,9 @@
  288. // nested block ?
  289. if (array_key_exists(2, $matches)) {
  290. $this->_level++;
  291. - $expsub = preg_replace_callback(
  292. - $this->regex,
  293. - array(&$this, 'process'),
  294. - $matches[2]
  295. - );
  296. + $expsub = preg_replace_callback($this->regex,
  297. + array(&$this, 'process'),
  298. + $matches[2]);
  299. $this->_level--;
  300. } else {
  301. $expsub = $matches[2];
  302. @@ -85,7 +85,9 @@
  303.  
  304. // builds the option array
  305. $options = array('type' => 'start', 'level' => $this->_level, 'color' => $color);
  306. +
  307. $statok = $this->wiki->addToken($this->rule, $options);
  308. +
  309. $options['type'] = 'end';
  310. return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
  311. }
  312. Index: Text/Wiki/Parse/BBCode/Font.php
  313. ===================================================================
  314. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Font.php,v
  315. retrieving revision 1.4
  316. diff -u -r1.4 Font.php
  317. --- Text/Wiki/Parse/BBCode/Font.php 21 Feb 2006 22:47:53 -0000 1.4
  318. +++ Text/Wiki/Parse/BBCode/Font.php 27 Oct 2008 16:09:33 -0000
  319. @@ -10,28 +10,29 @@
  320. *
  321. * PHP versions 4 and 5
  322. *
  323. - * @category Text
  324. - * @package Text_Wiki
  325. - * @author Bertrand Gugger <bertrand@toggg.com>
  326. - * @copyright 2005 bertrand Gugger
  327. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  328. - * @version CVS: $Id: Font.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  329. - * @link http://pear.php.net/package/Text_Wiki
  330. + * @category Text
  331. + * @package Text_Wiki
  332. + * @author Bertrand Gugger <bertrand@toggg.com>
  333. + * @copyright 2005 bertrand Gugger
  334. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  335. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  336. + * @link http://pear.php.net/package/Text_Wiki
  337. */
  338.  
  339. /**
  340. * Font rule parser class (with nesting) for BBCode. ([size=...]...[/size])
  341. *
  342. - * @category Text
  343. - * @package Text_Wiki
  344. - * @author Bertrand Gugger <bertrand@toggg.com>
  345. - * @copyright 2005 bertrand Gugger
  346. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  347. - * @version Release: @package_version@
  348. - * @link http://pear.php.net/package/Text_Wiki
  349. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  350. + * @category Text
  351. + * @package Text_Wiki
  352. + * @author Bertrand Gugger <bertrand@toggg.com>
  353. + * @copyright 2005 bertrand Gugger
  354. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  355. + * @version Release: @package_version@
  356. + * @link http://pear.php.net/package/Text_Wiki
  357. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  358. */
  359. -class Text_Wiki_Parse_Font extends Text_Wiki_Parse {
  360. +class Text_Wiki_Parse_Font extends Text_Wiki_Parse
  361. +{
  362.  
  363. /**
  364. * The regular expression used to parse the source text and find
  365. @@ -59,6 +60,7 @@
  366. * - 'size' => the size indicator
  367. *
  368. * @param array &$matches The array of matches from parse().
  369. + *
  370. * @return string Delimited by start/end tokens to be used as
  371. * placeholder in the source text surrounding the text to be sized.
  372. * @access public
  373. @@ -68,11 +70,9 @@
  374. // nested block ?
  375. if (array_key_exists(3, $matches)) {
  376. $this->_level++;
  377. - $expsub = preg_replace_callback(
  378. - $this->regex,
  379. - array(&$this, 'process'),
  380. - $matches[2]
  381. - );
  382. + $expsub = preg_replace_callback($this->regex,
  383. + array(&$this, 'process'),
  384. + $matches[2]);
  385. $this->_level--;
  386. } else {
  387. $expsub = $matches[2];
  388. @@ -80,7 +80,9 @@
  389.  
  390. // builds the option array
  391. $options = array('type' => 'start', 'level' => $this->_level, 'size' => $matches[1]);
  392. +
  393. $statok = $this->wiki->addToken($this->rule, $options);
  394. +
  395. $options['type'] = 'end';
  396. return $statok . $expsub . $this->wiki->addToken($this->rule, $options);
  397. }
  398. Index: Text/Wiki/Parse/BBCode/Image.php
  399. ===================================================================
  400. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Image.php,v
  401. retrieving revision 1.6
  402. diff -u -r1.6 Image.php
  403. --- Text/Wiki/Parse/BBCode/Image.php 21 Feb 2006 22:47:53 -0000 1.6
  404. +++ Text/Wiki/Parse/BBCode/Image.php 27 Oct 2008 16:09:33 -0000
  405. @@ -9,28 +9,29 @@
  406. *
  407. * PHP versions 4 and 5
  408. *
  409. - * @category Text
  410. - * @package Text_Wiki
  411. - * @author Bertrand Gugger <bertrand@toggg.com>
  412. - * @copyright 2005 bertrand Gugger
  413. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  414. - * @version CVS: $Id: Image.php,v 1.6 2006/02/21 22:47:53 toggg Exp $
  415. - * @link http://pear.php.net/package/Text_Wiki
  416. + * @category Text
  417. + * @package Text_Wiki
  418. + * @author Bertrand Gugger <bertrand@toggg.com>
  419. + * @copyright 2005 bertrand Gugger
  420. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  421. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  422. + * @link http://pear.php.net/package/Text_Wiki
  423. */
  424.  
  425. /**
  426. * Image rule parser class for BBCode.
  427. *
  428. - * @category Text
  429. - * @package Text_Wiki
  430. - * @author Bertrand Gugger <bertrand@toggg.com>
  431. - * @copyright 2005 bertrand Gugger
  432. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  433. - * @version Release: @package_version@
  434. - * @link http://pear.php.net/package/Text_Wiki
  435. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  436. + * @category Text
  437. + * @package Text_Wiki
  438. + * @author Bertrand Gugger <bertrand@toggg.com>
  439. + * @copyright 2005 bertrand Gugger
  440. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  441. + * @version Release: @package_version@
  442. + * @link http://pear.php.net/package/Text_Wiki
  443. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  444. */
  445. -class Text_Wiki_Parse_Image extends Text_Wiki_Parse {
  446. +class Text_Wiki_Parse_Image extends Text_Wiki_Parse
  447. +{
  448.  
  449. /**
  450. * Configuration keys for this rule
  451. @@ -52,11 +53,12 @@
  452. 'local_regexp' => '(?:/?[^/\s"<\\\#delim#\ca-\cz]+)*'
  453. );
  454.  
  455. - /**
  456. + /**
  457. * Constructor.
  458. * We override the constructor to build up the regex from config
  459. *
  460. * @param object &$obj the base conversion handler
  461. + *
  462. * @return The parser object
  463. * @access public
  464. */
  465. @@ -67,12 +69,22 @@
  466.  
  467. // convert the list of recognized schemes to a regex OR,
  468. $schemes = $this->getConf('schemes', $default['schemes']);
  469. - $this->regex = '#\[img]((?:(?:' . (is_array($schemes) ? implode('|', $schemes) : $schemes) . ')://' .
  470. +
  471. + $schemes_regex = is_array($schemes) ? implode('|', $schemes) : $schemes;
  472. +
  473. + $this->regex = '#\[img]((?:(?:' . $schemes_regex . ')://' .
  474. $this->getConf('url_regexp', $default['url_regexp']);
  475. +
  476. if ($local = $this->getConf('local_regexp', $default['local_regexp'])) {
  477. - $this->regex .= '|' . ( is_array($local) ? implode('|', $local) : $local );
  478. + $this->regex .= '|';
  479. + if (is_array($local)) {
  480. + $this->regex .= implode('|', $local);
  481. + } else {
  482. + $this->regex .= $local;
  483. + }
  484. }
  485. $this->regex .= ')';
  486. +
  487. // add the extensions if any
  488. if ($extensions = $this->getConf('extensions', array())) {
  489. if (is_array($extensions)) {
  490. @@ -80,8 +92,9 @@
  491. }
  492. $this->regex .= '\.(?:' . $extensions . ')';
  493. }
  494. +
  495. // replace delim in the regexps
  496. - $this->regex = str_replace( '#delim#', $this->wiki->delim, $this->regex);
  497. + $this->regex = str_replace('#delim#', $this->wiki->delim, $this->regex);
  498. $this->regex .= ')\[/img]#i';
  499. }
  500.  
  501. @@ -91,6 +104,7 @@
  502. * 'attr' => empty for basic BBCode
  503. *
  504. * @param array &$matches The array of matches from parse().
  505. + *
  506. * @return string Delimited token representing the image
  507. * @access public
  508. */
  509. Index: Text/Wiki/Parse/BBCode/Italic.php
  510. ===================================================================
  511. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Italic.php,v
  512. retrieving revision 1.3
  513. diff -u -r1.3 Italic.php
  514. --- Text/Wiki/Parse/BBCode/Italic.php 21 Feb 2006 22:47:53 -0000 1.3
  515. +++ Text/Wiki/Parse/BBCode/Italic.php 27 Oct 2008 16:09:33 -0000
  516. @@ -10,28 +10,29 @@
  517. *
  518. * PHP versions 4 and 5
  519. *
  520. - * @category Text
  521. - * @package Text_Wiki
  522. - * @author Bertrand Gugger <bertrand@toggg.com>
  523. - * @copyright 2005 bertrand Gugger
  524. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  525. - * @version CVS: $Id: Italic.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
  526. - * @link http://pear.php.net/package/Text_Wiki
  527. + * @category Text
  528. + * @package Text_Wiki
  529. + * @author Bertrand Gugger <bertrand@toggg.com>
  530. + * @copyright 2005 bertrand Gugger
  531. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  532. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  533. + * @link http://pear.php.net/package/Text_Wiki
  534. */
  535.  
  536. /**
  537. * Italic text rule parser class for BBCode.
  538. *
  539. - * @category Text
  540. - * @package Text_Wiki
  541. - * @author Bertrand Gugger <bertrand@toggg.com>
  542. - * @copyright 2005 bertrand Gugger
  543. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  544. - * @version Release: @package_version@
  545. - * @link http://pear.php.net/package/Text_Wiki
  546. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  547. + * @category Text
  548. + * @package Text_Wiki
  549. + * @author Bertrand Gugger <bertrand@toggg.com>
  550. + * @copyright 2005 bertrand Gugger
  551. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  552. + * @version Release: @package_version@
  553. + * @link http://pear.php.net/package/Text_Wiki
  554. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  555. */
  556. -class Text_Wiki_Parse_Italic extends Text_Wiki_Parse {
  557. +class Text_Wiki_Parse_Italic extends Text_Wiki_Parse
  558. +{
  559.  
  560. /**
  561. * The regular expression used to parse the source text and find
  562. @@ -49,6 +50,7 @@
  563. * emphasized text. The text itself is left in the source.
  564. *
  565. * @param array &$matches The array of matches from parse().
  566. + *
  567. * @return A pair of delimited tokens to be used as a placeholder in
  568. * the source text surrounding the text to be emphasized.
  569. * @access public
  570. @@ -56,7 +58,7 @@
  571. function process(&$matches)
  572. {
  573. $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
  574. - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  575. + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  576. return $start . $matches[1] . $end;
  577. }
  578. }
  579. Index: Text/Wiki/Parse/BBCode/List.php
  580. ===================================================================
  581. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/List.php,v
  582. retrieving revision 1.6
  583. diff -u -r1.6 List.php
  584. --- Text/Wiki/Parse/BBCode/List.php 22 Dec 2006 14:43:06 -0000 1.6
  585. +++ Text/Wiki/Parse/BBCode/List.php 27 Oct 2008 16:09:33 -0000
  586. @@ -11,28 +11,29 @@
  587. *
  588. * PHP versions 4 and 5
  589. *
  590. - * @category Text
  591. - * @package Text_Wiki
  592. - * @author Bertrand Gugger <bertrand@toggg.com>
  593. - * @copyright 2005 bertrand Gugger
  594. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  595. - * @version CVS: $Id: List.php,v 1.6 2006/12/22 14:43:06 toggg Exp $
  596. - * @link http://pear.php.net/package/Text_Wiki
  597. + * @category Text
  598. + * @package Text_Wiki
  599. + * @author Bertrand Gugger <bertrand@toggg.com>
  600. + * @copyright 2005 bertrand Gugger
  601. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  602. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  603. + * @link http://pear.php.net/package/Text_Wiki
  604. */
  605.  
  606. /**
  607. * List rule parser class for BBCode.
  608. *
  609. - * @category Text
  610. - * @package Text_Wiki
  611. - * @author Bertrand Gugger <bertrand@toggg.com>
  612. - * @copyright 2005 bertrand Gugger
  613. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  614. - * @version Release: @package_version@
  615. - * @link http://pear.php.net/package/Text_Wiki
  616. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  617. + * @category Text
  618. + * @package Text_Wiki
  619. + * @author Bertrand Gugger <bertrand@toggg.com>
  620. + * @copyright 2005 bertrand Gugger
  621. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  622. + * @version Release: @package_version@
  623. + * @link http://pear.php.net/package/Text_Wiki
  624. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  625. */
  626. -class Text_Wiki_Parse_List extends Text_Wiki_Parse {
  627. +class Text_Wiki_Parse_List extends Text_Wiki_Parse
  628. +{
  629.  
  630. /**
  631. * The regular expression used to parse the source text and find
  632. @@ -102,6 +103,7 @@
  633. * 'key' => the optional starting number/letter (not for items)
  634. *
  635. * @param array &$matches The array of matches from parse().
  636. + *
  637. * @return A delimited token to be used as a placeholder in
  638. * the source text and containing the original block of text
  639. * @access public
  640. @@ -110,11 +112,9 @@
  641. {
  642. if (!empty($matches[3])) {
  643. $this->_level++;
  644. - $expsub = preg_replace_callback(
  645. - $this->regex,
  646. - array(&$this, 'process'),
  647. - $matches[2]
  648. - );
  649. + $expsub = preg_replace_callback($this->regex,
  650. + array(&$this, 'process'),
  651. + $matches[2]);
  652. $this->_level--;
  653. } else {
  654. $expsub = $matches[2];
  655. @@ -123,26 +123,28 @@
  656. $this->_type[$this->_level] = 'number';
  657. if (is_numeric($matches[1])) {
  658. $format = '1';
  659. +
  660. $key = $matches[1] + 0;
  661. } elseif (($matches[1] == 'i') || ($matches[1] == 'I')) {
  662. $format = $matches[1];
  663. } else {
  664. - $format =
  665. - ($matches[1] >= 'a') && ($matches[1] <='z') ? 'a' : 'A';
  666. + $format = ($matches[1] >= 'a') && ($matches[1] <='z') ? 'a' : 'A';
  667. +
  668. $key = $matches[1];
  669. }
  670. } else {
  671. $this->_type[$this->_level] = 'bullet';
  672. }
  673. +
  674. $this->_count[$this->_level] = -1;
  675. - $sub = preg_replace_callback(
  676. - $this->regexElement,
  677. - array(&$this, 'processElement'),
  678. - $expsub
  679. - );
  680. - $param = array(
  681. - 'level' => $this->_level,
  682. - 'count' => $this->_count[$this->_level] );
  683. +
  684. + $sub = preg_replace_callback($this->regexElement,
  685. + array(&$this, 'processElement'),
  686. + $expsub);
  687. +
  688. + $param = array('level' => $this->_level,
  689. + 'count' => $this->_count[$this->_level]);
  690. +
  691. $param['type'] = $this->_type[$this->_level].'_list_start';
  692. if (isset($format)) {
  693. $param['format'] = $format;
  694. @@ -150,9 +152,12 @@
  695. if (isset($key)) {
  696. $param['key'] = $key;
  697. }
  698. - $ret = $this->wiki->addToken($this->rule, $param );
  699. +
  700. + $ret = $this->wiki->addToken($this->rule, $param);
  701. +
  702. $param['type'] = $this->_type[$this->_level].'_list_end';
  703. - return $ret . $sub . $this->wiki->addToken($this->rule, $param );
  704. +
  705. + return $ret . $sub . $this->wiki->addToken($this->rule, $param);
  706. }
  707.  
  708. /**
  709. @@ -168,6 +173,7 @@
  710. * 'count' => the item ordeer at this level.
  711. *
  712. * @param array &$matches The array of matches from parse().
  713. + *
  714. * @return A delimited token to be used as a placeholder in
  715. * the source text and containing the original block of text
  716. * @access public
  717. @@ -177,11 +183,11 @@
  718. return $this->wiki->addToken($this->rule, array(
  719. 'type' => $this->_type[$this->_level] . '_item_start',
  720. 'level' => $this->_level,
  721. - 'count' => ++$this->_count[$this->_level]) ) .
  722. + 'count' => ++$this->_count[$this->_level])) .
  723. rtrim($matches[1]) .
  724. $this->wiki->addToken($this->rule, array(
  725. 'type' => $this->_type[$this->_level] . '_item_end',
  726. 'level' => $this->_level,
  727. - 'count' => $this->_count[$this->_level]) );
  728. + 'count' => $this->_count[$this->_level]));
  729. }
  730. }
  731. Index: Text/Wiki/Parse/BBCode/Subscript.php
  732. ===================================================================
  733. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Subscript.php,v
  734. retrieving revision 1.2
  735. diff -u -r1.2 Subscript.php
  736. --- Text/Wiki/Parse/BBCode/Subscript.php 21 Feb 2006 22:47:53 -0000 1.2
  737. +++ Text/Wiki/Parse/BBCode/Subscript.php 27 Oct 2008 16:09:33 -0000
  738. @@ -1,7 +1,7 @@
  739. <?php
  740. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
  741.  
  742. -// {{{ Header
  743. +
  744.  
  745. /**
  746. * BBCode: Parses for subscript text.
  747. @@ -13,28 +13,31 @@
  748. *
  749. * PHP versions 4 and 5
  750. *
  751. - * @category Text
  752. - * @package Text_Wiki
  753. - * @author Firman Wandayandi <firman@php.net>
  754. + * @category Text
  755. + * @package Text_Wiki
  756. + * @author Firman Wandayandi <firman@php.net>
  757. * @copyright 2005 bertrand Gugger
  758. - * @license http://www.gnu.org/copyleft/lgpl.html
  759. - * GNU Lesser General Public License, version 2.1
  760. - * @version CVS: $Id: Subscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
  761. + * @license http://www.gnu.org/copyleft/lgpl.html
  762. + * GNU Lesser General Public License, version 2.1
  763. + * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
  764. + * @link http://pear.php.net/package/Text_Wiki
  765. +
  766. */
  767.  
  768. -// }}}
  769. +
  770. // {{{ Class: Text_Wiki_Parse_Subscript
  771.  
  772. /**
  773. * Subscript text rule parser class for BBCode.
  774. *
  775. - * @category Text
  776. - * @package Text_Wiki
  777. - * @author Firman Wandayandi <firman@php.net>
  778. + * @category Text
  779. + * @package Text_Wiki
  780. + * @author Firman Wandayandi <firman@php.net>
  781. * @copyright 2005 bertrand Gugger
  782. - * @license http://www.gnu.org/copyleft/lgpl.html
  783. - * GNU Lesser General Public License, version 2.1
  784. - * @version Release: @package_version@
  785. + * @license http://www.gnu.org/copyleft/lgpl.html
  786. + * GNU Lesser General Public License, version 2.1
  787. + * @version Release: @package_version@
  788. + * @link http://pear.php.net/package/Text_Wiki
  789. */
  790. class Text_Wiki_Parse_Subscript extends Text_Wiki_Parse
  791. {
  792. @@ -59,6 +62,7 @@
  793. * emphasized text. The text itself is left in the source.
  794. *
  795. * @param array &$matches The array of matches from parse().
  796. + *
  797. * @return A pair of delimited tokens to be used as a placeholder in
  798. * the source text surrounding the text to be emphasized.
  799. * @access public
  800. @@ -66,7 +70,7 @@
  801. function process(&$matches)
  802. {
  803. $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
  804. - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  805. + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  806. return $start . $matches[1] . $end;
  807. }
  808.  
  809. Index: Text/Wiki/Parse/BBCode/Superscript.php
  810. ===================================================================
  811. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Superscript.php,v
  812. retrieving revision 1.2
  813. diff -u -r1.2 Superscript.php
  814. --- Text/Wiki/Parse/BBCode/Superscript.php 21 Feb 2006 22:47:53 -0000 1.2
  815. +++ Text/Wiki/Parse/BBCode/Superscript.php 27 Oct 2008 16:09:33 -0000
  816. @@ -1,8 +1,5 @@
  817. <?php
  818. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
  819. -
  820. -// {{{ Header
  821. -
  822. /**
  823. * BBCode: Parses for superscript text.
  824. *
  825. @@ -13,28 +10,29 @@
  826. *
  827. * PHP versions 4 and 5
  828. *
  829. - * @category Text
  830. - * @package Text_Wiki
  831. - * @author Firman Wandayandi <firman@php.net>
  832. + * @category Text
  833. + * @package Text_Wiki
  834. + * @author Firman Wandayandi <firman@php.net>
  835. * @copyright 2005 bertrand Gugger
  836. - * @license http://www.gnu.org/copyleft/lgpl.html
  837. - * GNU Lesser General Public License, version 2.1
  838. - * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
  839. + * @license http://www.gnu.org/copyleft/lgpl.html
  840. + * GNU Lesser General Public License, version 2.1
  841. + * @version CVS: $Id: Superscript.php,v 1.2 2006/02/21 22:47:53 toggg Exp $
  842. + * @link http://pear.php.net/package/Text_Wiki
  843. */
  844.  
  845. -// }}}
  846. // {{{ Class: Text_Wiki_Parse_Superscript
  847.  
  848. /**
  849. * Superscript text rule parser class for BBCode.
  850. *
  851. - * @category Text
  852. - * @package Text_Wiki
  853. - * @author Firman Wandayandi <firman@php.net>
  854. + * @category Text
  855. + * @package Text_Wiki
  856. + * @author Firman Wandayandi <firman@php.net>
  857. * @copyright 2005 bertrand Gugger
  858. - * @license http://www.gnu.org/copyleft/lgpl.html
  859. - * GNU Lesser General Public License, version 2.1
  860. - * @version Release: @package_version@
  861. + * @license http://www.gnu.org/copyleft/lgpl.html
  862. + * GNU Lesser General Public License, version 2.1
  863. + * @version Release: @package_version@
  864. + * @link http://pear.php.net/package/Text_Wiki
  865. */
  866. class Text_Wiki_Parse_Superscript extends Text_Wiki_Parse
  867. {
  868. @@ -58,6 +56,7 @@
  869. * emphasized text. The text itself is left in the source.
  870. *
  871. * @param array &$matches The array of matches from parse().
  872. + *
  873. * @return A pair of delimited tokens to be used as a placeholder in
  874. * the source text surrounding the text to be emphasized.
  875. * @access public
  876. @@ -65,7 +64,7 @@
  877. function process(&$matches)
  878. {
  879. $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
  880. - $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  881. + $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  882. return $start . $matches[1] . $end;
  883. }
  884.  
  885. Index: Text/Wiki/Parse/BBCode/Underline.php
  886. ===================================================================
  887. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Underline.php,v
  888. retrieving revision 1.3
  889. diff -u -r1.3 Underline.php
  890. --- Text/Wiki/Parse/BBCode/Underline.php 21 Feb 2006 22:47:53 -0000 1.3
  891. +++ Text/Wiki/Parse/BBCode/Underline.php 27 Oct 2008 16:09:33 -0000
  892. @@ -10,28 +10,29 @@
  893. *
  894. * PHP versions 4 and 5
  895. *
  896. - * @category Text
  897. - * @package Text_Wiki
  898. - * @author Bertrand Gugger <bertrand@toggg.com>
  899. - * @copyright 2005 bertrand Gugger
  900. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  901. - * @version CVS: $Id: Underline.php,v 1.3 2006/02/21 22:47:53 toggg Exp $
  902. - * @link http://pear.php.net/package/Text_Wiki
  903. + * @category Text
  904. + * @package Text_Wiki
  905. + * @author Bertrand Gugger <bertrand@toggg.com>
  906. + * @copyright 2005 bertrand Gugger
  907. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  908. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  909. + * @link http://pear.php.net/package/Text_Wiki
  910. */
  911.  
  912. /**
  913. * Underlined text rule parser class for BBCode.
  914. *
  915. - * @category Text
  916. - * @package Text_Wiki
  917. - * @author Bertrand Gugger <bertrand@toggg.com>
  918. - * @copyright 2005 bertrand Gugger
  919. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  920. - * @version Release: @package_version@
  921. - * @link http://pear.php.net/package/Text_Wiki
  922. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  923. + * @category Text
  924. + * @package Text_Wiki
  925. + * @author Bertrand Gugger <bertrand@toggg.com>
  926. + * @copyright 2005 bertrand Gugger
  927. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  928. + * @version Release: @package_version@
  929. + * @link http://pear.php.net/package/Text_Wiki
  930. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  931. */
  932. -class Text_Wiki_Parse_Underline extends Text_Wiki_Parse {
  933. +class Text_Wiki_Parse_Underline extends Text_Wiki_Parse
  934. +{
  935.  
  936. /**
  937. * The regular expression used to parse the source text and find
  938. @@ -50,6 +51,7 @@
  939. * emphasized text. The text itself is left in the source.
  940. *
  941. * @param array &$matches The array of matches from parse().
  942. + *
  943. * @return A pair of delimited tokens to be used as a placeholder in
  944. * the source text surrounding the text to be emphasized.
  945. * @access public
  946. @@ -57,6 +59,7 @@
  947. function process(&$matches)
  948. {
  949. $start = $this->wiki->addToken($this->rule, array('type' => 'start'));
  950. +
  951. $end = $this->wiki->addToken($this->rule, array('type' => 'end'));
  952. return $start . $matches[1] . $end;
  953. }
  954. Index: Text/Wiki/Parse/BBCode/Url.php
  955. ===================================================================
  956. RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/BBCode/Url.php,v
  957. retrieving revision 1.9
  958. diff -u -r1.9 Url.php
  959. --- Text/Wiki/Parse/BBCode/Url.php 22 Dec 2006 09:16:24 -0000 1.9
  960. +++ Text/Wiki/Parse/BBCode/Url.php 27 Oct 2008 16:09:33 -0000
  961. @@ -10,28 +10,29 @@
  962. *
  963. * PHP versions 4 and 5
  964. *
  965. - * @category Text
  966. - * @package Text_Wiki
  967. - * @author Bertrand Gugger <bertrand@toggg.com>
  968. - * @copyright 2005 bertrand Gugger
  969. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  970. - * @version CVS: $Id: Url.php,v 1.9 2006/12/22 09:16:24 toggg Exp $
  971. - * @link http://pear.php.net/package/Text_Wiki
  972. + * @category Text
  973. + * @package Text_Wiki
  974. + * @author Bertrand Gugger <bertrand@toggg.com>
  975. + * @copyright 2005 bertrand Gugger
  976. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  977. + * @version CVS: $Id: Blockquote.php,v 1.4 2006/02/21 22:47:53 toggg Exp $
  978. + * @link http://pear.php.net/package/Text_Wiki
  979. */
  980.  
  981. /**
  982. * Url rule parser class for BBCode.
  983. *
  984. - * @category Text
  985. - * @package Text_Wiki
  986. - * @author Bertrand Gugger <bertrand@toggg.com>
  987. - * @copyright 2005 bertrand Gugger
  988. - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  989. - * @version Release: @package_version@
  990. - * @link http://pear.php.net/package/Text_Wiki
  991. - * @see Text_Wiki_Parse::Text_Wiki_Parse()
  992. + * @category Text
  993. + * @package Text_Wiki
  994. + * @author Bertrand Gugger <bertrand@toggg.com>
  995. + * @copyright 2005 bertrand Gugger
  996. + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
  997. + * @version Release: @package_version@
  998. + * @link http://pear.php.net/package/Text_Wiki
  999. + * @see Text_Wiki_Parse::Text_Wiki_Parse()
  1000. */
  1001. -class Text_Wiki_Parse_Url extends Text_Wiki_Parse {
  1002. +class Text_Wiki_Parse_Url extends Text_Wiki_Parse
  1003. +{
  1004.  
  1005. /**
  1006. * Configuration keys for this rule
  1007. @@ -73,11 +74,12 @@
  1008. '#([\n\r\s#delim#](mailto:)?)(#email#)#i',
  1009. );
  1010.  
  1011. - /**
  1012. + /**
  1013. * Constructor.
  1014. * We override the constructor to build up the regex from config
  1015. *
  1016. * @param object &$obj the base conversion handler
  1017. + *
  1018. * @return The parser object
  1019. * @access public
  1020. */
  1021. @@ -91,33 +93,42 @@
  1022. if (is_string($this->refused)) {
  1023. $this->refused = array($this->refused);
  1024. }
  1025. +
  1026. // convert the list of recognized schemes to a regex OR,
  1027. $schemes = $this->getConf('schemes', $default['schemes']);
  1028. +
  1029. $url = '(?:(' . (is_array($schemes) ? implode('|', $schemes) : $schemes) . ')://';
  1030. +
  1031. // add the "lazy" prefixes if any
  1032. $prefixes = $this->getConf('prefixes', array());
  1033. foreach ($prefixes as $val) {
  1034. $url .= '|' . preg_quote($val, '#') . '\.';
  1035. }
  1036. +
  1037. $host = $this->getConf('host_regexp', $default['host_regexp']);
  1038. $path = $this->getConf('path_regexp', $default['path_regexp']);
  1039. +
  1040. // the full url regexp
  1041. $url .= ')' . $host . $path;
  1042. +
  1043. // the full email regexp
  1044. $email = $this->getConf('user_regexp', $default['user_regexp']) . '@' . $host;
  1045. +
  1046. // inline to disable ?
  1047. if (!$this->getConf('inline_enable', true)) {
  1048. unset($this->regex[1]);
  1049. unset($this->regex[3]);
  1050. }
  1051. +
  1052. // relative url to enable ?
  1053. if ($this->getConf('relative_enable', false)) {
  1054. - $this->regex[5] = str_replace( '#url#', $path, $this->regex[0]);
  1055. + $this->regex[5] = str_replace('#url#', $path, $this->regex[0]);
  1056. }
  1057. +
  1058. // replace in the regexps
  1059. - $this->regex = str_replace( '#url#', $url, $this->regex);
  1060. - $this->regex = str_replace( '#email#', $email, $this->regex);
  1061. - $this->regex = str_replace( '#delim#', $this->wiki->delim, $this->regex);
  1062. + $this->regex = str_replace('#url#', $url, $this->regex);
  1063. + $this->regex = str_replace('#email#', $email, $this->regex);
  1064. + $this->regex = str_replace('#delim#', $this->wiki->delim, $this->regex);
  1065. }
  1066.  
  1067. /**
  1068. @@ -127,6 +138,7 @@
  1069. * 'text' => the displayed text of the URL link
  1070. *
  1071. * @param array &$matches The array of matches from parse().
  1072. + *
  1073. * @return string Delimited token representing the url
  1074. * @access public
  1075. */
  1076. @@ -135,8 +147,10 @@
  1077. if ($this->refused && isset($matches[3]) && in_array($matches[3], $this->refused)) {
  1078. return $matches[0];
  1079. }
  1080. - $pre = '';
  1081. +
  1082. + $pre = '';
  1083. $type = 'inline';
  1084. +
  1085. if (isset($matches[1])) {
  1086. if (strpos(strtolower($matches[1]), 'mail')) {
  1087. if (isset($matches[2])) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement