', '>', $title); $title = str_replace('<', '<', $title); if (substr($title, 0, 1) == " " || substr($title, 0, 1) == "-" || substr($title, 0, 1) == " " || substr($title, 0, 1) == "_" || substr($title, 0, 1) == "@" || substr($title, 0, 1) == "|" || substr($title, 0, 1) == "'" || substr($title, 0, 1) == "\"" || substr($title, 0, 1) == "~" || substr($title, 0, 1) == "&" || substr($title, 0, 1) == "=") { $prefixed = true; } else { $prefixed = false; } $type = $_POST['type']; $content = $_POST['content']; $slug = preg_replace("/[^0-9a-zA-Z ]/m", "", $title ); $slug = str_replace(" ", "-", $slug); $slug = strtolower($slug); if ($prefixed) { $slug = "-" . $slug; } if (trim($title) == "") { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgtitleempty"]); } if ($slug == "api" || $slug == "cms-special" || $slug == "galery" || $slug == "cms-unrelated" || $slug == "vendor" || $slug == "data" || $slug == "resources" || $slug == "widgets" || $slug == "-htaccess" || $slug == "index" || $slug == "index-php") { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnameinternal"]); } if (strlen($slug) > 70) { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnamelong"]); } if ($type != "0" && $type != "1") { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgtypenone"]); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $slug)) { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnameexists"]); } file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $slug, $content); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $slug, $type); mkdir($_SERVER['DOCUMENT_ROOT'] . "/" . $slug); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $slug . "/index.php", ''); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $slug . "/pagename", $title); require_once $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_pages_update.php"; require $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_content_reset.php"; require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("ok");