public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
* Model filter syncing.
* Updated the Tagginator module to conform with the new YAML quoting method.
vito (author)
Thu Nov 13 13:03:56 -0800 2008
commit  372e77c4f2ba61ae9a718d29e525fc76d2952a14
tree    2f5171598ea1b28b5962838f1139adb8fe7ad020
parent  5f37681d40109641a59b6f845dbac7218342b649
...
29
30
31
 
 
32
33
34
35
36
37
38
39
40
 
 
41
42
43
...
29
30
31
32
33
34
35
36
37
38
39
 
40
 
41
42
43
44
45
0
@@ -29,15 +29,17 @@
0
 
0
             $trigger = Trigger::current();
0
 
0
+            $trigger->filter($this, "page");
0
+
0
             if ($this->filtered) {
0
                 $this->title_unfiltered = $this->title;
0
                 $this->body_unfiltered = $this->body;
0
 
0
                 $trigger->filter($this->title, array("markup_title", "markup_page_title"), $this);
0
                 $trigger->filter($this->body, array("markup_text", "markup_page_text"), $this);
0
-            }
0
 
0
-            $trigger->filter($this, "page");
0
+                $trigger->filter($this, "filter_page");
0
+            }
0
         }
0
 
0
         /**
...
92
93
94
95
 
 
96
97
98
...
627
628
629
630
631
632
633
634
635
...
92
93
94
 
95
96
97
98
99
...
628
629
630
 
 
 
631
632
633
0
@@ -92,7 +92,8 @@
0
 
0
             Trigger::current()->filter($this, "post");
0
 
0
-            $this->filter();
0
+            if ($this->filtered)
0
+                $this->filter();
0
         }
0
 
0
         /**
0
@@ -627,9 +628,6 @@
0
          * Filters the post attributes through filter_post and any Feather filters.
0
          */
0
         private function filter() {
0
-            if (!$this->filtered)
0
-                return;
0
-
0
             $trigger = Trigger::current();
0
             $class = camelize($this->feather);
0
 
...
31
32
33
 
 
34
35
36
...
38
39
40
 
41
42
43
44
45
46
47
...
31
32
33
34
35
36
37
38
...
40
41
42
43
44
45
 
 
46
47
48
0
@@ -31,6 +31,8 @@
0
 
0
             $trigger = Trigger::current();
0
 
0
+            $trigger->filter($this, "comment");
0
+
0
             if ($this->filtered) {
0
                 if (($this->status != "pingback" and !$this->status != "trackback") and !$group->can("code_in_comments"))
0
                     $this->body = strip_tags($this->body, "<".join("><", Config::current()->allowed_comment_html).">");
0
@@ -38,10 +40,9 @@
0
                 $this->body_unfiltered = $this->body;
0
 
0
                 $trigger->filter($this->body, array("markup_text", "markup_comment_text"));
0
+
0
                 $trigger->filter($this, "filter_comment");
0
             }
0
-
0
-            $trigger->filter($this, "comment");
0
         }
0
 
0
         /**
...
218
219
220
221
 
222
223
224
...
268
269
270
271
 
272
273
274
...
289
290
291
292
 
293
294
295
...
347
348
349
350
 
351
352
353
...
218
219
220
 
221
222
223
224
...
268
269
270
 
271
272
273
274
...
289
290
291
 
292
293
294
295
...
347
348
349
 
350
351
352
353
0
@@ -218,7 +218,7 @@
0
             foreach($sql->select("post_attributes",
0
                                  "*",
0
                                  array("name" => "tags",
0
-                                       "value like" => "%: ".$_GET['name']."\n%"))->fetchAll() as $tag) { # TODO: Is this the correct search method?
0
+                                       "value like" => "%: \"".$_GET['name']."\"\n%"))->fetchAll() as $tag) {
0
                 $post_tags = YAML::load($tag["value"]);
0
 
0
                 $tags = array_merge($tags, $post_tags);
0
@@ -268,7 +268,7 @@
0
             foreach($sql->select("post_attributes",
0
                                  "*",
0
                                  array("name" => "tags",
0
-                                       "value like" => "%\n".$_POST['original'].": %"))->fetchAll() as $tag) { # TODO: Is this the correct search method?
0
+                                       "value like" => "%\n".$_POST['original'].": \"%"))->fetchAll() as $tag) {
0
                 $tags = YAML::load($tag["value"]);
0
                 unset($tags[$_POST['original']]);
0
 
0
@@ -289,7 +289,7 @@
0
             foreach($sql->select("post_attributes",
0
                                  "*",
0
                                  array("name" => "tags",
0
-                                       "value like" => "%: ".$_GET['clean']."\n%"))->fetchAll() as $tag)  { # TODO: Is this the correct search method?
0
+                                       "value like" => "%: \"".$_GET['clean']."\"\n%"))->fetchAll() as $tag)  {
0
                 $tags = YAML::load($tag["value"]);
0
                 unset($tags[$_GET['name']]);
0
 
0
@@ -347,7 +347,7 @@
0
 
0
             $likes = array();
0
             foreach ($tags as $name)
0
-                $likes[] = "%: ".$name."\n%";
0
+                $likes[] = "%: \"".$name."\"\n%";
0
 
0
             $attributes = $sql->select("post_attributes",
0
                                        array("value", "post_id"),
...
80
81
82
 
 
 
83
84
85
...
102
103
104
105
106
 
...
80
81
82
83
84
85
86
87
88
...
105
106
107
 
108
109
0
@@ -80,6 +80,9 @@
0
                 $tags[$attr["post_id"]]["unclean"] = $attr["value"];
0
             else
0
                 $tags[$attr["post_id"]]["clean"] = $attr["value"];
0
+
0
+        if (empty($tags))
0
+            return;
0
         
0
         foreach ($tags as $post_id => $tags) {
0
             $yaml = YAML::dump(parseTags($tags["unclean"], $tags["clean"]));
0
@@ -102,4 +105,4 @@
0
 
0
     update_tags_structure();
0
     move_to_post_attributes();
0
-    move_to_yaml();
0
\ No newline at end of file
0
+    move_to_yaml();

Comments