<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -424,7 +424,7 @@
          */
         public static function tablefy(&amp;$field, $tables) {
             if (!preg_match_all(&quot;/(\(|[\s]+|^)(?!__)([a-z0-9_\.\*]+)(\)|[\s]+|$)/&quot;, $field, $matches))
-                return;
+                return $field = str_replace(&quot;`&quot;, &quot;&quot;, $field); # Method for bypassing the prefixer.
 
             foreach ($matches[0] as $index =&gt; $full) {
                 $before = $matches[1][$index];
@@ -456,3 +456,4 @@
             $field = preg_replace(&quot;/AS ([^ ]+)\./i&quot;, &quot;AS &quot;, $field);
         }
     }
+</diff>
      <filename>includes/class/QueryBuilder.php</filename>
    </modified>
    <modified>
      <diff>@@ -929,6 +929,10 @@
      */
     function upload($file, $extension = null, $path = &quot;&quot;, $put = false) {
         $file_split = explode(&quot;.&quot;, $file['name']);
+        $dir = MAIN_DIR.Config::current()-&gt;uploads_path.$path;
+
+        if (!file_exists($dir))
+            mkdir($dir);
 
         $original_ext = end($file_split);
 
@@ -968,9 +972,9 @@
         $message = __(&quot;Couldn't upload file. CHMOD &lt;code&gt;&quot;.MAIN_DIR.Config::current()-&gt;uploads_path.&quot;&lt;/code&gt; to 777 and try again. If this problem persists, it's probably timing out; in which case, you must contact your system administrator to increase the maximum POST and upload sizes.&quot;);
 
         if ($put) {
-            if (!@copy($file['tmp_name'], MAIN_DIR.Config::current()-&gt;uploads_path.$path.$filename))
+            if (!@copy($file['tmp_name'], $dir.$filename))
                 error(__(&quot;Error&quot;), $message);
-        } elseif (!@move_uploaded_file($file['tmp_name'], MAIN_DIR.Config::current()-&gt;uploads_path.$path.$filename))
+        } elseif (!@move_uploaded_file($file['tmp_name'], $dir.$filename))
             error(__(&quot;Error&quot;), $message);
 
         return $filename;</diff>
      <filename>includes/helpers.php</filename>
    </modified>
    <modified>
      <diff>@@ -149,10 +149,10 @@
 
             foreach (array(&quot;title&quot;, &quot;body&quot;, &quot;user_id&quot;, &quot;parent_id&quot;, &quot;show_in_list&quot;,
                            &quot;list_order&quot;, &quot;clean&quot;, &quot;url&quot;, &quot;created_at&quot;, &quot;updated_at&quot;) as $attr)
-                if ($attr == &quot;updated_at&quot; and $updated_at !== false)
-                    $this-&gt;$attr = fallback($$attr, datetime());
+                if ($attr == &quot;updated_at&quot; and $$attr === null)
+                    $this-&gt;$attr = $$attr = datetime();
                 else
-                    $this-&gt;$attr = fallback($$attr, $this-&gt;$attr);
+                    $this-&gt;$attr = $$attr = ($$attr !== null ? $$attr : $this-&gt;$attr);
 
             $sql-&gt;update(&quot;pages&quot;,
                          array(&quot;id&quot; =&gt;           $this-&gt;id),</diff>
      <filename>includes/model/Page.php</filename>
    </modified>
    <modified>
      <diff>@@ -127,7 +127,7 @@
             $old = clone $this;
 
             foreach (array(&quot;login&quot;, &quot;password&quot;, &quot;email&quot;, &quot;full_name&quot;, &quot;website&quot;, &quot;group_id&quot;, &quot;joined_at&quot;) as $attr)
-                $this-&gt;$attr = fallback($$attr, $this-&gt;$attr); # This sets the $$attr and $this-&gt;$attr at the same time.
+                $this-&gt;$attr = $$attr = ($$attr !== null ? $$attr : $this-&gt;$attr);
 
             $sql-&gt;update(&quot;users&quot;,
                          array(&quot;id&quot;        =&gt; $this-&gt;id),</diff>
      <filename>includes/model/User.php</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require &quot;rubygems&quot;
 require &quot;hpricot&quot;
 
 `rm -Rfv uploads/*`
-`mysql -f --user=root -D chyrp -e 'TRUNCATE TABLE posts; TRUNCATE TABLE post_attributes; TRUNCATE TABLE pages; TRUNCATE TABLE comments; TRUNCATE TABLE tags;' &gt; /dev/null`
+`mysql -f --user=root -D chyrp -e 'TRUNCATE TABLE posts; TRUNCATE TABLE post_attributes; TRUNCATE TABLE pages; TRUNCATE TABLE comments;'`
 
 FUZZER = {
   :textarea =&gt; &quot;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam urna. Vivamus nisl. Mauris iaculis rutrum elit. Cras ornare congue mi. Nullam mi quam, luctus dapibus, euismod ut, dapibus sed, dui. Praesent est lectus, rutrum ac, blandit vitae, hendrerit at, massa. Morbi mauris purus, lobortis vel, commodo vitae, aliquet vehicula, ante. Nunc commodo. Pellentesque vel lacus. Quisque eros. Maecenas et quam. Curabitur eget justo a ante dignissim dapibus. Sed et lacus. Suspendisse potenti. Vivamus ipsum mi, blandit vitae, scelerisque a, pellentesque vitae, nisl. Donec vitae est et est egestas laoreet. Vestibulum commodo elit ut nisl. Nullam volutpat nisi non elit. Morbi sapien eros, ornare et, dapibus id, mattis id, nibh. Suspendisse ut nisl id est scelerisque faucibus.\n\nPraesent viverra felis nec justo. Duis gravida tempor massa. Aliquam lobortis tortor eu purus. Phasellus volutpat, justo eget molestie rhoncus, nibh tortor suscipit justo, non vehicula tortor tortor id sapien. Vivamus quis nisl et neque ullamcorper viverra. Vestibulum accumsan, elit luctus auctor fermentum, lorem tellus dignissim odio, a lobortis magna nulla eget arcu. Phasellus vel erat at dolor sagittis luctus. Nulla facilisi. In eros eros, molestie sit amet, ornare a, fermentum et, dui. Vivamus vel turpis quis diam iaculis dapibus. Nunc lacinia. Integer commodo, urna interdum imperdiet pretium, libero nulla pellentesque turpis, in ultrices neque tortor at arcu. Sed mollis odio eget mauris ultricies bibendum. Vivamus malesuada metus vel arcu. Nam sit amet metus. Pellentesque quis felis non nibh adipiscing adipiscing.&quot;,</diff>
      <filename>tester.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,9 +8,12 @@
 {% if enabled_modules.comments %}
                 &lt;br /&gt;
                 &lt;h2 class=&quot;comments&quot;&gt;${ &quot;Comments&quot; | translate }&lt;/h2&gt;
-                {% if post.comment_count &gt; 0 %}
                 &lt;ol class=&quot;comments&quot; id=&quot;comments_$post.id&quot;&gt;
-                    {% paginate comment in site.comments_per_page post.comments as comments %}{% include &quot;content/comment.twig&quot; %}{% endpaginate %}
+                    {% paginate comment in site.comments_per_page post.comments as comments %}
+                    {% include &quot;content/comment.twig&quot; %}
+                    {% else %}
+                    &lt;li class=&quot;no_comments&quot;&gt;&lt;/li&gt; {# Needed for AJAX commenting and XHTML Strict validation. #}
+                    {% endpaginate %}
                 &lt;/ol&gt;
                 &lt;input type=&quot;hidden&quot; name=&quot;last_comment&quot; value=&quot;$post.latest_comment&quot; id=&quot;last_comment&quot; /&gt;
                 $comments.prev_link
@@ -18,7 +21,6 @@
                 {% if comments.pages &gt; 1 %}
                 &lt;span class=&quot;pages&quot;&gt;${ &quot;Page %d of %d&quot; | translate | format(comments.page, comments.pages) }&lt;/span&gt;
                 {% endif %}
-                {% endif %}
                 {% if post.commentable %}
                 {% include &quot;forms/comment/new.twig&quot; %}
                 {% endif %}</diff>
      <filename>themes/stardust/pages/view.twig</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bd73ccd06ceaee6c3f4a5ecf00e4f027b19a26c2</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp-site/commit/7266ecf9e8350a23eb169ace2817abfce6713520</url>
  <id>7266ecf9e8350a23eb169ace2817abfce6713520</id>
  <committed-date>2008-11-15T11:46:38-08:00</committed-date>
  <authored-date>2008-11-15T11:46:38-08:00</authored-date>
  <message>* If the path given to upload() does not exist, it will be created.
* Logic tweaks in Page-&gt;update()
* Updated the unit tester
* Tweaked post viewing to place an empty &lt;li&gt; in the comments &lt;ol&gt; so we
  can still have AJAX with valid XHTML strict.
* Names can be quoted with backticks to bypass the auto-table-prefixer.</message>
  <tree>ab16c22e6b27b61470edf38e6f6542af7984d9e7</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
