]> git.imager.perl.org - bse.git/commitdiff
doclink[] now errors when target isn't linkable
authorTony Cook <tony@develop-help.com>
Fri, 24 Apr 2015 01:36:01 +0000 (11:36 +1000)
committerTony Cook <tony@develop-help.com>
Fri, 24 Apr 2015 01:36:01 +0000 (11:36 +1000)
site/cgi-bin/modules/BSE/Formatter.pm

index ae95939f07564361d164298bff8f2f1a1b0a4cf9..4d4b61b4e17fd9aa57225a5f0a68a3f22c4be318 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use BSE::Util::HTML;
 use Carp 'confess';
 
-our $VERSION = "1.011";
+our $VERSION = "1.012";
 
 use base 'DevHelp::Formatter';
 
@@ -178,6 +178,21 @@ sub _get_article {
     return;
   }
 
+  unless ($art->is_linked) {
+    $$error = "&#42;&#42; article $dispid doesn't permit links &#42;&#42;";
+    return;
+  }
+
+  unless ($art->listed) {
+    $$error = "&#42;&#42; article $dispid is not listed &#42;&#42;";
+    return;
+  }
+
+  unless ($art->is_released && !$art->is_expired) {
+    $$error = "&#42;&#42; article $dispid is not released or is expired &#42;&#42;";
+    return;
+  }
+
   return $art;
 }