Remove trailing whitespace

git-svn-id: https://develop.svn.wordpress.org/trunk@11930 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-09-14 14:03:32 +00:00
parent b7f82a38b5
commit 43c201d458
44 changed files with 294 additions and 294 deletions

View File

@@ -46,7 +46,7 @@ case 'editcomment' :
if ( 'trash' == $comment->comment_approved )
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
$comment = get_comment_to_edit( $comment_id );
include('edit-form-comment.php');
@@ -170,12 +170,12 @@ case 'trashcomment' :
case 'untrashcomment' :
$comment_id = absint( $_REQUEST['c'] );
$noredir = isset($_REQUEST['noredir']);
if (!$comment = get_comment($comment_id))
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
if (!current_user_can('edit_post', $comment->comment_post_ID ))
comment_footer_die( __('You are not allowed to edit comments on this post.') );
if ($action == 'trashcomment') {
check_admin_referer( 'trash-comment_' . $comment_id );
wp_trash_comment($comment_id);
@@ -184,7 +184,7 @@ case 'untrashcomment' :
check_admin_referer( 'untrash-comment_' . $comment_id );
wp_untrash_comment($comment_id);
}
if ('' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ))
wp_redirect( wp_get_referer() );
else if ('' != wp_get_original_referer() && false == $noredir)

View File

@@ -19,7 +19,7 @@ $post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
check_admin_referer('bulk-comments');
if ((isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp'])) {
$comment_status = $wpdb->escape($_REQUEST['comment_status']);
$delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
@@ -29,9 +29,9 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R
$comment_ids = $_REQUEST['delete_comments'];
$doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
} else wp_redirect($_SERVER['HTTP_REFERER']);
$approved = $unapproved = $spammed = $trashed = $untrashed = $deleted = 0;
foreach ($comment_ids as $comment_id) { // Check the permissions on each
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );

View File

@@ -40,7 +40,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
if ( !wp_trash_post($post_id) )
wp_die( __('Error in moving to trash...') );
$trashed++;
}
$sendback = add_query_arg('trashed', $trashed, $sendback);
@@ -53,7 +53,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
if ( !wp_untrash_post($post_id) )
wp_die( __('Error in restoring from trash...') );
$untrashed++;
}
$sendback = add_query_arg('untrashed', $untrashed, $sendback);

View File

@@ -48,7 +48,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
if ( !wp_trash_post($post_id) )
wp_die( __('Error in moving to trash...') );
$trashed++;
}
$sendback = add_query_arg('trashed', $trashed, $sendback);
@@ -61,7 +61,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
if ( !wp_untrash_post($post_id) )
wp_die( __('Error in restoring from trash...') );
$untrashed++;
}
$sendback = add_query_arg('untrashed', $untrashed, $sendback);

View File

