]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix ThrowCodeError calls by giving them an unique ID (tree fix).
authorjocuri%softhome.net <>
Tue, 28 Feb 2006 23:41:04 +0000 (23:41 +0000)
committerjocuri%softhome.net <>
Tue, 28 Feb 2006 23:41:04 +0000 (23:41 +0000)
Bugzilla/Hook.pm
Bugzilla/Template/Plugin/Hook.pm
template/en/default/global/code-error.html.tmpl

index 97bec6c5c93bf4ed8e0a96358f691d8bffd3e973..9d8059478bcdad520f9ca81995eb22a1e2d5005e 100644 (file)
@@ -43,8 +43,8 @@ sub process {
         trick_taint($extension);
         if (-e $extension.'/code/'.$name.'.pl') {
             do($extension.'/code/'.$name.'.pl');
-            ThrowCodeError("An error occured processing hook \"$name\" in ".
-                "Bugzilla extension \"$extension\": $@") if $@;
+            ThrowCodeError('extension_invalid', {
+                name => $name, extension => $extension }) if $@;
         }
     }
     
index 2f94c1dbeec21eb95fb3ae2aff5c37655e14e677..7ff707fc1f3af76cadc33c6b8e5c3bee8ea35480 100644 (file)
@@ -52,7 +52,7 @@ sub process {
     
     # sanity check:
     if (!$template =~ /[\w\.\/\-_\\]+/) {
-        ThrowCodeError("Template with invalid file name found in hook call: $template");
+        ThrowCodeError('template_invalid', { name => $template});
     }
 
     # also get extension hook files that live in extensions/:
index a0e4e3a9ac8b8697f585470769b9465a4ae15ceb..d9220f27b17f20f7f12f15033b96314e1f0f00d9 100644 (file)
   [% ELSIF error == "cookies_need_value" %]
     Every cookie must have a value.
 
+  [% ELSIF error == "extension_invalid" %]
+    An error occured processing hook [% name FILTER html %] in
+    extension [% extension FILTER html %].
+
   [% ELSIF error == "field_type_mismatch" %]
     Cannot seem to handle <code>[% field FILTER html %]</code>
     and <code>[% type FILTER html %]</code> together.
   [% ELSIF error == "template_error" %]
     [% template_error_msg FILTER html %]
 
+  [% ELSIF error == "template_invalid" %]
+    Template with invalid file name found in hook call: [% name FILTER html %].
+
   [% ELSIF error == "unable_to_retrieve_password" %]
      I was unable to retrieve your old password from the database.