', '>', $newname); $newname = str_replace('<', '<', $newname); if (trim($newname) == "") { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnameempty"]); } $newslug = preg_replace("/[^0-9a-zA-Z ]/m", "", $newname ); $newslug = str_replace(" ", "-", $newslug); $newslug = strtolower($newslug); if ($newslug == "api" || $newslug == "cms-special" || $newslug == "galery" || $newslug == "vendor" || $newslug == "cms-unrelated" || $newslug == "data" || $newslug == "resources" || $newslug == "widgets" || $newslug == "-htaccess" || $newslug == "index" || $newslug == "index-php") { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnameinternal"]); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $newslug)) { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnameexists"]); } if (strlen($newslug) > 70) { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnamelong"]); } file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $newslug, file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $oldslug)); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $newslug, file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $oldslug)); mkdir($_SERVER['DOCUMENT_ROOT'] . "/" . $newslug); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $newslug . "/index.php", ''); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $newslug . "/pagename", $newname); unlink($_SERVER['DOCUMENT_ROOT'] . "/" . $oldslug . "/index.php"); unlink($_SERVER['DOCUMENT_ROOT'] . "/" . $oldslug . "/pagename"); rmdir($_SERVER['DOCUMENT_ROOT'] . "/" . $oldslug); unlink($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $oldslug); unlink($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $oldslug); 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"); } else { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnamenone"]); } } else { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnotfound"]); } } else { require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["api"]["pgnone"]); }