@@ -29,7 +29,7 @@
if (!defined('PCLZIP_READ_BLOCK_SIZE')) {
define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
}
// ----- File list separator
// In version 1.x of PclZip, the separator for file list is a space
// (which is not a very smart choice, specifically for windows paths !).
@@ -68,7 +68,7 @@
// ----- Optional threshold ratio for use of temporary files
// Pclzip sense the size of the file to add/extract and decide to
// use or not temporary file. The algorythm is looking for
// use or not temporary file. The algorythm is looking for
// memory_limit of PHP and apply a ratio.
// threshold = memory_limit * ratio.
// Recommended values are under 0.5. Default 0.47.
@@ -152,7 +152,7 @@
define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias
define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );
define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias
// ----- File description attributes
define( 'PCLZIP_ATT_FILE_NAME', 79001 );
define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
@@ -198,7 +198,7 @@
// ----- Internal error handling
var $error_code = 1;
var $error_string = '';
// ----- Current status of the magic_quotes_runtime
// This value store the php configuration for magic_quotes
// The class can then disable the magic_quotes and reset it after
@@ -341,7 +341,7 @@
}
}
}
// ----- Look for default option values
$this->privOptionDefaultThreshold($v_options);
@@ -350,16 +350,16 @@
$v_att_list = array();
$v_filedescr_list = array();
$p_result_list = array();
// ----- Look if the $p_filelist is really an array
if (is_array($p_filelist)) {
// ----- Look if the first element is also an array
// This will mean that this is a file description entry
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
$v_att_list = $p_filelist;
}
// ----- The list is a list of string names
else {
$v_string_list = $p_filelist;
@@ -378,7 +378,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Reformat the string list
if (sizeof($v_string_list) != 0) {
foreach ($v_string_list as $v_string) {
@@ -390,7 +390,7 @@
}
}
}
// ----- For each file in the list check the attributes
$v_supported_attributes
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
@@ -549,16 +549,16 @@
$v_att_list = array();
$v_filedescr_list = array();
$p_result_list = array();
// ----- Look if the $p_filelist is really an array
if (is_array($p_filelist)) {
// ----- Look if the first element is also an array
// This will mean that this is a file description entry
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
$v_att_list = $p_filelist;
}
// ----- The list is a list of string names
else {
$v_string_list = $p_filelist;
@@ -577,14 +577,14 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Reformat the string list
if (sizeof($v_string_list) != 0) {
foreach ($v_string_list as $v_string) {
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
}
}
// ----- For each file in the list check the attributes
$v_supported_attributes
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
@@ -1049,7 +1049,7 @@
// Options :
// PCLZIP_OPT_BY_INDEX :
// PCLZIP_OPT_BY_NAME :
// PCLZIP_OPT_BY_EREG :
// PCLZIP_OPT_BY_EREG :
// PCLZIP_OPT_BY_PREG :
// Return Values :
// 0 on failure,
@@ -1124,7 +1124,7 @@
function deleteByIndex($p_index)
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");
$p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
// ----- Return
@@ -1178,7 +1178,7 @@
if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
{
$this->privSwapBackMagicQuotes();
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
@@ -1507,7 +1507,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
$v_result=1;
// ----- Read the options
$i=0;
while ($i<$p_size) {
@@ -1552,14 +1552,14 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Check for incompatible options
if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Check the value
$v_value = $p_options_list[$i+1];
if ((!is_integer($v_value)) || ($v_value<0)) {
@@ -1581,7 +1581,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_result_list[$p_options_list[$i]] = true;
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
break;
@@ -1599,7 +1599,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_result_list[$p_options_list[$i]] = true;
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
break;
@@ -1763,7 +1763,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Reduce the index list
// each index item in the list must be a couple with a start and
// an end value : [0,3], [5-5], [8-10], ...
@@ -1774,10 +1774,10 @@
// ----- Explode the item
$v_item_list = explode("-", $v_work_list[$j]);
$v_size_item_list = sizeof($v_item_list);
// ----- TBC : Here we might check that each item is a
// real integer ...
// ----- Look for single value
if ($v_size_item_list == 1) {
// ----- Set the option value
@@ -1815,7 +1815,7 @@
}
$v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
}
// ----- Sort the items
if ($v_sort_flag) {
// TBC : To Be Completed
@@ -1928,11 +1928,11 @@
}
}
}
// ----- Look for default values
if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Calculate auto threshold");
}
// ----- Return
@@ -1951,19 +1951,19 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOptionDefaultThreshold", "");
$v_result=1;
if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
|| isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Create an auto-threshold for use of temporay files");
// ----- Get 'memory_limit' configuration value
$v_memory_limit = ini_get('memory_limit');
$v_memory_limit = trim($v_memory_limit);
$last = strtolower(substr($v_memory_limit, -1));
if($last == 'g')
//$v_memory_limit = $v_memory_limit*1024*1024*1024;
$v_memory_limit = $v_memory_limit*1073741824;
@@ -1972,9 +1972,9 @@
$v_memory_limit = $v_memory_limit*1048576;
if($last == 'k')
$v_memory_limit = $v_memory_limit*1024;
$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Current memory usage : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Threshold value is : ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]." bytes");
@@ -1983,7 +1983,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Unset the threshold (value ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD].") because under 1Mo sanity check)");
unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);
}
// ----- Return
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
@@ -2002,10 +2002,10 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", "");
$v_result=1;
// ----- For each file in the list check the attributes
foreach ($p_file_list as $v_key => $v_value) {
// ----- Check if the option is supported
if (!isset($v_requested_options[$v_key])) {
// ----- Error log
@@ -2027,7 +2027,7 @@
$p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
if ($p_filedescr['filename'] == '') {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
@@ -2123,10 +2123,10 @@
}
}
}
// end foreach
}
// ----- Return
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
@@ -2140,7 +2140,7 @@
// or a string to be added as file. For any other type of files (link, other)
// just ignore the item.
// Then prepare the information that will be stored for that file.
// When its a folder, expand the folder with all the files that are in that
// When its a folder, expand the folder with all the files that are in that
// folder (recursively).
// Parameters :
// Return Values :
@@ -2151,23 +2151,23 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", "");
$v_result=1;
// ----- Create a result list
$v_result_list = array();
// ----- Look each entry
for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for file ".$i.".");
// ----- Get filedescr
$v_descr = $p_filedescr_list[$i];
// ----- Reduce the filename
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'");
$v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);
$v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'");
// ----- Look for real file or folder
if (file_exists($v_descr['filename'])) {
if (@is_file($v_descr['filename'])) {
@@ -2189,13 +2189,13 @@
continue;
}
}
// ----- Look for string added as file
else if (isset($v_descr['content'])) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a string added as a file");
$v_descr['type'] = 'virtual_file';
}
// ----- Missing file
else {
// ----- Error log
@@ -2206,13 +2206,13 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Calculate the stored filename
$this->privCalculateStoredFilename($v_descr, $p_options);
// ----- Add the descriptor in result list
$v_result_list[sizeof($v_result_list)] = $v_descr;
// ----- Look for folder
if ($v_descr['type'] == 'folder') {
// ----- List of items in folder
@@ -2226,10 +2226,10 @@
if (($v_item_handler == '.') || ($v_item_handler == '..')) {
continue;
}
// ----- Compose the full filename
$v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
// ----- Look for different stored filename
// Because the name of the folder was changed, the name of the
// files/sub-folders also change
@@ -2241,17 +2241,17 @@
$v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
}
}
$v_dirlist_nb++;
}
@closedir($v_folder_handler);
}
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped.");
// TBC : unable to open folder in read mode
}
// ----- Expand each element of the list
if ($v_dirlist_nb != 0) {
// ----- Expand
@@ -2259,7 +2259,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Concat the resulting list
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')");
$v_result_list = array_merge($v_result_list, $v_dirlist_descr);
@@ -2268,12 +2268,12 @@
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand.");
}
// ----- Free local array
unset($v_dirlist_descr);
}
}
// ----- Get the result list
$p_filedescr_list = $v_result_list;
@@ -2294,7 +2294,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list");
$v_result=1;
$v_list_detail = array();
// ----- Magic quotes trick
$this->privDisableMagicQuotes();
@@ -2655,7 +2655,7 @@
// Function : privAddFileList()
// Description :
// Parameters :
// $p_filedescr_list : An array containing the file description
// $p_filedescr_list : An array containing the file description
// or directory names to add in the zip
// $p_result_list : list of added files with their properties (specially the status field)
// Return Values :
@@ -2675,7 +2675,7 @@
// ----- Format the filename
$p_filedescr_list[$j]['filename']
= PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'");
// ----- Skip empty file names
@@ -2735,7 +2735,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'");
$v_result=1;
// ----- Working variable
$p_filename = $p_filedescr['filename'];
@@ -2748,8 +2748,8 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Look for a stored different filename
// ----- Look for a stored different filename
/* TBC : Removed
if (isset($p_filedescr['stored_filename'])) {
$v_stored_filename = $p_filedescr['stored_filename'];
@@ -2786,20 +2786,20 @@
$p_header['external'] = 0x00000000;
$p_header['size'] = filesize($p_filename);
}
// ----- Look for regular folder
else if ($p_filedescr['type']=='folder') {
$p_header['external'] = 0x00000010;
$p_header['mtime'] = filemtime($p_filename);
$p_header['size'] = filesize($p_filename);
}
// ----- Look for virtual file
else if ($p_filedescr['type'] == 'virtual_file') {
$p_header['external'] = 0x00000000;
$p_header['size'] = strlen($p_filedescr['content']);
}
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'");
// ----- Look for filetime
@@ -2855,7 +2855,7 @@
if ($p_header['stored_filename'] == "") {
$p_header['status'] = "filtered";
}
// ----- Check the path length
if (strlen($p_header['stored_filename']) > 0xFF) {
$p_header['status'] = 'filename_too_long';
@@ -2867,7 +2867,7 @@
// ----- Look for a file
if ($p_filedescr['type'] == 'file') {
// ----- Look for using temporary file to zip
if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
&& (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
|| (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
&& ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {
@@ -2876,12 +2876,12 @@
return $v_result;
}
}
// ----- Use "in memory" zip algo
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression.");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression.");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file");
// ----- Open the source file
@@ -2893,15 +2893,15 @@
// ----- Read the file content
$v_content = @fread($v_file, $p_header['size']);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes");
// ----- Close the file
@fclose($v_file);
// ----- Calculate the CRC
$p_header['crc'] = @crc32($v_content);
// ----- Look for no compression
if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
@@ -2909,20 +2909,20 @@
$p_header['compressed_size'] = $p_header['size'];
$p_header['compression'] = 0;
}
// ----- Look for normal compression
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
// ----- Compress the content
$v_content = @gzdeflate($v_content);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes");
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes");
// ----- Set header parameters
$p_header['compressed_size'] = strlen($v_content);
$p_header['compression'] = 8;
}
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
@fclose($v_file);
@@ -2939,13 +2939,13 @@
// ----- Look for a virtual file (a file from string)
else if ($p_filedescr['type'] == 'virtual_file') {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Add by string");
$v_content = $p_filedescr['content'];
// ----- Calculate the CRC
$p_header['crc'] = @crc32($v_content);
// ----- Look for no compression
if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
@@ -2953,7 +2953,7 @@
$p_header['compressed_size'] = $p_header['size'];
$p_header['compression'] = 0;
}
// ----- Look for normal compression
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
@@ -2964,7 +2964,7 @@
$p_header['compressed_size'] = strlen($v_content);
$p_header['compression'] = 8;
}
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
@fclose($v_file);
@@ -3035,7 +3035,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileUsingTempFile", "filename='".$p_filedescr['filename']."'");
$v_result=PCLZIP_ERR_NO_ERROR;
// ----- Working variable
$p_filename = $p_filedescr['filename'];
@@ -3153,7 +3153,7 @@
// ----- Unlink the temporary file
@unlink($v_gzip_temp_name);
// ----- Return
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
@@ -3172,7 +3172,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'");
$v_result=1;
// ----- Working variables
$p_filename = $p_filedescr['filename'];
if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
@@ -3201,7 +3201,7 @@
$v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'");
}
// ----- Look for path and/or short name change
else {
@@ -3234,7 +3234,7 @@
if ( (substr($p_filename, 0, 2) == "./")
|| (substr($p_remove_dir, 0, 2) == "./")) {
if ( (substr($p_filename, 0, 2) == "./")
&& (substr($p_remove_dir, 0, 2) != "./")) {
$p_remove_dir = "./".$p_remove_dir;
@@ -3260,10 +3260,10 @@
}
}
}
// ----- Remove drive letter if any
$v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);
// ----- Look for path to add
if ($p_add_dir != "") {
if (substr($p_add_dir, -1) == "/")
@@ -3278,7 +3278,7 @@
$v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
$p_filedescr['stored_filename'] = $v_stored_filename;
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename']));
// ----- Return
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
@@ -3443,7 +3443,7 @@
{
// ----- Magic quotes trick
$this->privSwapBackMagicQuotes();
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
@@ -3726,7 +3726,7 @@
else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
&& ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
// ----- Look if the index is in the list
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");
@@ -3766,7 +3766,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
$this->privSwapBackMagicQuotes();
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
"Filename '".$v_header['stored_filename']."' is "
."compressed by an unsupported compression "
@@ -3776,7 +3776,7 @@
return PclZip::errorCode();
}
}
// ----- Check encrypted files
if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
@@ -3813,7 +3813,7 @@
$v_extract = false;
}
// ----- Look for real extraction
if ($v_extract)
{
@@ -3867,7 +3867,7 @@
// ----- Next extracted file
$v_nb_extracted++;
// ----- Look for user callback abort
if ($v_result1 == 2) {
break;
@@ -4019,13 +4019,13 @@
if ($p_path != '') {
$p_entry['filename'] = $p_path."/".$p_entry['filename'];
}
// ----- Check a base_dir_restriction
if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction");
$v_inclusion
= PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
$p_entry['filename']);
$p_entry['filename']);
if ($v_inclusion == 0) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction");
@@ -4055,7 +4055,7 @@
$p_entry['status'] = "skipped";
$v_result = 1;
}
// ----- Look for abort result
if ($v_result == 2) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
@@ -4087,7 +4087,7 @@
// ----- Change the file status
$p_entry['status'] = "already_a_directory";
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
// For historical reason first PclZip implementation does not stop
// when this kind of error occurs.
@@ -4172,10 +4172,10 @@
if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'");
// ----- Change the file status
$p_entry['status'] = "path_creation_fail";
// ----- Return
////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
//return $v_result;
@@ -4220,7 +4220,7 @@
$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@fwrite($v_dest_file, $v_binary_data, $v_read_size);
*/
@fwrite($v_dest_file, $v_buffer, $v_read_size);
@fwrite($v_dest_file, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
}
@@ -4229,7 +4229,7 @@
// ----- Change the file mtime
touch($p_entry['filename'], $p_entry['mtime']);
}
else {
@@ -4245,7 +4245,7 @@
// ----- Look for using temporary file to unzip
if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
&& (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
|| (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
&& ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {
@@ -4254,47 +4254,47 @@
return $v_result;
}
}
// ----- Look for extract in memory
else {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes");
// ----- Read the compressed file in a buffer (one shot)
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
// ----- Decompress the file
$v_file_content = @gzinflate($v_buffer);
unset($v_buffer);
if ($v_file_content === FALSE) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file");
// ----- Change the file status
// TBC
$p_entry['status'] = "error";
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Opening destination file
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
// ----- Change the file status
$p_entry['status'] = "write_error";
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Write the uncompressed data
@fwrite($v_dest_file, $v_file_content, $p_entry['size']);
unset($v_file_content);
// ----- Closing the destination file
@fclose($v_dest_file);
}
// ----- Change the file mtime
@@ -4317,7 +4317,7 @@
if ($p_entry['status'] == "aborted") {
$p_entry['status'] = "skipped";
}
// ----- Look for post-extract callback
elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
@@ -4354,7 +4354,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileUsingTempFile', "filename='".$p_entry['filename']."'");
$v_result=1;
// ----- Creates a temporary file
$v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
@@ -4426,7 +4426,7 @@
// ----- Delete the temporary file
@unlink($v_gzip_temp_name);
// ----- Return
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
@@ -4515,7 +4515,7 @@
// ----- Read the compressed file in a buffer (one shot)
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
// ----- Decompress the file
$v_file_content = gzinflate($v_buffer);
unset($v_buffer);
@@ -4604,7 +4604,7 @@
// ----- Reading the file
$v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
// ----- Decompress the file
if (($p_string = @gzinflate($v_data)) === FALSE) {
// TBC
@@ -4921,7 +4921,7 @@
if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed');
}
// ----- Look for flag bit 3
if (($p_local_header['flag'] & 8) == 8) {
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !');
@@ -5026,9 +5026,9 @@
// ----- Add the byte
// $v_bytes = ($v_bytes << 8) | Ord($v_byte);
// Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
// Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
$v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
// Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
// Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
$v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
// ----- Compare the bytes
if ($v_bytes == 0x504b0506)
@@ -5363,7 +5363,7 @@
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Check that local file header is same as central file header
if ($this->privCheckFileHeaders($v_local_header,
$v_header_list[$i]) != 1) {
@@ -5456,11 +5456,11 @@
// TBC : I should test the result ...
//@rename($v_zip_temp_name, $this->zipname);
PclZipUtilRename($v_zip_temp_name, $this->zipname);
// ----- Destroy the temporary archive
unset($v_temp_zip);
}
// ----- Remove every files : reset the file
else if ($v_central_dir['entries'] != 0) {
$this->privCloseFd();
@@ -6008,7 +6008,7 @@
}
}
}
// ----- Look for skip
if ($v_skip > 0) {
while ($v_skip > 0) {
@@ -6043,7 +6043,7 @@
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
$v_result = 1;
// ----- Look for path beginning by ./
if ( ($p_dir == '.')
|| ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
@@ -6234,7 +6234,7 @@
function PclZipUtilOptionText($p_option)
{
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");
$v_list = get_defined_constants();
for (reset($v_list); $v_key = key($v_list); next($v_list)) {
$v_prefix = substr($v_key, 0, 10);
@@ -6246,7 +6246,7 @@
return $v_key;
}
}
$v_result = 'Unknown';
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);

View File

@@ -18,7 +18,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
var $errors = null;
/**
* constructor
*
*
* @param $arg mixed ingored argument
*/
function WP_Filesystem_Direct($arg) {
@@ -27,7 +27,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* connect filesystem.
*
*
* @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct).
*/
function connect() {
@@ -35,26 +35,26 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Reads entire file into a string
*
*
* @param $file string Name of the file to read.
* @return string|bool The function returns the read data or false on failure.
* @return string|bool The function returns the read data or false on failure.
*/
function get_contents($file) {
return @file_get_contents($file);
}
/**
* Reads entire file into an array
*
* @param $file string Path to the file.
* @return array|bool the file contents in an array or false on failure.
*
* @param $file string Path to the file.
* @return array|bool the file contents in an array or false on failure.
*/
function get_contents_array($file) {
return @file($file);
}
/**
* Write a string to a file
*
* @param $file string Path to the file where to write the data.
*
* @param $file string Path to the file where to write the data.
* @param $contents string The data to write.
* @param $mode int (optional) The file permissions as octal number, usually 0644.
* @param $type string (optional) Specifies additional type of access you require to the file.
@@ -70,8 +70,8 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Gets the current working directory
*
* @return string|bool the current working directory on success, or false on failure.
*
* @return string|bool the current working directory on success, or false on failure.
*/
function cwd() {
return @getcwd();
@@ -79,7 +79,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
/**
* Change directory
*
* @param $dir string The new current directory.
* @param $dir string The new current directory.
* @return bool Returns true on success or false on failure.
*/
function chdir($dir) {
@@ -87,10 +87,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Changes file group
*
* @param $file string Path to the file.
*
* @param $file string Path to the file.
* @param $group mixed A group name or number.
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chgrp($file, $group, $recursive = false) {
@@ -110,10 +110,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Changes filesystem permissions
*
*
* @param $file string Path to the file.
* @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chmod($file, $mode = false, $recursive = false) {
@@ -126,7 +126,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
elseif ( $this->is_dir($file) )
$mode = FS_CHMOD_DIR;
else
return false;
return false;
}
if ( ! $recursive )
@@ -143,10 +143,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Changes file owner
*
* @param $file string Path to the file.
*
* @param $file string Path to the file.
* @param $owner mixed A user name or number.
* @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
* @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chown($file, $owner, $recursive = false) {
@@ -165,8 +165,8 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Gets file owner
*
* @param $file string Path to the file.
*
* @param $file string Path to the file.
* @return string Username of the user.
*/
function owner($file) {
@@ -180,10 +180,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
}
/**
* Gets file permissions
*
*
* FIXME does not handle errors in fileperms()
*
* @param $file string Path to the file.
*
* @param $file string Path to the file.
* @return string Mode of the file (last 4 digits).
*/
function getchmod($file) {

View File

@@ -149,7 +149,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
elseif ( $this->is_dir($file) )
$mode = FS_CHMOD_DIR;
else
return false;
return false;
}
if ( ! $recursive || ! $this->is_dir($file) ) {

View File

@@ -160,7 +160,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
elseif ( $this->is_dir($file) )
$mode = FS_CHMOD_DIR;
else
return false;
return false;
}
if ( ! $recursive || ! $this->is_dir($file) ) {

View File

@@ -194,7 +194,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
elseif ( $this->is_dir($file) )
$mode = FS_CHMOD_DIR;
else
return false;
return false;
}
if ( ! $recursive || ! $this->is_dir($file) )

View File

@@ -570,7 +570,7 @@ class Theme_Upgrader extends WP_Upgrader {
$this->skin->after();
return false;
}
$r = $current->response[ $theme ];
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
@@ -1006,10 +1006,10 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
$name = $theme_info['Name'];
$stylesheet = $this->upgrader->result['destination_name'];
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) );
$activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
$update_actions = array(
'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>',
'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>',

View File

@@ -268,7 +268,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
// Don't export revisions. They bloat the export.
if ( 'revision' == $post->post_type )
continue;
setup_postdata($post);
setup_postdata($post);
$is_sticky = 0;
if ( is_sticky( $post->ID ) )

View File

@@ -598,7 +598,7 @@ function WP_Filesystem( $args = false, $context = false ) {
$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method);
if( ! file_exists($abstraction_file) )
return;
require_once($abstraction_file);
}
$method = "WP_Filesystem_$method";

View File

@@ -42,7 +42,7 @@ function wp_image_editor($post_id) {
<div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-fliph" title="<?php echo esc_attr__( 'Flip horizontally' ); ?>"></div>
<div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-flipv" title="<?php echo esc_attr__( 'Flip vertically' ); ?>"></div>
<div id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-undo disabled" title="<?php echo esc_attr__( 'Undo' ); ?>"></div>
<div id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-redo disabled" title="<?php echo esc_attr__( 'Redo' ); ?>"></div>
<br class="clear" />

View File

@@ -615,7 +615,7 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
} else {
$menu[$position] = $new_menu;
}
$_registered_pages[$hookname] = true;
return $hookname;
@@ -623,17 +623,17 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
global $_wp_last_object_menu;
$_wp_last_object_menu++;
return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu);
}
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
global $_wp_last_utility_menu;
$_wp_last_utility_menu++;
return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu);
}
@@ -674,7 +674,7 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
$_registered_pages[$hookname] = true;
// backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php
if ( 'tools.php' == $parent )
if ( 'tools.php' == $parent )
$_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;
return $hookname;

View File

@@ -1078,7 +1078,7 @@ function wp_set_post_lock( $post_id ) {
/**
* Outputs the notice message to say that someone else is editing this post at the moment.
*
*
* @since 2.9.0
* @return none
*/
@@ -1086,7 +1086,7 @@ function _admin_notice_post_locked() {
global $post;
$last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
switch ($post->post_type) {
case 'post':
$message = __( 'Warning: %s is currently editing this post' );
@@ -1097,9 +1097,9 @@ function _admin_notice_post_locked() {
default:
$message = __( 'Warning: %s is currently editing this.' );
}
$message = sprintf( $message, esc_html( $last_user_name ) );
echo "<div class='error'><p>$message</p></div>";
echo "<div class='error'><p>$message</p></div>";
}
/**

View File

@@ -2065,7 +2065,7 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
} else {
$query .= "AND $approved $post $typesql";
}
$comments = $wpdb->get_results("SELECT * $query $orderby");
if ( '' === $total )
$total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");

View File

@@ -54,7 +54,7 @@ function display_setup_form( $error = null ) {
if ( isset($_POST) && !empty($_POST) ) {
$blog_public = isset($_POST['blog_public']);
}
if ( ! is_null( $error ) ) {
?>
<p><?php printf( __('<strong>ERROR</strong>: %s'), $error); ?></p>

View File

@@ -60,7 +60,7 @@ case 'edit' :
if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn&#8217;t exist. Perhaps it was deleted?') );
if ( $att->post_status == 'trash' ) wp_die( __('You can&#8217;t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') );
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
wp_enqueue_script( 'wp-ajax-response' );

View File

@@ -131,7 +131,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) {
// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file);
if ( $parent_exists )
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";

View File

@@ -61,7 +61,7 @@ if ( !empty($action) ) {
case 'activate-selected':
if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this blog.'));
check_admin_referer('bulk-manage-plugins');
$plugins = (array) $_POST['checked'];

View File

@@ -68,7 +68,7 @@ switch ( $step ) :
break;
case 1:
wp_upgrade();
$backto = empty($_GET['backto']) ? '' : $_GET['backto'] ;
$backto = stripslashes( urldecode( $backto ) );
$backto = esc_url_raw( $backto );

View File

@@ -69,7 +69,7 @@ if ( isset($_GET['find_detached']) ) {
} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
check_admin_referer('bulk-media');
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
$doaction = 'delete';
@@ -78,7 +78,7 @@ if ( isset($_GET['find_detached']) ) {
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
} else
wp_redirect($_SERVER['HTTP_REFERER']);
$location = 'upload.php';
if ( $referer = wp_get_referer() ) {
if ( false !== strpos($referer, 'upload.php') )
@@ -90,7 +90,7 @@ if ( isset($_GET['find_detached']) ) {
foreach( (array) $post_ids as $post_id ) {
if ( !current_user_can('delete_post', $post_id) )
wp_die( __('You are not allowed to move this post to the trash.') );
if ( !wp_trash_post($post_id) )
wp_die( __('Error in moving to trash...') );
}
@@ -100,7 +100,7 @@ if ( isset($_GET['find_detached']) ) {
foreach( (array) $post_ids as $post_id ) {
if ( !current_user_can('delete_post', $post_id) )
wp_die( __('You are not allowed to move this post out of the trash.') );
if ( !wp_untrash_post($post_id) )
wp_die( __('Error in restoring from trash...') );
}
@@ -110,7 +110,7 @@ if ( isset($_GET['find_detached']) ) {
foreach( (array) $post_ids as $post_id_del ) {
if ( !current_user_can('delete_post', $post_id_del) )
wp_die( __('You are not allowed to delete this post.') );
if ( !wp_delete_attachment($post_id_del) )
wp_die( __('Error in deleting...') );
}

View File

@@ -273,7 +273,7 @@ else
<tr>
<th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th>
<td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td>
</tr>
</tr>
<?php
}
?>