OSDN Git Service

禁止タグを一部許可
authoryamat0jp <terukohietori@gmail.com>
Sat, 6 Apr 2019 01:38:40 +0000 (10:38 +0900)
committeryamat0jp <terukohietori@gmail.com>
Sat, 6 Apr 2019 01:38:40 +0000 (10:38 +0900)
pybbs.py
templates/login.htm
templates/top.htm

index c66dd9b..d9b3c51 100644 (file)
--- a/pybbs.py
+++ b/pybbs.py
@@ -193,10 +193,11 @@ class RegistHandler(IndexHandler):
                         error += u'禁止ワード.<br>'
                         kinsi = True
                         break
-            for word in words:
-                if word in line.lower():
-                    tag = escape.xhtml_escape(word)
-                    error += u'タグ違反.('+tag+')<br>'
+            if self.current_user != b'admin':
+                for word in words:
+                    if word in line.lower():
+                       tag = escape.xhtml_escape(word)
+                       error += u'タグ違反.('+tag+')<br>'
             i += len(line)
             obj = re.finditer('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', line)
             for x in obj:
index 19d3c48..c588a68 100755 (executable)
@@ -7,9 +7,7 @@
   </head>
 
   <body>
-    <p style=text-align:center>
-</p>
-    <p style=text-align:center>管理者用ログイン画面\r
+    <p style=text-align:center>管理者用ログイン画面
 </p>
     <br>
     <form action=/login method="post">
@@ -20,5 +18,6 @@
       <input type="submit" value="ログイン">
     </p>
     </form>
+    <p style=text-align:center><br><a href=/ >TOPへ移動</a></p>
   </body>
 </html>
index cfd0e6f..2219a6b 100755 (executable)
@@ -33,9 +33,9 @@
        {% end %}
        {% set d += 1 %}
        {% if full(x) == True %}
-       <p><a href=/{{x}} style=color:red>{{x}}</a>
+       <p><a href=/{{x}} style=color:red target=_blank>{{x}}</a>
        {% else %}
-       <p><a href=/{{x}}>{{x}}</a>
+       <p><a href=/{{x}} target=_blank>{{x}}</a>
        {% end %}
        {% if d % i == 0 %}
                </div>