r2655 - findAutoTagWarnings(): produce warnings for martian autotags (ticket:216)
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 22 Apr 2009 00:19:32 +0000 (00:19 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 22 Apr 2009 00:19:32 +0000 (00:19 +0000)
inc/code.php

index 93bb81664c86cac8fe9263f692065128671b3765..5953d49ba58370d9d895afde45cfe2f5d49513cc 100644 (file)
@@ -1107,8 +1107,30 @@ function findAutoTagWarnings ($expr)
                                                'class' => 'warning',
                                                'text' => "User account with name '${recid}' does not exist."
                                        ));
-                               default:
+                               case (mb_ereg_match ('^\$page_[[:alpha:]]+$', $expr['load'])):
+                               case (mb_ereg_match ('^\$tab_[[:alpha:]]+$', $expr['load'])):
+                               case (mb_ereg_match ('^\$op_[[:alpha:]]+$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_op$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_rack$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_object$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_ip4net$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_net$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_ipv4vs$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_vs$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_ipv4rsp$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_rsp$', $expr['load'])):
+                               case (mb_ereg_match ('^\$any_file$', $expr['load'])):
+                               case (mb_ereg_match ('^\$typeid_[[:digit:]]+$', $expr['load'])): // FIXME: check value validity
+                               case (mb_ereg_match ('^\$cn_.+$', $expr['load'])): // FIXME: check name validity and asset existence
+                               case (mb_ereg_match ('^\$lgcn_.+$', $expr['load'])): // FIXME: check name validity
                                        return array();
+                               default:
+                                       return array (array
+                                       (
+                                               'header' => refRCLineno ($expr['lineno']),
+                                               'class' => 'warning',
+                                               'text' => "Martian autotag '${expr['load']}'"
+                                       ));
                        }
                case 'SYNT_NOTEXPR':
                        return findAutoTagWarnings ($expr['load']);