cvs: docweb /include lib_phpt_generator.inc.php

[email protected] ("Etienne Kneuss")
Newsgroups php.doc.web
Message-ID <cvscolder1159981645@cvsserver>
colder		Wed Oct  4 17:07:25 2006 UTC

  Modified files:              
    /docweb/include	lib_phpt_generator.inc.php 
  Log:
  Fix bug (Unable to un-approve an item) and remove the extra slash
  
http://cvs.php.net/viewvc.cgi/docweb/include/lib_phpt_generator.inc.php?r1=1.1&r2=1.2&diff_format=u
Index: docweb/include/lib_phpt_generator.inc.php
diff -u docweb/include/lib_phpt_generator.inc.php:1.1 docweb/include/lib_phpt_generator.inc.php:1.2
--- docweb/include/lib_phpt_generator.inc.php:1.1	Tue Oct  3 23:22:28 2006
+++ docweb/include/lib_phpt_generator.inc.php	Wed Oct  4 17:07:25 2006
@@ -15,14 +15,14 @@
 +----------------------------------------------------------------------+
 | Authors: Etienne Kneuss <[email protected]>                             |
 +----------------------------------------------------------------------+
-$Id: lib_phpt_generator.inc.php,v 1.1 2006/10/03 23:22:28 colder Exp $
+$Id: lib_phpt_generator.inc.php,v 1.2 2006/10/04 17:07:25 colder Exp $
 */
 /**
  * Parameters
  */
 define('PHPT_EOL',           "\n");
 define('PHPT_SQLITE_FILE',   SQLITE_DIR . 'tests.sqlite');
-define('PHPT_DOC_PATH',      CVS_DIR.'/phpdoc-all/en/');
+define('PHPT_DOC_PATH',      CVS_DIR.'phpdoc-all/en/');
 
 define('PHPT_LIMIT_RESULTS', 200);
 
@@ -244,7 +244,6 @@
             
             $title = preg_replace('#<function>([\w_-]+)</function>#', '\1()', $matches[1][$key]);
 
-            //$example = preg_replace('/print_r(\s+)\(/', 'var_dump\1(', $example);
 
             // let's create the entry
 
@@ -399,9 +398,9 @@
     $test      = !empty($input['test'])     ? sqlite_escape_string(phpt_clean_ws($input['test'])) : '';
     $skipif    = !empty($input['skipif'])   ? sqlite_escape_string(phpt_clean_ws($input['skipif'])) : '';
     $expected  = !empty($input['expected']) ? sqlite_escape_string(phpt_clean_ws($input['expected'])) : '';
-    $flags     = isset($input['approve'])   ? PHPT_FLAG_APPROVED : 0;
+    $flags     = isset($input['approve'])   ? '(flags | '.PHPT_FLAG_APPROVED.')' : '(flags & ~'.PHPT_FLAG_APPROVED.')';
     if (!empty($expected)) {
-        $flags |= PHPT_FLAG_FILLED;
+        $flags .= ' | '.PHPT_FLAG_FILLED;
     }
     
     $sql_query = "UPDATE tests SET edit_date = datetime('now'),
@@ -409,7 +408,7 @@
                                    test      = '$test',
                                    skipif    = '$skipif',
                                    expected  = '$expected',
-                                   flags     = flags | $flags
+                                   flags     = ($flags)
                              WHERE id = ".intval($input['editId']);
     //echo $sql_query;
     return @sqlite_exec($sqlite, $sql_query);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.