+ # Check if there is a page that already exists with the new
+ # filename.
+
+ if ($page_filename ne $page_newfilename){
+
+ $string_handle = $database_handle->prepare('SELECT filename FROM kiriwrite_database_pages WHERE filename = \'' . $class->convert($page_newfilename) . '\' LIMIT 1') or ( $error = "DatabaseError", $errorext = $database_handle->errstr, return );
+ $string_handle->execute();
+
+ # Check if a page really is using the new filename.
+
+ while (@page_info = $string_handle->fetchrow_array()){
+
+ # The page information is found.
+
+ $page_found = 1;
+
+ }
+
+ if ($page_found eq 1){
+
+ $error = "PageExists";
+ return;
+
+ }
+
+ }
+