OSDN Git Service

BugTrack2/91: $page => rawurlencode($page) (Pointed out by DEX)
[pukiwiki/pukiwiki.git] / lib / make_link.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: make_link.php,v 1.29 2005/07/14 14:45:07 henoheno Exp $
4 // Copyright (C)
5 //   2003-2005 PukiWiki Developers Team
6 //   2001-2002 Originally written by yu-ji
7 // License: GPL v2 or (at your option) any later version
8 //
9 // Hyperlink-related functions
10
11 // Hyperlink decoration
12 function make_link($string, $page = '')
13 {
14         global $vars;
15         static $converter;
16
17         if (! isset($converter)) $converter = new InlineConverter();
18
19         $clone = $converter->get_clone($converter);
20
21         return $clone->convert($string, ($page != '') ? $page : $vars['page']);
22 }
23
24 // Converters of inline element
25 class InlineConverter
26 {
27         var $converters; // as array()
28         var $pattern;
29         var $pos;
30         var $result;
31
32         function get_clone($obj) {
33                 static $clone_func;
34
35                 if (! isset($clone_func)) {
36                         if (version_compare(PHP_VERSION, '5.0.0', '<')) {
37                                 $clone_func = create_function('$a', 'return $a;');
38                         } else {
39                                 $clone_func = create_function('$a', 'return clone $a;');
40                         }
41                 }
42                 return $clone_func($obj);
43         }
44
45         function __clone() {
46                 $converters = array();
47                 foreach ($this->converters as $key=>$converter) {
48                         $converters[$key] = $this->get_clone($converter);
49                 }
50                 $this->converters = $converters;
51         }
52
53         function InlineConverter($converters = NULL, $excludes = NULL)
54         {
55                 if ($converters === NULL) {
56                         $converters = array(
57                                 'plugin',        // Inline plugins
58                                 'note',          // Footnotes
59                                 'url',           // URLs
60                                 'url_interwiki', // URLs (interwiki definition)
61                                 'mailto',        // mailto: URL schemes
62                                 'interwikiname', // InterWikiNames
63                                 'autolink',      // AutoLinks
64                                 'bracketname',   // BracketNames
65                                 'wikiname',      // WikiNames
66                                 'autolink_a',    // AutoLinks(alphabet)
67                         );
68                 }
69
70                 if ($excludes !== NULL)
71                         $converters = array_diff($converters, $excludes);
72
73                 $this->converters = $patterns = array();
74                 $start = 1;
75
76                 foreach ($converters as $name) {
77                         $classname = 'Link_' . $name;
78                         $converter = new $classname($start);
79                         $pattern   = $converter->get_pattern();
80                         if ($pattern === FALSE) continue;
81
82                         $patterns[] = '(' . "\n" . $pattern . "\n" . ')';
83                         $this->converters[$start] = $converter;
84                         $start += $converter->get_count();
85                         ++$start;
86                 }
87                 $this->pattern = join('|', $patterns);
88         }
89
90         function convert($string, $page)
91         {
92                 $this->page   = $page;
93                 $this->result = array();
94
95                 $string = preg_replace_callback('/' . $this->pattern . '/x',
96                         array(& $this, 'replace'), $string);
97
98                 $arr = explode("\x08", make_line_rules(htmlspecialchars($string)));
99                 $retval = '';
100                 while (! empty($arr)) {
101                         $retval .= array_shift($arr) . array_shift($this->result);
102                 }
103                 return $retval;
104         }
105
106         function replace($arr)
107         {
108                 $obj = $this->get_converter($arr);
109
110                 $this->result[] = ($obj !== NULL && $obj->set($arr, $this->page) !== FALSE) ?
111                         $obj->toString() : make_line_rules(htmlspecialchars($arr[0]));
112
113                 return "\x08"; // Add a mark into latest processed part
114         }
115
116         function get_objects($string, $page)
117         {
118                 $matches = $arr = array();
119                 preg_match_all('/' . $this->pattern . '/x', $string, $matches, PREG_SET_ORDER);
120                 foreach ($matches as $match) {
121                         $obj = $this->get_converter($match);
122                         if ($obj->set($match, $page) !== FALSE) {
123                                 $arr[] = $this->get_clone($obj);
124                                 if ($obj->body != '')
125                                         $arr = array_merge($arr, $this->get_objects($obj->body, $page));
126                         }
127                 }
128                 return $arr;
129         }
130
131         function & get_converter(& $arr)
132         {
133                 foreach (array_keys($this->converters) as $start) {
134                         if ($arr[$start] == $arr[0])
135                                 return $this->converters[$start];
136                 }
137                 return NULL;
138         }
139 }
140
141 // Base class of inline elements
142 class Link
143 {
144         var $start;   // Origin number of parentheses (0 origin)
145         var $text;    // Matched string
146
147         var $type;
148         var $page;
149         var $name;
150         var $body;
151         var $alias;
152
153         // Constructor
154         function Link($start)
155         {
156                 $this->start = $start;
157         }
158
159         // Return a regex pattern to match
160         function get_pattern() {}
161
162         // Return number of parentheses (except (?:...) )
163         function get_count() {}
164
165         // Set pattern that matches
166         function set($arr, $page) {}
167
168         function toString() {}
169
170         // Private: Get needed parts from a matched array()
171         function splice($arr)
172         {
173                 $count = $this->get_count() + 1;
174                 $arr   = array_pad(array_splice($arr, $this->start, $count), $count, '');
175                 $this->text = $arr[0];
176                 return $arr;
177         }
178
179         // Set basic parameters
180         function setParam($page, $name, $body, $type = '', $alias = '')
181         {
182                 static $converter = NULL;
183
184                 $this->page = $page;
185                 $this->name = $name;
186                 $this->body = $body;
187                 $this->type = $type;
188                 if (! PKWK_DISABLE_INLINE_IMAGE_FROM_URI &&
189                         is_url($alias) && preg_match('/\.(gif|png|jpe?g)$/i', $alias)) {
190                         $alias = '<img src="' . htmlspecialchars($alias) . '" alt="' . $name . '" />';
191                 } else if ($alias != '') {
192                         if ($converter === NULL)
193                                 $converter = new InlineConverter(array('plugin'));
194
195                         $alias = make_line_rules($converter->convert($alias, $page));
196
197                         // BugTrack/669: A hack removing anchor tags added by AutoLink
198                         $alias = preg_replace('#</?a[^>]*>#i', '', $alias);
199                 }
200                 $this->alias = $alias;
201
202                 return TRUE;
203         }
204 }
205
206 // Inline plugins
207 class Link_plugin extends Link
208 {
209         var $pattern;
210         var $plain,$param;
211
212         function Link_plugin($start)
213         {
214                 parent::Link($start);
215         }
216
217         function get_pattern()
218         {
219                 $this->pattern = <<<EOD
220 &
221 (      # (1) plain
222  (\w+) # (2) plugin name
223  (?:
224   \(
225    ((?:(?!\)[;{]).)*) # (3) parameter
226   \)
227  )?
228 )
229 EOD;
230                 return <<<EOD
231 {$this->pattern}
232 (?:
233  \{
234   ((?:(?R)|(?!};).)*) # (4) body
235  \}
236 )?
237 ;
238 EOD;
239         }
240
241         function get_count()
242         {
243                 return 4;
244         }
245
246         function set($arr, $page)
247         {
248                 list($all, $this->plain, $name, $this->param, $body) = $this->splice($arr);
249
250                 // Re-get true plugin name and patameters (for PHP 4.1.2)
251                 $matches = array();
252                 if (preg_match('/^' . $this->pattern . '/x', $all, $matches)
253                         && $matches[1] != $this->plain) 
254                         list(, $this->plain, $name, $this->param) = $matches;
255
256                 return parent::setParam($page, $name, $body, 'plugin');
257         }
258
259         function toString()
260         {
261                 $body = ($this->body == '') ? '' : make_link($this->body);
262                 $str = FALSE;
263
264                 // Try to call the plugin
265                 if (exist_plugin_inline($this->name))
266                         $str = do_plugin_inline($this->name, $this->param, $body);
267
268                 if ($str !== FALSE) {
269                         return $str; // Succeed
270                 } else {
271                         // No such plugin, or Failed
272                         $body = (($body == '') ? '' : '{' . $body . '}') . ';';
273                         return make_line_rules(htmlspecialchars('&' . $this->plain) . $body);
274                 }
275         }
276 }
277
278 // Footnotes
279 class Link_note extends Link
280 {
281         function Link_note($start)
282         {
283                 parent::Link($start);
284         }
285
286         function get_pattern()
287         {
288                 return <<<EOD
289 \(\(
290  ((?:(?R)|(?!\)\)).)*) # (1) note body
291 \)\)
292 EOD;
293         }
294
295         function get_count()
296         {
297                 return 1;
298         }
299
300         function set($arr, $page)
301         {
302                 global $foot_explain, $vars;
303                 static $note_id = 0;
304
305                 list(, $body) = $this->splice($arr);
306
307                 if (PKWK_ALLOW_RELATIVE_FOOTNOTE_ANCHOR) {
308                         $script = '';
309                 } else {
310                         $script = get_script_uri() . '?' . rawurlencode($page);
311                 }
312
313                 $id   = ++$note_id;
314                 $note = make_link($body);
315                 $page = isset($vars['page']) ? rawurlencode($vars['page']) : '';
316
317                 // Footnote
318                 $foot_explain[$id] = '<a id="notefoot_' . $id . '" href="' .
319                         $script . '#notetext_' . $id . '" class="note_super">*' .
320                         $id . '</a>' . "\n" .
321                         '<span class="small">' . $note . '</span><br />';
322
323                 // A hyperlink, content-body to footnote
324                 $name = '<a id="notetext_' . $id . '" href="' . $script .
325                         '#notefoot_' . $id . '" class="note_super" title="' .
326                         strip_tags($note) . '">*' . $id . '</a>';
327
328                 return parent::setParam($page, $name, $body);
329         }
330
331         function toString()
332         {
333                 return $this->name;
334         }
335 }
336
337 // URLs
338 class Link_url extends Link
339 {
340         function Link_url($start)
341         {
342                 parent::Link($start);
343         }
344
345         function get_pattern()
346         {
347                 $s1 = $this->start + 1;
348                 return <<<EOD
349 (\[\[             # (1) open bracket
350  ((?:(?!\]\]).)+) # (2) alias
351  (?:>|:)
352 )?
353 (                 # (3) url
354  (?:(?:https?|ftp|news):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+
355 )
356 (?($s1)\]\])      # close bracket
357 EOD;
358         }
359
360         function get_count()
361         {
362                 return 3;
363         }
364
365         function set($arr, $page)
366         {
367                 list(, , $alias, $name) = $this->splice($arr);
368                 return parent::setParam($page, htmlspecialchars($name),
369                         '', 'url', $alias == '' ? $name : $alias);
370         }
371
372         function toString()
373         {
374                 if (FALSE) {
375                         $rel = '';
376                 } else {
377                         $rel = ' rel="nofollow"';
378                 }
379                 return '<a href="' . $this->name . '"' . $rel . '>' . $this->alias . '</a>';
380         }
381 }
382
383 // URLs (InterWiki definition on "InterWikiName")
384 class Link_url_interwiki extends Link
385 {
386         function Link_url_interwiki($start)
387         {
388                 parent::Link($start);
389         }
390
391         function get_pattern()
392         {
393                 return <<<EOD
394 \[       # open bracket
395 (        # (1) url
396  (?:(?:https?|ftp|news):\/\/|\.\.?\/)[!~*'();\/?:\@&=+\$,%#\w.-]*
397 )
398 \s
399 ([^\]]+) # (2) alias
400 \]       # close bracket
401 EOD;
402         }
403
404         function get_count()
405         {
406                 return 2;
407         }
408
409         function set($arr, $page)
410         {
411                 list(, $name, $alias) = $this->splice($arr);
412                 return parent::setParam($page, htmlspecialchars($name), '', 'url', $alias);
413         }
414
415         function toString()
416         {
417                 return '<a href="' . $this->name . '" rel="nofollow">' . $this->alias . '</a>';
418         }
419 }
420
421 // mailto: URL schemes
422 class Link_mailto extends Link
423 {
424         var $is_image, $image;
425
426         function Link_mailto($start)
427         {
428                 parent::Link($start);
429         }
430
431         function get_pattern()
432         {
433                 $s1 = $this->start + 1;
434                 return <<<EOD
435 (?:
436  \[\[
437  ((?:(?!\]\]).)+)(?:>|:)  # (1) alias
438 )?
439 ([\w.-]+@[\w-]+\.[\w.-]+) # (2) mailto
440 (?($s1)\]\])              # close bracket if (1)
441 EOD;
442         }
443
444         function get_count()
445         {
446                 return 2;
447         }
448
449         function set($arr, $page)
450         {
451                 list(, $alias, $name) = $this->splice($arr);
452                 return parent::setParam($page, $name, '', 'mailto', $alias == '' ? $name : $alias);
453         }
454         
455         function toString()
456         {
457                 return '<a href="mailto:' . $this->name . '" rel="nofollow">' . $this->alias . '</a>';
458         }
459 }
460
461 // InterWikiName-rendered URLs
462 class Link_interwikiname extends Link
463 {
464         var $url    = '';
465         var $param  = '';
466         var $anchor = '';
467
468         function Link_interwikiname($start)
469         {
470                 parent::Link($start);
471         }
472
473         function get_pattern()
474         {
475                 $s2 = $this->start + 2;
476                 $s5 = $this->start + 5;
477                 return <<<EOD
478 \[\[                  # open bracket
479 (?:
480  ((?:(?!\]\]).)+)>    # (1) alias
481 )?
482 (\[\[)?               # (2) open bracket
483 ((?:(?!\s|:|\]\]).)+) # (3) InterWiki
484 (?<! > | >\[\[ )      # not '>' or '>[['
485 :                     # separator
486 (                     # (4) param
487  (\[\[)?              # (5) open bracket
488  (?:(?!>|\]\]).)+
489  (?($s5)\]\])         # close bracket if (5)
490 )
491 (?($s2)\]\])          # close bracket if (2)
492 \]\]                  # close bracket
493 EOD;
494         }
495
496         function get_count()
497         {
498                 return 5;
499         }
500
501         function set($arr, $page)
502         {
503                 global $script;
504
505                 list(, $alias, , $name, $this->param) = $this->splice($arr);
506
507                 $matches = array();
508                 if (preg_match('/^([^#]+)(#[A-Za-z][\w-]*)$/', $this->param, $matches))
509                         list(, $this->param, $this->anchor) = $matches;
510
511                 $url = get_interwiki_url($name, $this->param);
512                 $this->url = ($url === FALSE) ?
513                         $script . '?' . rawurlencode('[[' . $name . ':' . $this->param . ']]') :
514                         htmlspecialchars($url);
515
516                 return parent::setParam(
517                         $page,
518                         htmlspecialchars($name . ':' . $this->param),
519                         '',
520                         'InterWikiName',
521                         $alias == '' ? $name . ':' . $this->param : $alias
522                 );
523         }
524
525         function toString()
526         {
527                 return '<a href="' . $this->url . $this->anchor . '" title="' .
528                         $this->name . '" rel="nofollow">' . $this->alias . '</a>';
529         }
530 }
531
532 // BracketNames
533 class Link_bracketname extends Link
534 {
535         var $anchor, $refer;
536
537         function Link_bracketname($start)
538         {
539                 parent::Link($start);
540         }
541
542         function get_pattern()
543         {
544                 global $WikiName, $BracketName;
545
546                 $s2 = $this->start + 2;
547                 return <<<EOD
548 \[\[                     # Open bracket
549 (?:((?:(?!\]\]).)+)>)?   # (1) Alias
550 (\[\[)?                  # (2) Open bracket
551 (                        # (3) PageName
552  (?:$WikiName)
553  |
554  (?:$BracketName)
555 )?
556 (\#(?:[a-zA-Z][\w-]*)?)? # (4) Anchor
557 (?($s2)\]\])             # Close bracket if (2)
558 \]\]                     # Close bracket
559 EOD;
560         }
561
562         function get_count()
563         {
564                 return 4;
565         }
566
567         function set($arr, $page)
568         {
569                 global $WikiName;
570
571                 list(, $alias, , $name, $this->anchor) = $this->splice($arr);
572                 if ($name == '' && $this->anchor == '') return FALSE;
573
574                 if ($name == '' || ! preg_match('/^' . $WikiName . '$/', $name)) {
575                         if ($alias == '') $alias = $name . $this->anchor;
576                         if ($name != '') {
577                                 $name = get_fullname($name, $page);
578                                 if (! is_pagename($name)) return FALSE;
579                         }
580                 }
581
582                 return parent::setParam($page, $name, '', 'pagename', $alias);
583         }
584
585         function toString()
586         {
587                 return make_pagelink(
588                         $this->name,
589                         $this->alias,
590                         $this->anchor,
591                         $this->page
592                 );
593         }
594 }
595
596 // WikiNames
597 class Link_wikiname extends Link
598 {
599         function Link_wikiname($start)
600         {
601                 parent::Link($start);
602         }
603
604         function get_pattern()
605         {
606                 global $WikiName, $nowikiname;
607
608                 return $nowikiname ? FALSE : '(' . $WikiName . ')';
609         }
610
611         function get_count()
612         {
613                 return 1;
614         }
615
616         function set($arr, $page)
617         {
618                 list($name) = $this->splice($arr);
619                 return parent::setParam($page, $name, '', 'pagename', $name);
620         }
621
622         function toString()
623         {
624                 return make_pagelink(
625                         $this->name,
626                         $this->alias,
627                         '',
628                         $this->page
629                 );
630         }
631 }
632
633 // AutoLinks
634 class Link_autolink extends Link
635 {
636         var $forceignorepages = array();
637         var $auto;
638         var $auto_a; // alphabet only
639
640         function Link_autolink($start)
641         {
642                 global $autolink;
643
644                 parent::Link($start);
645
646                 if (! $autolink || ! file_exists(CACHE_DIR . 'autolink.dat'))
647                         return;
648
649                 @list($auto, $auto_a, $forceignorepages) = file(CACHE_DIR . 'autolink.dat');
650                 $this->auto   = $auto;
651                 $this->auto_a = $auto_a;
652                 $this->forceignorepages = explode("\t", trim($forceignorepages));
653         }
654
655         function get_pattern()
656         {
657                 return isset($this->auto) ? '(' . $this->auto . ')' : FALSE;
658         }
659
660         function get_count()
661         {
662                 return 1;
663         }
664
665         function set($arr, $page)
666         {
667                 global $WikiName;
668
669                 list($name) = $this->splice($arr);
670
671                 // Ignore pages listed, or Expire ones not found
672                 if (in_array($name, $this->forceignorepages) || ! is_page($name))
673                         return FALSE;
674
675                 return parent::setParam($page, $name, '', 'pagename', $name);
676         }
677
678         function toString()
679         {
680                 return make_pagelink($this->name, $this->alias, '', $this->page, TRUE);
681         }
682 }
683
684 class Link_autolink_a extends Link_autolink
685 {
686         function Link_autolink_a($start)
687         {
688                 parent::Link_autolink($start);
689         }
690
691         function get_pattern()
692         {
693                 return isset($this->auto_a) ? '(' . $this->auto_a . ')' : FALSE;
694         }
695 }
696
697 // Make hyperlink for the page
698 function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolink = FALSE)
699 {
700         global $script, $vars, $link_compact, $related, $_symbol_noexists;
701
702         $s_page = htmlspecialchars(strip_bracket($page));
703         $s_alias = ($alias == '') ? $s_page : $alias;
704
705         if ($page == '') return '<a href="' . $anchor . '">' . $s_alias . '</a>';
706
707         $r_page  = rawurlencode($page);
708         $r_refer = ($refer == '') ? '' : '&amp;refer=' . rawurlencode($refer);
709
710         if (! isset($related[$page]) && $page != $vars['page'] && is_page($page))
711                 $related[$page] = get_filetime($page);
712
713         if ($isautolink || is_page($page)) {
714                 // Hyperlink to the page
715                 if ($link_compact) {
716                         $title   = '';
717                 } else {
718                         $title   = ' title="' . $s_page . get_pg_passage($page, FALSE) . '"';
719                 }
720
721                 // AutoLink marker
722                 if ($isautolink) {
723                         $al_left  = '<!--autolink-->';
724                         $al_right = '<!--/autolink-->';
725                 } else {
726                         $al_left = $al_right = '';
727                 }
728
729                 return $al_left . '<a ' . 'href="' . $script . '?' . $r_page . $anchor .
730                         '"' . $title . '>' . $s_alias . '</a>' . $al_right;
731         } else {
732                 // Dangling link
733                 if (PKWK_READONLY) return $s_alias; // No dacorations
734
735                 $retval = $s_alias . '<a href="' .
736                         $script . '?cmd=edit&amp;page=' . $r_page . $r_refer . '">' .
737                         $_symbol_noexists . '</a>';
738
739                 if ($link_compact) {
740                         return $retval;
741                 } else {
742                         return '<span class="noexists">' . $retval . '</span>';
743                 }
744         }
745 }
746
747 // Resolve relative / (Unix-like)absolute path of the page
748 function get_fullname($name, $refer)
749 {
750         global $defaultpage;
751
752         // 'Here'
753         if ($name == '' || $name == './') return $refer;
754
755         // Absolute path
756         if ($name{0} == '/') {
757                 $name = substr($name, 1);
758                 return ($name == '') ? $defaultpage : $name;
759         }
760
761         // Relative path from 'Here'
762         if (substr($name, 0, 2) == './') {
763                 $arrn    = preg_split('#/#', $name, -1, PREG_SPLIT_NO_EMPTY);
764                 $arrn[0] = $refer;
765                 return join('/', $arrn);
766         }
767
768         // Relative path from dirname()
769         if (substr($name, 0, 3) == '../') {
770                 $arrn = preg_split('#/#', $name,  -1, PREG_SPLIT_NO_EMPTY);
771                 $arrp = preg_split('#/#', $refer, -1, PREG_SPLIT_NO_EMPTY);
772
773                 while (! empty($arrn) && $arrn[0] == '..') {
774                         array_shift($arrn);
775                         array_pop($arrp);
776                 }
777                 $name = ! empty($arrp) ? join('/', array_merge($arrp, $arrn)) :
778                         (! empty($arrn) ? $defaultpage . '/' . join('/', $arrn) : $defaultpage);
779         }
780
781         return $name;
782 }
783
784 // Render an InterWiki into a URL
785 function get_interwiki_url($name, $param)
786 {
787         global $WikiName, $interwiki;
788         static $interwikinames;
789         static $encode_aliases = array('sjis'=>'SJIS', 'euc'=>'EUC-JP', 'utf8'=>'UTF-8');
790
791         if (! isset($interwikinames)) {
792                 $interwikinames = $matches = array();
793                 foreach (get_source($interwiki) as $line)
794                         if (preg_match('/\[(' . '(?:(?:https?|ftp|news):\/\/|\.\.?\/)' .
795                             '[!~*\'();\/?:\@&=+\$,%#\w.-]*)\s([^\]]+)\]\s?([^\s]*)/',
796                             $line, $matches))
797                                 $interwikinames[$matches[2]] = array($matches[1], $matches[3]);
798         }
799
800         if (! isset($interwikinames[$name])) return FALSE;
801
802         list($url, $opt) = $interwikinames[$name];
803
804         // Encoding
805         switch ($opt) {
806
807         case '':    /* FALLTHROUGH */
808         case 'std': // Simply URL-encode the string, whose base encoding is the internal-encoding
809                 $param = rawurlencode($param);
810                 break;
811
812         case 'asis': /* FALLTHROUGH */
813         case 'raw' : // Truly as-is
814                 break;
815
816         case 'yw': // YukiWiki
817                 if (! preg_match('/' . $WikiName . '/', $param))
818                         $param = '[[' . mb_convert_encoding($param, 'SJIS', SOURCE_ENCODING) . ']]';
819                 break;
820
821         case 'moin': // MoinMoin
822                 $param = str_replace('%', '_', rawurlencode($param));
823                 break;
824
825         default:
826                 // Alias conversion of $opt
827                 if (isset($encode_aliases[$opt])) $opt = & $encode_aliases[$opt];
828
829                 // Encoding conversion into specified encode, and URLencode
830                 $param = rawurlencode(mb_convert_encoding($param, $opt, SOURCE_ENCODING));
831         }
832
833         // Replace or Add the parameter
834         if (strpos($url, '$1') !== FALSE) {
835                 $url = str_replace('$1', $param, $url);
836         } else {
837                 $url .= $param;
838         }
839
840         $len = strlen($url);
841         if ($len > 512) die_message('InterWiki URL too long: ' . $len . ' characters');
842
843         return $url;
844 }
845 ?>