Beispiel #1
0
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @link http://wcms.berlios.de/
 * @copyright 2005 Martin Nicholls
 * @author Martin Nicholls <webmasta at streakyland dot co dot uk>
 * @package wCMS
 * @version $Revision: 1.11 $
 */
/* $Id: edit.php,v 1.11 2005/09/04 15:22:27 streaky Exp $ */
require_once "boot.php";
$item = !vars::get('page') ? "home_page" : vars::get('page');
$item = preg_replace("#\\W#", "", $item);
if ($perms['wiki']['edit_pages'] != true) {
    $page = rewrite(path::http() . "?page={$item}");
    header("Location: {$page}");
} else {
    if ($_POST['wikiedit']) {
        $_POST['wikiedit']['tag'] = preg_replace("#\\W#", "", vars::post('page_tag', 'wikiedit'));
        // assign the WHERE clause
        $old_tag = vars::post('old_tag', 'wikiedit');
        $where = "tag = " . $db->quote($old_tag, 'text');
        if (vars::post('old_tag', 'wikiedit') != "") {
            $query = "SELECT * FROM {$db_prefix}content WHERE cont_ident = " . $db->quote($old_tag, 'text');
            $db->setLimit(1);
            $result = $db->query($query);
            $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC);