Project

General

Profile

« Previous | Next » 

Revision 1859

Added by Dietmar almost 12 years ago

  1. bugfix mkdir(): Invalid argument if create acessfile

View differences:

functions.php
963 963
		$results_array = $results->fetchRow(MYSQL_ASSOC);
964 964
		$parent     = $results_array['parent'];
965 965
		$level      = $results_array['level'];
966
		$link       = $results_array['link'];
966
		$sPageLink       = $results_array['link'];
967 967
		$page_title = $results_array['page_title'];
968 968
		$menu_title = $results_array['menu_title'];
969 969
		// Get the sections that belong to the page
......
981 981
				}
982 982
			}
983 983
		}
984
		// Update the pages table
985
		$sql = 'DELETE FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.$page_id;
986
		$database->query($sql);
987
		if($database->is_error()) {
988
			$admin->print_error($database->get_error());
989
		}
990 984
		// Update the sections table
991 985
		$sql = 'DELETE FROM `'.TABLE_PREFIX.'sections` WHERE `page_id`='.$page_id;
992 986
		$database->query($sql);
......
998 992
		$order = new order(TABLE_PREFIX.'pages', 'position', 'page_id', 'parent');
999 993
		$order->clean($parent);
1000 994
		// Unlink the page access file and directory
1001
		$directory = WB_PATH.PAGES_DIRECTORY.$link;
995
		$directory = WB_PATH.PAGES_DIRECTORY.$sPageLink;
1002 996
		$filename = $directory.PAGE_EXTENSION;
1003 997
		$directory .= '/';
1004
		if(file_exists($filename))
998
		if(is_writable($filename))
1005 999
		{
1006 1000
			if(!is_writable(WB_PATH.PAGES_DIRECTORY.'/')) {
1007 1001
				$admin->print_error($MESSAGE['PAGES_CANNOT_DELETE_ACCESS_FILE']);
1008
			}else {
1002
			} else {
1009 1003
				unlink($filename);
1010
				if( file_exists($directory) &&
1011
				   (rtrim($directory,'/') != WB_PATH.PAGES_DIRECTORY) &&
1012
				   (substr($link, 0, 1) != '.'))
1004
				if( is_writable($directory) && (rtrim($directory,'/') != WB_PATH.PAGES_DIRECTORY ) && (substr($sPageLink, 0, 1) != '.') )
1013 1005
				{
1014 1006
					rm_full_dir($directory);
1015 1007
				}
1016 1008
			}
1017 1009
		}
1010
		// Update the pages table
1011
		$sql = 'DELETE FROM `'.TABLE_PREFIX.'pages` WHERE `page_id`='.$page_id;
1012
		$database->query($sql);
1013
		if($database->is_error()) {
1014
			$admin->print_error($database->get_error());
1015
		}
1018 1016
	}
1019 1017

  
1020 1018
/*

Also available in: Unified diff