r2782 - findAutoTagWarnings(): produce a warning about autotag referring to an undef...
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 20 May 2009 15:26:46 +0000 (15:26 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 20 May 2009 15:26:46 +0000 (15:26 +0000)
inc/code.php

index 65ecea5b0bff2a5974b3122c4fc2330d2e326890..548f6bbed0084575e4fe2576ff32466d52dc855c 100644 (file)
@@ -1119,7 +1119,18 @@ function findAutoTagWarnings ($expr)
                                                'class' => 'warning',
                                                'text' => "Local user account '${recid}' does not exist."
                                        ));
+                               // FIXME: pull identifier at the same pass, which does the matching
                                case (mb_ereg_match ('^\$page_[[:alnum:]]+$', $expr['load'])):
+                                       $recid = mb_ereg_replace ('^\$page_', '', $expr['load']);
+                                       global $page;
+                                       if (isset ($page[$recid]))
+                                               return array();
+                                       return array (array
+                                       (
+                                               'header' => refRCLineno ($expr['lineno']),
+                                               'class' => 'warning',
+                                               'text' => "Page number '${recid}' does not exist."
+                                       ));
                                case (mb_ereg_match ('^\$tab_[[:alnum:]]+$', $expr['load'])):
                                case (mb_ereg_match ('^\$op_[[:alnum:]]+$', $expr['load'])):
                                case (mb_ereg_match ('^\$any_op$', $expr['load'])):