Remove trailing whites.
git-svn-id: https://develop.svn.wordpress.org/trunk@7130 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d690f0f9e7
commit
6d7441c26e
@ -27,7 +27,7 @@ get_admin_page_title();
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||||
<title><?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress</title>
|
<title><?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress</title>
|
||||||
<?php
|
<?php
|
||||||
wp_admin_css( 'css/global' );
|
wp_admin_css( 'css/global' );
|
||||||
wp_admin_css();
|
wp_admin_css();
|
||||||
?>
|
?>
|
||||||
|
@ -51,7 +51,7 @@ if ( !empty($content) ) {
|
|||||||
<head>
|
<head>
|
||||||
<title><?php bloginfo('name') ?> › Bookmarklet — WordPress</title>
|
<title><?php bloginfo('name') ?> › Bookmarklet — WordPress</title>
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||||
<?php
|
<?php
|
||||||
wp_admin_css( 'css/global' );
|
wp_admin_css( 'css/global' );
|
||||||
wp_admin_css();
|
wp_admin_css();
|
||||||
?>
|
?>
|
||||||
|
@ -97,7 +97,7 @@ default:
|
|||||||
|
|
||||||
if ( !empty($_GET['_wp_http_referer']) ) {
|
if ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_enqueue_script( 'admin-categories' );
|
wp_enqueue_script( 'admin-categories' );
|
||||||
|
@ -50,7 +50,7 @@ td input { font-size: 1.5em; }
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
font-size: 13px !important;
|
font-size: 13px !important;
|
||||||
-moz-border-radius: 2px;
|
-moz-border-radius: 2px;
|
||||||
-khtml-border-radius: 2px;
|
-khtml-border-radius: 2px;
|
||||||
-webkit-border-radius: 2px;
|
-webkit-border-radius: 2px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
color: #246;
|
color: #246;
|
||||||
|
@ -29,7 +29,7 @@ form .submit input {
|
|||||||
border: none;
|
border: none;
|
||||||
margin-top: -6px;
|
margin-top: -6px;
|
||||||
-moz-border-radius: 2px;
|
-moz-border-radius: 2px;
|
||||||
-khtml-border-radius: 2px;
|
-khtml-border-radius: 2px;
|
||||||
-webkit-border-radius: 2px;
|
-webkit-border-radius: 2px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ p#widget-search {
|
|||||||
|
|
||||||
div#widget-content {
|
div#widget-content {
|
||||||
border-bottom: 1px solid #ccc;
|
border-bottom: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul#widget-list {
|
ul#widget-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
@ -9,7 +9,7 @@ wp_enqueue_script('admin-forms');
|
|||||||
if ( !empty( $_REQUEST['delete_comments'] ) ) {
|
if ( !empty( $_REQUEST['delete_comments'] ) ) {
|
||||||
check_admin_referer('bulk-comments');
|
check_admin_referer('bulk-comments');
|
||||||
|
|
||||||
$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
|
$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
|
||||||
foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
|
foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
|
||||||
$comment = (int) $comment;
|
$comment = (int) $comment;
|
||||||
$post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
|
$post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
|
||||||
@ -40,7 +40,7 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) {
|
|||||||
wp_redirect( $redirect_to );
|
wp_redirect( $redirect_to );
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
@ -178,7 +178,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
|
|||||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" />
|
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" />
|
||||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||||
<div id="edit-slug-box">
|
<div id="edit-slug-box">
|
||||||
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
||||||
echo $sample_permalink_html;
|
echo $sample_permalink_html;
|
||||||
endif; ?>
|
endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +22,7 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
|||||||
exit();
|
exit();
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = __('Link Categories');
|
$title = __('Link Categories');
|
||||||
|
@ -153,7 +153,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
|
|||||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" />
|
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" />
|
||||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||||
<div id="edit-slug-box">
|
<div id="edit-slug-box">
|
||||||
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
||||||
echo $sample_permalink_html;
|
echo $sample_permalink_html;
|
||||||
endif; ?>
|
endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,7 +28,7 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
|||||||
exit();
|
exit();
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = __('Pages');
|
$title = __('Pages');
|
||||||
@ -72,7 +72,7 @@ printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matchin
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$avail_post_stati = get_available_post_statuses('page');
|
$avail_post_stati = get_available_post_statuses('page');
|
||||||
|
|
||||||
$status_links = array();
|
$status_links = array();
|
||||||
$num_posts = wp_count_posts('page', 'readable');
|
$num_posts = wp_count_posts('page', 'readable');
|
||||||
foreach ( $post_stati as $status => $label ) {
|
foreach ( $post_stati as $status => $label ) {
|
||||||
@ -80,7 +80,7 @@ foreach ( $post_stati as $status => $label ) {
|
|||||||
|
|
||||||
if ( !in_array($status, $avail_post_stati) )
|
if ( !in_array($status, $avail_post_stati) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( $status == $_GET['post_status'] )
|
if ( $status == $_GET['post_status'] )
|
||||||
$class = ' class="current"';
|
$class = ' class="current"';
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ default:
|
|||||||
|
|
||||||
if ( !empty($_GET['_wp_http_referer']) ) {
|
if ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_enqueue_script( 'admin-tags' );
|
wp_enqueue_script( 'admin-tags' );
|
||||||
|
@ -28,7 +28,7 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
|||||||
exit();
|
exit();
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = __('Posts');
|
$title = __('Posts');
|
||||||
@ -154,12 +154,12 @@ foreach ($arc_result as $arc_row) {
|
|||||||
if ( $arc_row->yyear == 0 )
|
if ( $arc_row->yyear == 0 )
|
||||||
continue;
|
continue;
|
||||||
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
||||||
|
|
||||||
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
|
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
|
||||||
$default = ' selected="selected"';
|
$default = ' selected="selected"';
|
||||||
else
|
else
|
||||||
$default = '';
|
$default = '';
|
||||||
|
|
||||||
echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
|
echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
|
||||||
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
||||||
echo "</option>\n";
|
echo "</option>\n";
|
||||||
|
@ -14,7 +14,7 @@ class ftp_base {
|
|||||||
var $Verbose;
|
var $Verbose;
|
||||||
var $OS_local;
|
var $OS_local;
|
||||||
var $OS_remote;
|
var $OS_remote;
|
||||||
|
|
||||||
/* Private variables */
|
/* Private variables */
|
||||||
var $_lastaction;
|
var $_lastaction;
|
||||||
var $_errors;
|
var $_errors;
|
||||||
@ -601,7 +601,7 @@ class ftp_base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mget($remote, $local=".", $continious=false) {
|
function mget($remote, $local=".", $continious=false) {
|
||||||
@ -649,13 +649,13 @@ class ftp_base {
|
|||||||
$this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
|
$this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($list as $k=>$v) {
|
foreach($list as $k=>$v) {
|
||||||
$list[$k]=$this->parselisting($v);
|
$list[$k]=$this->parselisting($v);
|
||||||
if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
|
if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
|
||||||
}
|
}
|
||||||
$ret=true;
|
$ret=true;
|
||||||
|
|
||||||
foreach($list as $el) {
|
foreach($list as $el) {
|
||||||
if ( empty($el) )
|
if ( empty($el) )
|
||||||
continue;
|
continue;
|
||||||
@ -673,7 +673,7 @@ class ftp_base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->rmdir($remote)) {
|
if(!$this->rmdir($remote)) {
|
||||||
$this->PushError("mdel", "can't delete folder", "Can't delete remote folder \"".$remote."/".$el["name"]."\"");
|
$this->PushError("mdel", "can't delete folder", "Can't delete remote folder \"".$remote."/".$el["name"]."\"");
|
||||||
$ret=false;
|
$ret=false;
|
||||||
@ -813,7 +813,7 @@ class ftp_base {
|
|||||||
$this->SendMSG($fctname.': '.$msg.$tmp);
|
$this->SendMSG($fctname.': '.$msg.$tmp);
|
||||||
return(array_push($this->_error_array,$error));
|
return(array_push($this->_error_array,$error));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rcupre une erreur externe
|
// Rcupre une erreur externe
|
||||||
function PopError(){
|
function PopError(){
|
||||||
if(count($this->_error_array)) return(array_pop($this->_error_array));
|
if(count($this->_error_array)) return(array_pop($this->_error_array));
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
// ----- Constants
|
// ----- Constants
|
||||||
define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
|
define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
|
||||||
|
|
||||||
// ----- File list separator
|
// ----- File list separator
|
||||||
// In version 1.x of PclZip, the separator for file list is a space
|
// 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 !).
|
// (which is not a very smart choice, specifically for windows paths !).
|
||||||
@ -126,7 +126,7 @@
|
|||||||
// which is not correctly supported by PHP ...
|
// which is not correctly supported by PHP ...
|
||||||
//define( 'PCLZIP_OPT_CRYPT', 77018 );
|
//define( 'PCLZIP_OPT_CRYPT', 77018 );
|
||||||
define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );
|
define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );
|
||||||
|
|
||||||
// ----- File description attributes
|
// ----- File description attributes
|
||||||
define( 'PCLZIP_ATT_FILE_NAME', 79001 );
|
define( 'PCLZIP_ATT_FILE_NAME', 79001 );
|
||||||
define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
|
define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
|
||||||
@ -169,7 +169,7 @@
|
|||||||
// ----- Internal error handling
|
// ----- Internal error handling
|
||||||
var $error_code = 1;
|
var $error_code = 1;
|
||||||
var $error_string = '';
|
var $error_string = '';
|
||||||
|
|
||||||
// ----- Current status of the magic_quotes_runtime
|
// ----- Current status of the magic_quotes_runtime
|
||||||
// This value store the php configuration for magic_quotes
|
// This value store the php configuration for magic_quotes
|
||||||
// The class can then disable the magic_quotes and reset it after
|
// The class can then disable the magic_quotes and reset it after
|
||||||
@ -315,16 +315,16 @@
|
|||||||
$v_att_list = array();
|
$v_att_list = array();
|
||||||
$v_filedescr_list = array();
|
$v_filedescr_list = array();
|
||||||
$p_result_list = array();
|
$p_result_list = array();
|
||||||
|
|
||||||
// ----- Look if the $p_filelist is really an array
|
// ----- Look if the $p_filelist is really an array
|
||||||
if (is_array($p_filelist)) {
|
if (is_array($p_filelist)) {
|
||||||
|
|
||||||
// ----- Look if the first element is also an array
|
// ----- Look if the first element is also an array
|
||||||
// This will mean that this is a file description entry
|
// This will mean that this is a file description entry
|
||||||
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
|
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
|
||||||
$v_att_list = $p_filelist;
|
$v_att_list = $p_filelist;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- The list is a list of string names
|
// ----- The list is a list of string names
|
||||||
else {
|
else {
|
||||||
$v_string_list = $p_filelist;
|
$v_string_list = $p_filelist;
|
||||||
@ -343,7 +343,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Reformat the string list
|
// ----- Reformat the string list
|
||||||
if (sizeof($v_string_list) != 0) {
|
if (sizeof($v_string_list) != 0) {
|
||||||
foreach ($v_string_list as $v_string) {
|
foreach ($v_string_list as $v_string) {
|
||||||
@ -355,7 +355,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- For each file in the list check the attributes
|
// ----- For each file in the list check the attributes
|
||||||
$v_supported_attributes
|
$v_supported_attributes
|
||||||
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
|
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
|
||||||
@ -505,16 +505,16 @@
|
|||||||
$v_att_list = array();
|
$v_att_list = array();
|
||||||
$v_filedescr_list = array();
|
$v_filedescr_list = array();
|
||||||
$p_result_list = array();
|
$p_result_list = array();
|
||||||
|
|
||||||
// ----- Look if the $p_filelist is really an array
|
// ----- Look if the $p_filelist is really an array
|
||||||
if (is_array($p_filelist)) {
|
if (is_array($p_filelist)) {
|
||||||
|
|
||||||
// ----- Look if the first element is also an array
|
// ----- Look if the first element is also an array
|
||||||
// This will mean that this is a file description entry
|
// This will mean that this is a file description entry
|
||||||
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
|
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
|
||||||
$v_att_list = $p_filelist;
|
$v_att_list = $p_filelist;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- The list is a list of string names
|
// ----- The list is a list of string names
|
||||||
else {
|
else {
|
||||||
$v_string_list = $p_filelist;
|
$v_string_list = $p_filelist;
|
||||||
@ -533,14 +533,14 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Reformat the string list
|
// ----- Reformat the string list
|
||||||
if (sizeof($v_string_list) != 0) {
|
if (sizeof($v_string_list) != 0) {
|
||||||
foreach ($v_string_list as $v_string) {
|
foreach ($v_string_list as $v_string) {
|
||||||
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
|
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- For each file in the list check the attributes
|
// ----- For each file in the list check the attributes
|
||||||
$v_supported_attributes
|
$v_supported_attributes
|
||||||
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
|
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
|
||||||
@ -990,7 +990,7 @@
|
|||||||
// Options :
|
// Options :
|
||||||
// PCLZIP_OPT_BY_INDEX :
|
// PCLZIP_OPT_BY_INDEX :
|
||||||
// PCLZIP_OPT_BY_NAME :
|
// PCLZIP_OPT_BY_NAME :
|
||||||
// PCLZIP_OPT_BY_EREG :
|
// PCLZIP_OPT_BY_EREG :
|
||||||
// PCLZIP_OPT_BY_PREG :
|
// PCLZIP_OPT_BY_PREG :
|
||||||
// Return Values :
|
// Return Values :
|
||||||
// 0 on failure,
|
// 0 on failure,
|
||||||
@ -1065,7 +1065,7 @@
|
|||||||
function deleteByIndex($p_index)
|
function deleteByIndex($p_index)
|
||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");
|
||||||
|
|
||||||
$p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
|
$p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
|
||||||
|
|
||||||
// ----- Return
|
// ----- Return
|
||||||
@ -1119,7 +1119,7 @@
|
|||||||
if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
|
if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
|
||||||
{
|
{
|
||||||
$this->privSwapBackMagicQuotes();
|
$this->privSwapBackMagicQuotes();
|
||||||
|
|
||||||
// ----- Error log
|
// ----- Error log
|
||||||
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
|
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
|
||||||
|
|
||||||
@ -1448,7 +1448,7 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- Read the options
|
// ----- Read the options
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i<$p_size) {
|
while ($i<$p_size) {
|
||||||
@ -1645,7 +1645,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
||||||
return PclZip::errorCode();
|
return PclZip::errorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Reduce the index list
|
// ----- Reduce the index list
|
||||||
// each index item in the list must be a couple with a start and
|
// each index item in the list must be a couple with a start and
|
||||||
// an end value : [0,3], [5-5], [8-10], ...
|
// an end value : [0,3], [5-5], [8-10], ...
|
||||||
@ -1656,10 +1656,10 @@
|
|||||||
// ----- Explode the item
|
// ----- Explode the item
|
||||||
$v_item_list = explode("-", $v_work_list[$j]);
|
$v_item_list = explode("-", $v_work_list[$j]);
|
||||||
$v_size_item_list = sizeof($v_item_list);
|
$v_size_item_list = sizeof($v_item_list);
|
||||||
|
|
||||||
// ----- TBC : Here we might check that each item is a
|
// ----- TBC : Here we might check that each item is a
|
||||||
// real integer ...
|
// real integer ...
|
||||||
|
|
||||||
// ----- Look for single value
|
// ----- Look for single value
|
||||||
if ($v_size_item_list == 1) {
|
if ($v_size_item_list == 1) {
|
||||||
// ----- Set the option value
|
// ----- Set the option value
|
||||||
@ -1697,7 +1697,7 @@
|
|||||||
}
|
}
|
||||||
$v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
|
$v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Sort the items
|
// ----- Sort the items
|
||||||
if ($v_sort_flag) {
|
if ($v_sort_flag) {
|
||||||
// TBC : To Be Completed
|
// TBC : To Be Completed
|
||||||
@ -1829,10 +1829,10 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", "");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", "");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- For each file in the list check the attributes
|
// ----- For each file in the list check the attributes
|
||||||
foreach ($p_file_list as $v_key => $v_value) {
|
foreach ($p_file_list as $v_key => $v_value) {
|
||||||
|
|
||||||
// ----- Check if the option is supported
|
// ----- Check if the option is supported
|
||||||
if (!isset($v_requested_options[$v_key])) {
|
if (!isset($v_requested_options[$v_key])) {
|
||||||
// ----- Error log
|
// ----- Error log
|
||||||
@ -1854,7 +1854,7 @@
|
|||||||
|
|
||||||
$p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
|
$p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
|
||||||
|
|
||||||
if ($p_filedescr['filename'] == '') {
|
if ($p_filedescr['filename'] == '') {
|
||||||
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
|
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
||||||
@ -1922,10 +1922,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// end foreach
|
// end foreach
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Return
|
// ----- Return
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
@ -1944,21 +1944,21 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", "");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", "");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- Create a result list
|
// ----- Create a result list
|
||||||
$v_result_list = array();
|
$v_result_list = array();
|
||||||
|
|
||||||
// ----- Look each entry
|
// ----- Look each entry
|
||||||
for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
|
for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
|
||||||
// ----- Get filedescr
|
// ----- Get filedescr
|
||||||
$v_descr = $p_filedescr_list[$i];
|
$v_descr = $p_filedescr_list[$i];
|
||||||
|
|
||||||
// ----- Reduce the filename
|
// ----- Reduce the filename
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'");
|
||||||
$v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename']);
|
$v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename']);
|
||||||
$v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
|
$v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'");
|
||||||
|
|
||||||
// ----- Get type of descr
|
// ----- Get type of descr
|
||||||
if (!file_exists($v_descr['filename'])) {
|
if (!file_exists($v_descr['filename'])) {
|
||||||
// ----- Error log
|
// ----- Error log
|
||||||
@ -1987,13 +1987,13 @@
|
|||||||
// skip
|
// skip
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Calculate the stored filename
|
// ----- Calculate the stored filename
|
||||||
$this->privCalculateStoredFilename($v_descr, $p_options);
|
$this->privCalculateStoredFilename($v_descr, $p_options);
|
||||||
|
|
||||||
// ----- Add the descriptor in result list
|
// ----- Add the descriptor in result list
|
||||||
$v_result_list[sizeof($v_result_list)] = $v_descr;
|
$v_result_list[sizeof($v_result_list)] = $v_descr;
|
||||||
|
|
||||||
// ----- Look for folder
|
// ----- Look for folder
|
||||||
if ($v_descr['type'] == 'folder') {
|
if ($v_descr['type'] == 'folder') {
|
||||||
// ----- List of items in folder
|
// ----- List of items in folder
|
||||||
@ -2007,17 +2007,17 @@
|
|||||||
if (($v_item_handler == '.') || ($v_item_handler == '..')) {
|
if (($v_item_handler == '.') || ($v_item_handler == '..')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Compose the full filename
|
// ----- Compose the full filename
|
||||||
$v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
|
$v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
|
||||||
|
|
||||||
// ----- Look for different stored filename
|
// ----- Look for different stored filename
|
||||||
// Because the name of the folder was changed, the name of the
|
// Because the name of the folder was changed, the name of the
|
||||||
// files/sub-folders also change
|
// files/sub-folders also change
|
||||||
if ($v_descr['stored_filename'] != $v_descr['filename']) {
|
if ($v_descr['stored_filename'] != $v_descr['filename']) {
|
||||||
$v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
|
$v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
$v_dirlist_nb++;
|
$v_dirlist_nb++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2025,7 +2025,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped.");
|
//--(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
|
// TBC : unable to open folder in read mode
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Expand each element of the list
|
// ----- Expand each element of the list
|
||||||
if ($v_dirlist_nb != 0) {
|
if ($v_dirlist_nb != 0) {
|
||||||
// ----- Expand
|
// ----- Expand
|
||||||
@ -2033,7 +2033,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Concat the resulting list
|
// ----- 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)."')");
|
//--(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);
|
$v_result_list = array_merge($v_result_list, $v_dirlist_descr);
|
||||||
@ -2042,12 +2042,12 @@
|
|||||||
else {
|
else {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand.");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Free local array
|
// ----- Free local array
|
||||||
unset($v_dirlist_descr);
|
unset($v_dirlist_descr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Get the result list
|
// ----- Get the result list
|
||||||
$p_filedescr_list = $v_result_list;
|
$p_filedescr_list = $v_result_list;
|
||||||
|
|
||||||
@ -2068,7 +2068,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
$v_list_detail = array();
|
$v_list_detail = array();
|
||||||
|
|
||||||
// ----- Magic quotes trick
|
// ----- Magic quotes trick
|
||||||
$this->privDisableMagicQuotes();
|
$this->privDisableMagicQuotes();
|
||||||
|
|
||||||
@ -2429,7 +2429,7 @@
|
|||||||
// Function : privAddFileList()
|
// Function : privAddFileList()
|
||||||
// Description :
|
// Description :
|
||||||
// Parameters :
|
// 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
|
// or directory names to add in the zip
|
||||||
// $p_result_list : list of added files with their properties (specially the status field)
|
// $p_result_list : list of added files with their properties (specially the status field)
|
||||||
// Return Values :
|
// Return Values :
|
||||||
@ -2449,7 +2449,7 @@
|
|||||||
// ----- Format the filename
|
// ----- Format the filename
|
||||||
$p_filedescr_list[$j]['filename']
|
$p_filedescr_list[$j]['filename']
|
||||||
= PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
|
= PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
|
||||||
|
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'");
|
||||||
|
|
||||||
// ----- Skip empty file names
|
// ----- Skip empty file names
|
||||||
@ -2503,7 +2503,7 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- Working variable
|
// ----- Working variable
|
||||||
$p_filename = $p_filedescr['filename'];
|
$p_filename = $p_filedescr['filename'];
|
||||||
|
|
||||||
@ -2516,8 +2516,8 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
|
||||||
return PclZip::errorCode();
|
return PclZip::errorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for a stored different filename
|
// ----- Look for a stored different filename
|
||||||
if (isset($p_filedescr['stored_filename'])) {
|
if (isset($p_filedescr['stored_filename'])) {
|
||||||
$v_stored_filename = $p_filedescr['stored_filename'];
|
$v_stored_filename = $p_filedescr['stored_filename'];
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"');
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"');
|
||||||
@ -2583,7 +2583,7 @@
|
|||||||
if ($p_header['stored_filename'] == "") {
|
if ($p_header['stored_filename'] == "") {
|
||||||
$p_header['status'] = "filtered";
|
$p_header['status'] = "filtered";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Check the path length
|
// ----- Check the path length
|
||||||
if (strlen($p_header['stored_filename']) > 0xFF) {
|
if (strlen($p_header['stored_filename']) > 0xFF) {
|
||||||
$p_header['status'] = 'filename_too_long';
|
$p_header['status'] = 'filename_too_long';
|
||||||
@ -2630,13 +2630,13 @@
|
|||||||
$p_header['compressed_size'] = strlen($v_content_compressed);
|
$p_header['compressed_size'] = strlen($v_content_compressed);
|
||||||
$p_header['compression'] = 8;
|
$p_header['compression'] = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for encryption
|
// ----- Look for encryption
|
||||||
/*
|
/*
|
||||||
if ((isset($p_options[PCLZIP_OPT_CRYPT]))
|
if ((isset($p_options[PCLZIP_OPT_CRYPT]))
|
||||||
&& ($p_options[PCLZIP_OPT_CRYPT] != "")) {
|
&& ($p_options[PCLZIP_OPT_CRYPT] != "")) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ....");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ....");
|
||||||
|
|
||||||
// Should be a random header
|
// Should be a random header
|
||||||
$v_header = 'xxxxxxxxxxxx';
|
$v_header = 'xxxxxxxxxxxx';
|
||||||
$v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed,
|
$v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed,
|
||||||
@ -2644,10 +2644,10 @@
|
|||||||
$v_header,
|
$v_header,
|
||||||
$p_header['crc'],
|
$p_header['crc'],
|
||||||
"test");
|
"test");
|
||||||
|
|
||||||
$p_header['compressed_size'] += 12;
|
$p_header['compressed_size'] += 12;
|
||||||
$p_header['flag'] = 1;
|
$p_header['flag'] = 1;
|
||||||
|
|
||||||
// ----- Add the header to the data
|
// ----- Add the header to the data
|
||||||
$v_content_compressed = $v_header.$v_content_compressed;
|
$v_content_compressed = $v_header.$v_content_compressed;
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed)."");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed)."");
|
||||||
@ -2662,9 +2662,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----- Write the compressed (or not) content
|
// ----- Write the compressed (or not) content
|
||||||
@fwrite($this->zip_fd,
|
@fwrite($this->zip_fd,
|
||||||
$v_content_compressed, $p_header['compressed_size']);
|
$v_content_compressed, $p_header['compressed_size']);
|
||||||
|
|
||||||
// ----- Close the file
|
// ----- Close the file
|
||||||
@fclose($v_file);
|
@fclose($v_file);
|
||||||
}
|
}
|
||||||
@ -2730,7 +2730,7 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- Working variables
|
// ----- Working variables
|
||||||
$p_filename = $p_filedescr['filename'];
|
$p_filename = $p_filedescr['filename'];
|
||||||
if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
|
if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
|
||||||
@ -2757,7 +2757,7 @@
|
|||||||
$v_stored_filename = $p_filedescr['new_full_name'];
|
$v_stored_filename = $p_filedescr['new_full_name'];
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for path and/or short name change
|
// ----- Look for path and/or short name change
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@ -2788,7 +2788,7 @@
|
|||||||
|
|
||||||
if ( (substr($p_filename, 0, 2) == "./")
|
if ( (substr($p_filename, 0, 2) == "./")
|
||||||
|| (substr($p_remove_dir, 0, 2) == "./")) {
|
|| (substr($p_remove_dir, 0, 2) == "./")) {
|
||||||
|
|
||||||
if ( (substr($p_filename, 0, 2) == "./")
|
if ( (substr($p_filename, 0, 2) == "./")
|
||||||
&& (substr($p_remove_dir, 0, 2) != "./")) {
|
&& (substr($p_remove_dir, 0, 2) != "./")) {
|
||||||
$p_remove_dir = "./".$p_remove_dir;
|
$p_remove_dir = "./".$p_remove_dir;
|
||||||
@ -2828,7 +2828,7 @@
|
|||||||
$v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
|
$v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
|
||||||
$p_filedescr['stored_filename'] = $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']));
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename']));
|
||||||
|
|
||||||
// ----- Return
|
// ----- Return
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
@ -2991,7 +2991,7 @@
|
|||||||
{
|
{
|
||||||
// ----- Magic quotes trick
|
// ----- Magic quotes trick
|
||||||
$this->privSwapBackMagicQuotes();
|
$this->privSwapBackMagicQuotes();
|
||||||
|
|
||||||
// ----- Error log
|
// ----- Error log
|
||||||
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
|
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
|
||||||
|
|
||||||
@ -3270,7 +3270,7 @@
|
|||||||
else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
|
else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
|
||||||
&& ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
|
&& ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
|
||||||
|
|
||||||
// ----- Look if the index is in the list
|
// ----- Look if the index is in the list
|
||||||
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
|
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']."]");
|
//--(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']."]");
|
||||||
@ -3310,7 +3310,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
|
||||||
|
|
||||||
$this->privSwapBackMagicQuotes();
|
$this->privSwapBackMagicQuotes();
|
||||||
|
|
||||||
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
|
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
|
||||||
"Filename '".$v_header['stored_filename']."' is "
|
"Filename '".$v_header['stored_filename']."' is "
|
||||||
."compressed by an unsupported compression "
|
."compressed by an unsupported compression "
|
||||||
@ -3320,7 +3320,7 @@
|
|||||||
return PclZip::errorCode();
|
return PclZip::errorCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Check encrypted files
|
// ----- Check encrypted files
|
||||||
if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
|
if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
|
||||||
@ -3357,7 +3357,7 @@
|
|||||||
|
|
||||||
$v_extract = false;
|
$v_extract = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for real extraction
|
// ----- Look for real extraction
|
||||||
if ($v_extract)
|
if ($v_extract)
|
||||||
{
|
{
|
||||||
@ -3411,7 +3411,7 @@
|
|||||||
|
|
||||||
// ----- Next extracted file
|
// ----- Next extracted file
|
||||||
$v_nb_extracted++;
|
$v_nb_extracted++;
|
||||||
|
|
||||||
// ----- Look for user callback abort
|
// ----- Look for user callback abort
|
||||||
if ($v_result1 == 2) {
|
if ($v_result1 == 2) {
|
||||||
break;
|
break;
|
||||||
@ -3563,13 +3563,13 @@
|
|||||||
if ($p_path != '') {
|
if ($p_path != '') {
|
||||||
$p_entry['filename'] = $p_path."/".$p_entry['filename'];
|
$p_entry['filename'] = $p_path."/".$p_entry['filename'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Check a base_dir_restriction
|
// ----- Check a base_dir_restriction
|
||||||
if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
|
if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction");
|
||||||
$v_inclusion
|
$v_inclusion
|
||||||
= PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
|
= PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
|
||||||
$p_entry['filename']);
|
$p_entry['filename']);
|
||||||
if ($v_inclusion == 0) {
|
if ($v_inclusion == 0) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction");
|
||||||
|
|
||||||
@ -3599,7 +3599,7 @@
|
|||||||
$p_entry['status'] = "skipped";
|
$p_entry['status'] = "skipped";
|
||||||
$v_result = 1;
|
$v_result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for abort result
|
// ----- Look for abort result
|
||||||
if ($v_result == 2) {
|
if ($v_result == 2) {
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
|
||||||
@ -3631,7 +3631,7 @@
|
|||||||
|
|
||||||
// ----- Change the file status
|
// ----- Change the file status
|
||||||
$p_entry['status'] = "already_a_directory";
|
$p_entry['status'] = "already_a_directory";
|
||||||
|
|
||||||
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
|
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
|
||||||
// For historical reason first PclZip implementation does not stop
|
// For historical reason first PclZip implementation does not stop
|
||||||
// when this kind of error occurs.
|
// when this kind of error occurs.
|
||||||
@ -3764,7 +3764,7 @@
|
|||||||
$v_binary_data = pack('a'.$v_read_size, $v_buffer);
|
$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_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;
|
$v_size -= $v_read_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3773,7 +3773,7 @@
|
|||||||
|
|
||||||
// ----- Change the file mtime
|
// ----- Change the file mtime
|
||||||
touch($p_entry['filename'], $p_entry['mtime']);
|
touch($p_entry['filename'], $p_entry['mtime']);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -3786,11 +3786,11 @@
|
|||||||
// ----- Read the encryption header
|
// ----- Read the encryption header
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes");
|
||||||
$v_encryption_header = @fread($this->zip_fd, 12);
|
$v_encryption_header = @fread($this->zip_fd, 12);
|
||||||
|
|
||||||
// ----- Read the encrypted & compressed file in a buffer
|
// ----- Read the encrypted & compressed file in a buffer
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes");
|
||||||
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12);
|
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12);
|
||||||
|
|
||||||
// ----- Decrypt the buffer
|
// ----- Decrypt the buffer
|
||||||
$this->privDecrypt($v_encryption_header, $v_buffer,
|
$this->privDecrypt($v_encryption_header, $v_buffer,
|
||||||
$p_entry['compressed_size']-12, $p_entry['crc']);
|
$p_entry['compressed_size']-12, $p_entry['crc']);
|
||||||
@ -3802,7 +3802,7 @@
|
|||||||
// ----- Read the compressed file in a buffer (one shot)
|
// ----- Read the compressed file in a buffer (one shot)
|
||||||
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Decompress the file
|
// ----- Decompress the file
|
||||||
$v_file_content = @gzinflate($v_buffer);
|
$v_file_content = @gzinflate($v_buffer);
|
||||||
unset($v_buffer);
|
unset($v_buffer);
|
||||||
@ -3812,11 +3812,11 @@
|
|||||||
// ----- Change the file status
|
// ----- Change the file status
|
||||||
// TBC
|
// TBC
|
||||||
$p_entry['status'] = "error";
|
$p_entry['status'] = "error";
|
||||||
|
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Opening destination file
|
// ----- Opening destination file
|
||||||
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
|
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");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
|
||||||
@ -3855,7 +3855,7 @@
|
|||||||
if ($p_entry['status'] == "aborted") {
|
if ($p_entry['status'] == "aborted") {
|
||||||
$p_entry['status'] = "skipped";
|
$p_entry['status'] = "skipped";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for post-extract callback
|
// ----- Look for post-extract callback
|
||||||
elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
|
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");
|
//--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
|
||||||
@ -3964,7 +3964,7 @@
|
|||||||
|
|
||||||
// ----- Read the compressed file in a buffer (one shot)
|
// ----- Read the compressed file in a buffer (one shot)
|
||||||
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||||
|
|
||||||
// ----- Decompress the file
|
// ----- Decompress the file
|
||||||
$v_file_content = gzinflate($v_buffer);
|
$v_file_content = gzinflate($v_buffer);
|
||||||
unset($v_buffer);
|
unset($v_buffer);
|
||||||
@ -4053,7 +4053,7 @@
|
|||||||
|
|
||||||
// ----- Reading the file
|
// ----- Reading the file
|
||||||
$v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
|
$v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||||
|
|
||||||
// ----- Decompress the file
|
// ----- Decompress the file
|
||||||
if (($p_string = @gzinflate($v_data)) === FALSE) {
|
if (($p_string = @gzinflate($v_data)) === FALSE) {
|
||||||
// TBC
|
// TBC
|
||||||
@ -4803,7 +4803,7 @@
|
|||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Check that local file header is same as central file header
|
// ----- Check that local file header is same as central file header
|
||||||
if ($this->privCheckFileHeaders($v_local_header,
|
if ($this->privCheckFileHeaders($v_local_header,
|
||||||
$v_header_list[$i]) != 1) {
|
$v_header_list[$i]) != 1) {
|
||||||
@ -4896,11 +4896,11 @@
|
|||||||
// TBC : I should test the result ...
|
// TBC : I should test the result ...
|
||||||
//@rename($v_zip_temp_name, $this->zipname);
|
//@rename($v_zip_temp_name, $this->zipname);
|
||||||
PclZipUtilRename($v_zip_temp_name, $this->zipname);
|
PclZipUtilRename($v_zip_temp_name, $this->zipname);
|
||||||
|
|
||||||
// ----- Destroy the temporary archive
|
// ----- Destroy the temporary archive
|
||||||
unset($v_temp_zip);
|
unset($v_temp_zip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Remove every files : reset the file
|
// ----- Remove every files : reset the file
|
||||||
else if ($v_central_dir['entries'] != 0) {
|
else if ($v_central_dir['entries'] != 0) {
|
||||||
$this->privCloseFd();
|
$this->privCloseFd();
|
||||||
@ -5315,13 +5315,13 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size."");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size."");
|
||||||
$v_result=1;
|
$v_result=1;
|
||||||
|
|
||||||
// ----- To Be Modified ;-)
|
// ----- To Be Modified ;-)
|
||||||
$v_pwd = "test";
|
$v_pwd = "test";
|
||||||
|
|
||||||
$p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header,
|
$p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header,
|
||||||
$p_crc, $v_pwd);
|
$p_crc, $v_pwd);
|
||||||
|
|
||||||
// ----- Return
|
// ----- Return
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
return $v_result;
|
return $v_result;
|
||||||
@ -5471,7 +5471,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- Look for skip
|
// ----- Look for skip
|
||||||
if ($v_skip > 0) {
|
if ($v_skip > 0) {
|
||||||
while ($v_skip > 0) {
|
while ($v_skip > 0) {
|
||||||
@ -5506,7 +5506,7 @@
|
|||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
|
||||||
$v_result = 1;
|
$v_result = 1;
|
||||||
|
|
||||||
// ----- Look for path beginning by ./
|
// ----- Look for path beginning by ./
|
||||||
if ( ($p_dir == '.')
|
if ( ($p_dir == '.')
|
||||||
|| ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
|
|| ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
|
||||||
@ -5697,7 +5697,7 @@
|
|||||||
function PclZipUtilOptionText($p_option)
|
function PclZipUtilOptionText($p_option)
|
||||||
{
|
{
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");
|
//--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");
|
||||||
|
|
||||||
$v_list = get_defined_constants();
|
$v_list = get_defined_constants();
|
||||||
for (reset($v_list); $v_key = key($v_list); next($v_list)) {
|
for (reset($v_list); $v_key = key($v_list); next($v_list)) {
|
||||||
$v_prefix = substr($v_key, 0, 10);
|
$v_prefix = substr($v_key, 0, 10);
|
||||||
@ -5709,7 +5709,7 @@
|
|||||||
return $v_key;
|
return $v_key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$v_result = 'Unknown';
|
$v_result = 'Unknown';
|
||||||
|
|
||||||
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
//--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
|
||||||
|
@ -87,7 +87,7 @@ class WP_Filesystem_Direct{
|
|||||||
return false;
|
return false;
|
||||||
if( !function_exists('posix_getpwuid') )
|
if( !function_exists('posix_getpwuid') )
|
||||||
return $owneruid;
|
return $owneruid;
|
||||||
$ownerarray=posix_getpwuid($owneruid);
|
$ownerarray=posix_getpwuid($owneruid);
|
||||||
return $ownerarray['name'];
|
return $ownerarray['name'];
|
||||||
}
|
}
|
||||||
function getchmod($file){
|
function getchmod($file){
|
||||||
@ -121,21 +121,21 @@ class WP_Filesystem_Direct{
|
|||||||
// Unknown
|
// Unknown
|
||||||
$info = 'u';
|
$info = 'u';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Owner
|
// Owner
|
||||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0040) ?
|
$info .= (($perms & 0x0040) ?
|
||||||
(($perms & 0x0800) ? 's' : 'x' ) :
|
(($perms & 0x0800) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0800) ? 'S' : '-'));
|
(($perms & 0x0800) ? 'S' : '-'));
|
||||||
|
|
||||||
// Group
|
// Group
|
||||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0008) ?
|
$info .= (($perms & 0x0008) ?
|
||||||
(($perms & 0x0400) ? 's' : 'x' ) :
|
(($perms & 0x0400) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0400) ? 'S' : '-'));
|
(($perms & 0x0400) ? 'S' : '-'));
|
||||||
|
|
||||||
// World
|
// World
|
||||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||||
@ -168,10 +168,10 @@ class WP_Filesystem_Direct{
|
|||||||
return false;
|
return false;
|
||||||
if( !function_exists('posix_getgrgid') )
|
if( !function_exists('posix_getgrgid') )
|
||||||
return $gid;
|
return $gid;
|
||||||
$grouparray=posix_getgrgid($gid);
|
$grouparray=posix_getgrgid($gid);
|
||||||
return $grouparray['name'];
|
return $grouparray['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function copy($source,$destination,$overwrite=false){
|
function copy($source,$destination,$overwrite=false){
|
||||||
if( $overwrite && $this->exists($destination) )
|
if( $overwrite && $this->exists($destination) )
|
||||||
return false;
|
return false;
|
||||||
@ -210,7 +210,7 @@ class WP_Filesystem_Direct{
|
|||||||
return false;
|
return false;
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
function exists($file){
|
function exists($file){
|
||||||
return @file_exists($file);
|
return @file_exists($file);
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ class WP_Filesystem_Direct{
|
|||||||
function is_writable($file){
|
function is_writable($file){
|
||||||
return @is_writable($file);
|
return @is_writable($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
function atime($file){
|
function atime($file){
|
||||||
return @fileatime($file);
|
return @fileatime($file);
|
||||||
}
|
}
|
||||||
@ -249,11 +249,11 @@ class WP_Filesystem_Direct{
|
|||||||
$atime = time();
|
$atime = time();
|
||||||
return @touch($file,$time,$atime);
|
return @touch($file,$time,$atime);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
|
function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
|
||||||
if( ! $chmod)
|
if( ! $chmod)
|
||||||
$chmod = $this->permission;
|
$chmod = $this->permission;
|
||||||
|
|
||||||
if( !@mkdir($path,$chmod) )
|
if( !@mkdir($path,$chmod) )
|
||||||
return false;
|
return false;
|
||||||
if( $chown )
|
if( $chown )
|
||||||
@ -275,7 +275,7 @@ class WP_Filesystem_Direct{
|
|||||||
}
|
}
|
||||||
return @rmdir($path);
|
return @rmdir($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dirlist($path,$incdot=false,$recursive=false){
|
function dirlist($path,$incdot=false,$recursive=false){
|
||||||
if( $this->is_file($path) ){
|
if( $this->is_file($path) ){
|
||||||
$limitFile = basename($path);
|
$limitFile = basename($path);
|
||||||
@ -291,12 +291,12 @@ class WP_Filesystem_Direct{
|
|||||||
while (false !== ($entry = $dir->read())) {
|
while (false !== ($entry = $dir->read())) {
|
||||||
$struc = array();
|
$struc = array();
|
||||||
$struc['name'] = $entry;
|
$struc['name'] = $entry;
|
||||||
|
|
||||||
if( '.' == $struc['name'][0] && !$incdot)
|
if( '.' == $struc['name'][0] && !$incdot)
|
||||||
continue;
|
continue;
|
||||||
if( $limitFile && $struc['name'] != $limitFile)
|
if( $limitFile && $struc['name'] != $limitFile)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
||||||
$struc['permsn'] = $this->getnumchmodfromh($struc['perms']);
|
$struc['permsn'] = $this->getnumchmodfromh($struc['perms']);
|
||||||
$struc['number'] = false;
|
$struc['number'] = false;
|
||||||
@ -309,7 +309,7 @@ class WP_Filesystem_Direct{
|
|||||||
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
|
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
|
||||||
if ('d' == $struc['type'] ){
|
if ('d' == $struc['type'] ){
|
||||||
$struc['files'] = array();
|
$struc['files'] = array();
|
||||||
|
|
||||||
if( $incdot ){
|
if( $incdot ){
|
||||||
//We're including the doted starts
|
//We're including the doted starts
|
||||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||||
|
@ -4,10 +4,10 @@ class WP_Filesystem_FTPext{
|
|||||||
var $timeout = 5;
|
var $timeout = 5;
|
||||||
var $errors = array();
|
var $errors = array();
|
||||||
var $options = array();
|
var $options = array();
|
||||||
|
|
||||||
var $wp_base = '';
|
var $wp_base = '';
|
||||||
var $permission = null;
|
var $permission = null;
|
||||||
|
|
||||||
var $filetypes = array(
|
var $filetypes = array(
|
||||||
'php'=>FTP_ASCII,
|
'php'=>FTP_ASCII,
|
||||||
'css'=>FTP_ASCII,
|
'css'=>FTP_ASCII,
|
||||||
@ -16,13 +16,13 @@ class WP_Filesystem_FTPext{
|
|||||||
'html'=>FTP_ASCII,
|
'html'=>FTP_ASCII,
|
||||||
'htm'=>FTP_ASCII,
|
'htm'=>FTP_ASCII,
|
||||||
'xml'=>FTP_ASCII,
|
'xml'=>FTP_ASCII,
|
||||||
|
|
||||||
'jpg'=>FTP_BINARY,
|
'jpg'=>FTP_BINARY,
|
||||||
'png'=>FTP_BINARY,
|
'png'=>FTP_BINARY,
|
||||||
'gif'=>FTP_BINARY,
|
'gif'=>FTP_BINARY,
|
||||||
'bmp'=>FTP_BINARY
|
'bmp'=>FTP_BINARY
|
||||||
);
|
);
|
||||||
|
|
||||||
function WP_Filesystem_FTPext($opt='') {
|
function WP_Filesystem_FTPext($opt='') {
|
||||||
$this->errors = new WP_Error();
|
$this->errors = new WP_Error();
|
||||||
|
|
||||||
@ -53,10 +53,10 @@ class WP_Filesystem_FTPext{
|
|||||||
$this->options['username'] = $opt['username'];
|
$this->options['username'] = $opt['username'];
|
||||||
|
|
||||||
if ( empty ($opt['password']) )
|
if ( empty ($opt['password']) )
|
||||||
$this->errors->add('empty_password', __('FTP password is required'));
|
$this->errors->add('empty_password', __('FTP password is required'));
|
||||||
else
|
else
|
||||||
$this->options['password'] = $opt['password'];
|
$this->options['password'] = $opt['password'];
|
||||||
|
|
||||||
$this->options['ssl'] = ( !empty($opt['ssl']) );
|
$this->options['ssl'] = ( !empty($opt['ssl']) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ class WP_Filesystem_FTPext{
|
|||||||
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
|
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
|
||||||
if( empty( $base ) ) $base = '/';
|
if( empty( $base ) ) $base = '/';
|
||||||
if( '/' != substr($base, -1) ) $base .= '/';
|
if( '/' != substr($base, -1) ) $base .= '/';
|
||||||
|
|
||||||
if($echo) echo sprintf(__('Changing to %s'), $base) .'<br>';
|
if($echo) echo sprintf(__('Changing to %s'), $base) .'<br>';
|
||||||
if( false === ftp_chdir($this->link, $base) )
|
if( false === ftp_chdir($this->link, $base) )
|
||||||
return false;
|
return false;
|
||||||
@ -219,21 +219,21 @@ class WP_Filesystem_FTPext{
|
|||||||
// Unknown
|
// Unknown
|
||||||
$info = 'u';
|
$info = 'u';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Owner
|
// Owner
|
||||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0040) ?
|
$info .= (($perms & 0x0040) ?
|
||||||
(($perms & 0x0800) ? 's' : 'x' ) :
|
(($perms & 0x0800) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0800) ? 'S' : '-'));
|
(($perms & 0x0800) ? 'S' : '-'));
|
||||||
|
|
||||||
// Group
|
// Group
|
||||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0008) ?
|
$info .= (($perms & 0x0008) ?
|
||||||
(($perms & 0x0400) ? 's' : 'x' ) :
|
(($perms & 0x0400) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0400) ? 'S' : '-'));
|
(($perms & 0x0400) ? 'S' : '-'));
|
||||||
|
|
||||||
// World
|
// World
|
||||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||||
@ -338,11 +338,11 @@ class WP_Filesystem_FTPext{
|
|||||||
function rmdir($path,$recursive=false){
|
function rmdir($path,$recursive=false){
|
||||||
if( ! $recursive )
|
if( ! $recursive )
|
||||||
return ftp_rmdir($this->link, $file);
|
return ftp_rmdir($this->link, $file);
|
||||||
|
|
||||||
//TODO: Recursive Directory delete, Have to delete files from the folder first.
|
//TODO: Recursive Directory delete, Have to delete files from the folder first.
|
||||||
//$dir = $this->dirlist($path);
|
//$dir = $this->dirlist($path);
|
||||||
//foreach($dir as $file)
|
//foreach($dir as $file)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function parselisting($line) {
|
function parselisting($line) {
|
||||||
@ -439,7 +439,7 @@ class WP_Filesystem_FTPext{
|
|||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ( $dirlist as $struc ) {
|
foreach ( $dirlist as $struc ) {
|
||||||
|
|
||||||
if ( 'd' == $struc['type'] ) {
|
if ( 'd' == $struc['type'] ) {
|
||||||
$struc['files'] = array();
|
$struc['files'] = array();
|
||||||
|
|
||||||
|
@ -4,10 +4,10 @@ class WP_Filesystem_ftpsockets{
|
|||||||
var $timeout = 5;
|
var $timeout = 5;
|
||||||
var $errors;
|
var $errors;
|
||||||
var $options = array();
|
var $options = array();
|
||||||
|
|
||||||
var $wp_base = '';
|
var $wp_base = '';
|
||||||
var $permission = null;
|
var $permission = null;
|
||||||
|
|
||||||
var $filetypes = array(
|
var $filetypes = array(
|
||||||
'php'=>FTP_ASCII,
|
'php'=>FTP_ASCII,
|
||||||
'css'=>FTP_ASCII,
|
'css'=>FTP_ASCII,
|
||||||
@ -16,13 +16,13 @@ class WP_Filesystem_ftpsockets{
|
|||||||
'html'=>FTP_ASCII,
|
'html'=>FTP_ASCII,
|
||||||
'htm'=>FTP_ASCII,
|
'htm'=>FTP_ASCII,
|
||||||
'xml'=>FTP_ASCII,
|
'xml'=>FTP_ASCII,
|
||||||
|
|
||||||
'jpg'=>FTP_BINARY,
|
'jpg'=>FTP_BINARY,
|
||||||
'png'=>FTP_BINARY,
|
'png'=>FTP_BINARY,
|
||||||
'gif'=>FTP_BINARY,
|
'gif'=>FTP_BINARY,
|
||||||
'bmp'=>FTP_BINARY
|
'bmp'=>FTP_BINARY
|
||||||
);
|
);
|
||||||
|
|
||||||
function WP_Filesystem_ftpsockets($opt='') {
|
function WP_Filesystem_ftpsockets($opt='') {
|
||||||
$this->errors = new WP_Error();
|
$this->errors = new WP_Error();
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ class WP_Filesystem_ftpsockets{
|
|||||||
$this->options['username'] = $opt['username'];
|
$this->options['username'] = $opt['username'];
|
||||||
|
|
||||||
if ( empty ($opt['password']) )
|
if ( empty ($opt['password']) )
|
||||||
$this->errors->add('empty_password', __('FTP password is required'));
|
$this->errors->add('empty_password', __('FTP password is required'));
|
||||||
else
|
else
|
||||||
$this->options['password'] = $opt['password'];
|
$this->options['password'] = $opt['password'];
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ class WP_Filesystem_ftpsockets{
|
|||||||
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
|
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
|
||||||
if( empty( $base ) ) $base = '/';
|
if( empty( $base ) ) $base = '/';
|
||||||
if( '/' != substr($base, -1) ) $base .= '/';
|
if( '/' != substr($base, -1) ) $base .= '/';
|
||||||
|
|
||||||
if($echo) echo __('Changing to ') . $base .'<br>';
|
if($echo) echo __('Changing to ') . $base .'<br>';
|
||||||
if( false === $this->ftp->chdir($base) )
|
if( false === $this->ftp->chdir($base) )
|
||||||
return false;
|
return false;
|
||||||
@ -157,7 +157,7 @@ class WP_Filesystem_ftpsockets{
|
|||||||
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
||||||
}
|
}
|
||||||
$this->ftp->SetType($type);
|
$this->ftp->SetType($type);
|
||||||
|
|
||||||
$temp = tmpfile();
|
$temp = tmpfile();
|
||||||
fwrite($temp,$contents);
|
fwrite($temp,$contents);
|
||||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||||
@ -173,7 +173,7 @@ class WP_Filesystem_ftpsockets{
|
|||||||
function chgrp($file,$group,$recursive=false){
|
function chgrp($file,$group,$recursive=false){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function chmod($file,$mode=false,$recursive=false){
|
function chmod($file,$mode=false,$recursive=false){
|
||||||
if( ! $mode )
|
if( ! $mode )
|
||||||
$mode = $this->permission;
|
$mode = $this->permission;
|
||||||
@ -191,16 +191,16 @@ class WP_Filesystem_ftpsockets{
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function chown($file,$owner,$recursive=false){
|
function chown($file,$owner,$recursive=false){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function owner($file){
|
function owner($file){
|
||||||
$dir = $this->dirlist($file);
|
$dir = $this->dirlist($file);
|
||||||
return $dir[$file]['owner'];
|
return $dir[$file]['owner'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getchmod($file){
|
function getchmod($file){
|
||||||
$dir = $this->dirlist($file);
|
$dir = $this->dirlist($file);
|
||||||
return $dir[$file]['permsn'];
|
return $dir[$file]['permsn'];
|
||||||
@ -234,21 +234,21 @@ class WP_Filesystem_ftpsockets{
|
|||||||
// Unknown
|
// Unknown
|
||||||
$info = 'u';
|
$info = 'u';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Owner
|
// Owner
|
||||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0040) ?
|
$info .= (($perms & 0x0040) ?
|
||||||
(($perms & 0x0800) ? 's' : 'x' ) :
|
(($perms & 0x0800) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0800) ? 'S' : '-'));
|
(($perms & 0x0800) ? 'S' : '-'));
|
||||||
|
|
||||||
// Group
|
// Group
|
||||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||||
$info .= (($perms & 0x0008) ?
|
$info .= (($perms & 0x0008) ?
|
||||||
(($perms & 0x0400) ? 's' : 'x' ) :
|
(($perms & 0x0400) ? 's' : 'x' ) :
|
||||||
(($perms & 0x0400) ? 'S' : '-'));
|
(($perms & 0x0400) ? 'S' : '-'));
|
||||||
|
|
||||||
// World
|
// World
|
||||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||||
@ -385,7 +385,7 @@ class WP_Filesystem_ftpsockets{
|
|||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ( $list as $struc ) {
|
foreach ( $list as $struc ) {
|
||||||
|
|
||||||
if ( 'd' == $struc['type'] ) {
|
if ( 'd' == $struc['type'] ) {
|
||||||
$struc['files'] = array();
|
$struc['files'] = array();
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ function floated_admin_avatar( $name ) {
|
|||||||
return "$avatar $name";
|
return "$avatar $name";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_admin() && ('edit-comments.php' == $pagenow || 'moderation.php' == $pagenow || 'edit.php' == $pagenow) ) {
|
if ( is_admin() && ('edit-comments.php' == $pagenow || 'moderation.php' == $pagenow || 'edit.php' == $pagenow) ) {
|
||||||
if ( get_option('show_avatars') )
|
if ( get_option('show_avatars') )
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ function wp_dashboard_setup() {
|
|||||||
$wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback),
|
$wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback),
|
||||||
$arg, $arg, $arg... (further args passed to callbacks)
|
$arg, $arg, $arg... (further args passed to callbacks)
|
||||||
);
|
);
|
||||||
|
|
||||||
// optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control
|
// optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control
|
||||||
wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback,
|
wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback,
|
||||||
array(), // leave an empty array here: oddity in widget code
|
array(), // leave an empty array here: oddity in widget code
|
||||||
@ -316,17 +316,17 @@ function wp_dashboard_incoming_links_output() {
|
|||||||
$content = '';
|
$content = '';
|
||||||
$date = '';
|
$date = '';
|
||||||
$link = clean_url( strip_tags( $item['link'] ) );
|
$link = clean_url( strip_tags( $item['link'] ) );
|
||||||
|
|
||||||
if ( isset( $item['author_uri'] ) )
|
if ( isset( $item['author_uri'] ) )
|
||||||
$site_link = clean_url( strip_tags( $item['author_uri'] ) );
|
$site_link = clean_url( strip_tags( $item['author_uri'] ) );
|
||||||
|
|
||||||
if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) )
|
if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) )
|
||||||
$publisher = __( 'Somebody' );
|
$publisher = __( 'Somebody' );
|
||||||
if ( $site_link )
|
if ( $site_link )
|
||||||
$publisher = "<a href='$site_link'>$publisher</a>";
|
$publisher = "<a href='$site_link'>$publisher</a>";
|
||||||
else
|
else
|
||||||
$publisher = "<strong>$publisher</strong>";
|
$publisher = "<strong>$publisher</strong>";
|
||||||
|
|
||||||
if ( isset($item['description']) )
|
if ( isset($item['description']) )
|
||||||
$content = $item['description'];
|
$content = $item['description'];
|
||||||
elseif ( isset($item['summary']) )
|
elseif ( isset($item['summary']) )
|
||||||
@ -343,7 +343,7 @@ function wp_dashboard_incoming_links_output() {
|
|||||||
$text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' );
|
$text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' );
|
||||||
else
|
else
|
||||||
$text = _c( '%1$s linked here saying, "%3$s"|feed_display' );
|
$text = _c( '%1$s linked here saying, "%3$s"|feed_display' );
|
||||||
|
|
||||||
if ( $show_date ) {
|
if ( $show_date ) {
|
||||||
if ( $show_author || $show_summary )
|
if ( $show_author || $show_summary )
|
||||||
$text .= _c( ' on %4$s|feed_display' );
|
$text .= _c( ' on %4$s|feed_display' );
|
||||||
@ -351,7 +351,7 @@ function wp_dashboard_incoming_links_output() {
|
|||||||
$date = strtotime( $date );
|
$date = strtotime( $date );
|
||||||
$date = gmdate( get_option( 'date_format' ), $date );
|
$date = gmdate( get_option( 'date_format' ), $date );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "\t<li>" . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "</li>\n";
|
echo "\t<li>" . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ function download_url( $url ) {
|
|||||||
require_once( ABSPATH . 'wp-includes/class-snoopy.php' );
|
require_once( ABSPATH . 'wp-includes/class-snoopy.php' );
|
||||||
$snoopy = new Snoopy();
|
$snoopy = new Snoopy();
|
||||||
$snoopy->fetch($url);
|
$snoopy->fetch($url);
|
||||||
|
|
||||||
fwrite($handle, $snoopy->results);
|
fwrite($handle, $snoopy->results);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ function unzip_file($file, $to) {
|
|||||||
|
|
||||||
if ( ! $wp_filesystem || !is_object($wp_filesystem) )
|
if ( ! $wp_filesystem || !is_object($wp_filesystem) )
|
||||||
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
|
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
|
||||||
|
|
||||||
$fs =& $wp_filesystem;
|
$fs =& $wp_filesystem;
|
||||||
|
|
||||||
require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
|
require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
|
||||||
|
@ -126,7 +126,7 @@ function wp_iframe($content_func /* ... */) {
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||||
<title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — WordPress</title>
|
<title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — WordPress</title>
|
||||||
<?php
|
<?php
|
||||||
wp_admin_css( 'css/global' );
|
wp_admin_css( 'css/global' );
|
||||||
wp_admin_css();
|
wp_admin_css();
|
||||||
?>
|
?>
|
||||||
@ -386,7 +386,7 @@ function media_upload_file() {
|
|||||||
function media_upload_gallery() {
|
function media_upload_gallery() {
|
||||||
if ( !empty($_POST) ) {
|
if ( !empty($_POST) ) {
|
||||||
$return = media_upload_form_handler();
|
$return = media_upload_form_handler();
|
||||||
|
|
||||||
if ( is_string($return) )
|
if ( is_string($return) )
|
||||||
return $return;
|
return $return;
|
||||||
if ( is_array($return) )
|
if ( is_array($return) )
|
||||||
@ -399,7 +399,7 @@ function media_upload_gallery() {
|
|||||||
function media_upload_library() {
|
function media_upload_library() {
|
||||||
if ( !empty($_POST) ) {
|
if ( !empty($_POST) ) {
|
||||||
$return = media_upload_form_handler();
|
$return = media_upload_form_handler();
|
||||||
|
|
||||||
if ( is_string($return) )
|
if ( is_string($return) )
|
||||||
return $return;
|
return $return;
|
||||||
if ( is_array($return) )
|
if ( is_array($return) )
|
||||||
|
@ -644,7 +644,7 @@ function wp_set_post_lock( $post_id ) {
|
|||||||
return false;
|
return false;
|
||||||
if ( !$current_user || !$current_user->ID )
|
if ( !$current_user || !$current_user->ID )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) )
|
if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) )
|
||||||
|
@ -347,8 +347,8 @@ function display_page_row( $page, &$children_pages, $level = 0 ) {
|
|||||||
$posts_columns = wp_manage_pages_columns();
|
$posts_columns = wp_manage_pages_columns();
|
||||||
?>
|
?>
|
||||||
<tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>
|
<tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach ($posts_columns as $column_name=>$column_display_name) {
|
foreach ($posts_columns as $column_name=>$column_display_name) {
|
||||||
@ -451,7 +451,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -570,7 +570,7 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
|
|||||||
$approved = "comment_approved = 'spam'";
|
$approved = "comment_approved = 'spam'";
|
||||||
else
|
else
|
||||||
$approved = "comment_approved != 'spam'";
|
$approved = "comment_approved != 'spam'";
|
||||||
|
|
||||||
if ( $s ) {
|
if ( $s ) {
|
||||||
$s = $wpdb->escape($s);
|
$s = $wpdb->escape($s);
|
||||||
$comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE
|
$comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE
|
||||||
@ -615,7 +615,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
|
|||||||
$delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
$delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||||
$approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
|
$approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
|
||||||
$spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
$spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
|
<tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
|
||||||
<?php if ( $checkbox ) : ?>
|
<?php if ( $checkbox ) : ?>
|
||||||
|
@ -137,7 +137,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
|||||||
if ( ! is_object($wp_filesystem) )
|
if ( ! is_object($wp_filesystem) )
|
||||||
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
|
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
|
||||||
|
|
||||||
if ( $wp_filesystem->errors->get_error_code() )
|
if ( $wp_filesystem->errors->get_error_code() )
|
||||||
return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
|
return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
|
||||||
|
|
||||||
// Get the URL to the zip file
|
// Get the URL to the zip file
|
||||||
@ -172,7 +172,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
|||||||
|
|
||||||
// Once installed, delete the package
|
// Once installed, delete the package
|
||||||
unlink($file);
|
unlink($file);
|
||||||
|
|
||||||
// Remove the existing plugin.
|
// Remove the existing plugin.
|
||||||
apply_filters('update_feedback', __("Removing the old version of the plugin"));
|
apply_filters('update_feedback', __("Removing the old version of the plugin"));
|
||||||
$plugin_dir = dirname(ABSPATH . PLUGINDIR . "/$plugin");
|
$plugin_dir = dirname(ABSPATH . PLUGINDIR . "/$plugin");
|
||||||
|
@ -327,7 +327,7 @@ class WP_User_Search {
|
|||||||
$search_sql .= implode(' OR ', $searches);
|
$search_sql .= implode(' OR ', $searches);
|
||||||
$search_sql .= ')';
|
$search_sql .= ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->query_from_where = "FROM $wpdb->users";
|
$this->query_from_where = "FROM $wpdb->users";
|
||||||
if ( $this->role )
|
if ( $this->role )
|
||||||
$this->query_from_where .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE '%$this->role%'";
|
$this->query_from_where .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE '%$this->role%'";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
addLoadEvent( function() {
|
addLoadEvent( function() {
|
||||||
// pulse
|
// pulse
|
||||||
jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);
|
jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);
|
||||||
|
|
||||||
// Reveal
|
// Reveal
|
||||||
jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' );
|
jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' );
|
||||||
|
@ -5,17 +5,17 @@ wpEditorInit = function() {
|
|||||||
tinyMCE.execCommand("mceAddControl", true, "content");
|
tinyMCE.execCommand("mceAddControl", true, "content");
|
||||||
} else {
|
} else {
|
||||||
var H;
|
var H;
|
||||||
if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
|
if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
|
||||||
document.getElementById('content').style.height = H.ch - 30 + 'px';
|
document.getElementById('content').style.height = H.ch - 30 + 'px';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switchEditors = {
|
switchEditors = {
|
||||||
|
|
||||||
saveCallback : function(el, content, body) {
|
saveCallback : function(el, content, body) {
|
||||||
|
|
||||||
document.getElementById(el).style.color = '#fff';
|
document.getElementById(el).style.color = '#fff';
|
||||||
if ( tinyMCE.activeEditor.isHidden() )
|
if ( tinyMCE.activeEditor.isHidden() )
|
||||||
content = document.getElementById(el).value;
|
content = document.getElementById(el).value;
|
||||||
else
|
else
|
||||||
content = this.pre_wpautop(content);
|
content = this.pre_wpautop(content);
|
||||||
@ -44,12 +44,12 @@ switchEditors = {
|
|||||||
content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
|
content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
|
||||||
content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
|
content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
|
||||||
content = content.replace(new RegExp('<li>', 'g'), '\t<li>');
|
content = content.replace(new RegExp('<li>', 'g'), '\t<li>');
|
||||||
|
|
||||||
if ( content.indexOf('<object') != -1 ) {
|
if ( content.indexOf('<object') != -1 ) {
|
||||||
content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'g'), "<param$1>"); // no pee inside object/embed
|
content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'g'), "<param$1>"); // no pee inside object/embed
|
||||||
content = content.replace(new RegExp('\\s*</embed>\\s*', 'g'), '</embed>');
|
content = content.replace(new RegExp('\\s*</embed>\\s*', 'g'), '</embed>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmark special paragraph closing tags
|
// Unmark special paragraph closing tags
|
||||||
content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
|
content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
|
||||||
content = content.replace(new RegExp('\\s*(<p[^>]+>.*</p>)', 'mg'), '\n$1');
|
content = content.replace(new RegExp('\\s*(<p[^>]+>.*</p>)', 'mg'), '\n$1');
|
||||||
@ -71,7 +71,7 @@ switchEditors = {
|
|||||||
|
|
||||||
if ( ! ed || ed.isHidden() ) {
|
if ( ! ed || ed.isHidden() ) {
|
||||||
ta.style.color = '#fff';
|
ta.style.color = '#fff';
|
||||||
|
|
||||||
this.edToggle(P, H);
|
this.edToggle(P, H);
|
||||||
edCloseAllTags(); // :-(
|
edCloseAllTags(); // :-(
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ switchEditors = {
|
|||||||
|
|
||||||
if ( ed ) ed.show();
|
if ( ed ) ed.show();
|
||||||
else tinyMCE.execCommand("mceAddControl", false, id);
|
else tinyMCE.execCommand("mceAddControl", false, id);
|
||||||
|
|
||||||
this.wpSetDefaultEditor( 'tinymce' );
|
this.wpSetDefaultEditor( 'tinymce' );
|
||||||
} else {
|
} else {
|
||||||
this.edToggle(H, P);
|
this.edToggle(H, P);
|
||||||
@ -93,7 +93,7 @@ switchEditors = {
|
|||||||
ed.hide();
|
ed.hide();
|
||||||
ta.value = this.pre_wpautop(ta.value);
|
ta.value = this.pre_wpautop(ta.value);
|
||||||
qt.style.display = 'block';
|
qt.style.display = 'block';
|
||||||
|
|
||||||
if ( tinymce.isIE6 ) {
|
if ( tinymce.isIE6 ) {
|
||||||
ta.style.width = '98%';
|
ta.style.width = '98%';
|
||||||
ec.style.padding = '0px';
|
ec.style.padding = '0px';
|
||||||
@ -102,7 +102,7 @@ switchEditors = {
|
|||||||
ta.style.width = '100%';
|
ta.style.width = '100%';
|
||||||
ec.style.padding = '6px';
|
ec.style.padding = '6px';
|
||||||
}
|
}
|
||||||
|
|
||||||
ta.style.color = '';
|
ta.style.color = '';
|
||||||
|
|
||||||
this.wpSetDefaultEditor( 'html' );
|
this.wpSetDefaultEditor( 'html' );
|
||||||
@ -132,10 +132,10 @@ switchEditors = {
|
|||||||
|
|
||||||
wpautop : function(pee) {
|
wpautop : function(pee) {
|
||||||
var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
|
var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
|
||||||
|
|
||||||
pee = pee + "\n\n";
|
pee = pee + "\n\n";
|
||||||
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
|
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
|
||||||
pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
|
pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
|
||||||
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
|
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
|
||||||
pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
|
pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
|
||||||
pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
|
pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
|
||||||
@ -146,7 +146,7 @@ switchEditors = {
|
|||||||
pee = pee.replace(new RegExp('<p><blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
|
pee = pee.replace(new RegExp('<p><blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
|
||||||
pee = pee.replace(new RegExp('</blockquote></p>', 'gi'), '</p></blockquote>');
|
pee = pee.replace(new RegExp('</blockquote></p>', 'gi'), '</p></blockquote>');
|
||||||
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
|
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
|
||||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
|
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
|
||||||
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
|
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
|
||||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
|
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
|
||||||
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
|
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
|
||||||
|
@ -13,8 +13,8 @@ function getNumChecked(form) {
|
|||||||
var num = 0;
|
var num = 0;
|
||||||
for (i = 0, n = form.elements.length; i < n; i++) {
|
for (i = 0, n = form.elements.length; i < n; i++) {
|
||||||
if (form.elements[i].type == "checkbox") {
|
if (form.elements[i].type == "checkbox") {
|
||||||
if (form.elements[i].checked == true)
|
if (form.elements[i].checked == true)
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
@ -22,8 +22,8 @@ function getNumChecked(form) {
|
|||||||
|
|
||||||
function checkAllUsers(role) {
|
function checkAllUsers(role) {
|
||||||
var checkboxs = document.getElementsByTagName('input');
|
var checkboxs = document.getElementsByTagName('input');
|
||||||
for(var i = 0, inp; inp = checkboxs[i]; i++)
|
for(var i = 0, inp; inp = checkboxs[i]; i++)
|
||||||
if(inp.type.toLowerCase() == 'checkbox' && inp.className == role)
|
if(inp.type.toLowerCase() == 'checkbox' && inp.className == role)
|
||||||
if(inp.checked == false)
|
if(inp.checked == false)
|
||||||
inp.checked = true;
|
inp.checked = true;
|
||||||
else
|
else
|
||||||
|
@ -9,4 +9,4 @@ function send_to_editor(h) {
|
|||||||
tinyMCE.execCommand('mceInsertContent', false, h);
|
tinyMCE.execCommand('mceInsertContent', false, h);
|
||||||
} else
|
} else
|
||||||
win.edInsertContent(win.edCanvas, h);
|
win.edInsertContent(win.edCanvas, h);
|
||||||
}
|
}
|
@ -12,14 +12,14 @@ var strongPass = 'Strong'
|
|||||||
|
|
||||||
function passwordStrength(password,username)
|
function passwordStrength(password,username)
|
||||||
{
|
{
|
||||||
score = 0
|
score = 0
|
||||||
|
|
||||||
//password < 4
|
//password < 4
|
||||||
if (password.length < 4 ) { return shortPass }
|
if (password.length < 4 ) { return shortPass }
|
||||||
|
|
||||||
//password == username
|
//password == username
|
||||||
if (password.toLowerCase()==username.toLowerCase()) return badPass
|
if (password.toLowerCase()==username.toLowerCase()) return badPass
|
||||||
|
|
||||||
//password length
|
//password length
|
||||||
score += password.length * 4
|
score += password.length * 4
|
||||||
score += ( checkRepetition(1,password).length - password.length ) * 1
|
score += ( checkRepetition(1,password).length - password.length ) * 1
|
||||||
@ -28,31 +28,31 @@ function passwordStrength(password,username)
|
|||||||
score += ( checkRepetition(4,password).length - password.length ) * 1
|
score += ( checkRepetition(4,password).length - password.length ) * 1
|
||||||
|
|
||||||
//password has 3 numbers
|
//password has 3 numbers
|
||||||
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) score += 5
|
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) score += 5
|
||||||
|
|
||||||
//password has 2 sybols
|
//password has 2 sybols
|
||||||
if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5
|
if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5
|
||||||
|
|
||||||
//password has Upper and Lower chars
|
//password has Upper and Lower chars
|
||||||
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) score += 10
|
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) score += 10
|
||||||
|
|
||||||
//password has number and chars
|
//password has number and chars
|
||||||
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) score += 15
|
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) score += 15
|
||||||
//
|
//
|
||||||
//password has number and symbol
|
//password has number and symbol
|
||||||
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) score += 15
|
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) score += 15
|
||||||
|
|
||||||
//password has char and symbol
|
//password has char and symbol
|
||||||
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) score += 15
|
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) score += 15
|
||||||
|
|
||||||
//password is just a nubers or chars
|
//password is just a nubers or chars
|
||||||
if (password.match(/^\w+$/) || password.match(/^\d+$/) ) score -= 10
|
if (password.match(/^\w+$/) || password.match(/^\d+$/) ) score -= 10
|
||||||
|
|
||||||
//verifing 0 < score < 100
|
//verifing 0 < score < 100
|
||||||
if ( score < 0 ) score = 0
|
if ( score < 0 ) score = 0
|
||||||
if ( score > 100 ) score = 100
|
if ( score > 100 ) score = 100
|
||||||
|
|
||||||
if (score < 34 ) return badPass
|
if (score < 34 ) return badPass
|
||||||
if (score < 68 ) return goodPass
|
if (score < 68 ) return goodPass
|
||||||
return strongPass
|
return strongPass
|
||||||
}
|
}
|
||||||
@ -93,14 +93,14 @@ var strongPass = 'Strong'
|
|||||||
|
|
||||||
function passwordStrength(password,username)
|
function passwordStrength(password,username)
|
||||||
{
|
{
|
||||||
score = 0
|
score = 0
|
||||||
|
|
||||||
//password < 4
|
//password < 4
|
||||||
if (password.length < 4 ) { return shortPass }
|
if (password.length < 4 ) { return shortPass }
|
||||||
|
|
||||||
//password == username
|
//password == username
|
||||||
if (password.toLowerCase()==username.toLowerCase()) return badPass
|
if (password.toLowerCase()==username.toLowerCase()) return badPass
|
||||||
|
|
||||||
//password length
|
//password length
|
||||||
score += password.length * 4
|
score += password.length * 4
|
||||||
score += ( checkRepetition(1,password).length - password.length ) * 1
|
score += ( checkRepetition(1,password).length - password.length ) * 1
|
||||||
@ -109,31 +109,31 @@ function passwordStrength(password,username)
|
|||||||
score += ( checkRepetition(4,password).length - password.length ) * 1
|
score += ( checkRepetition(4,password).length - password.length ) * 1
|
||||||
|
|
||||||
//password has 3 numbers
|
//password has 3 numbers
|
||||||
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) score += 5
|
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) score += 5
|
||||||
|
|
||||||
//password has 2 sybols
|
//password has 2 sybols
|
||||||
if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5
|
if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5
|
||||||
|
|
||||||
//password has Upper and Lower chars
|
//password has Upper and Lower chars
|
||||||
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) score += 10
|
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) score += 10
|
||||||
|
|
||||||
//password has number and chars
|
//password has number and chars
|
||||||
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) score += 15
|
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) score += 15
|
||||||
//
|
//
|
||||||
//password has number and symbol
|
//password has number and symbol
|
||||||
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) score += 15
|
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) score += 15
|
||||||
|
|
||||||
//password has char and symbol
|
//password has char and symbol
|
||||||
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) score += 15
|
if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) score += 15
|
||||||
|
|
||||||
//password is just a nubers or chars
|
//password is just a nubers or chars
|
||||||
if (password.match(/^\w+$/) || password.match(/^\d+$/) ) score -= 10
|
if (password.match(/^\w+$/) || password.match(/^\d+$/) ) score -= 10
|
||||||
|
|
||||||
//verifing 0 < score < 100
|
//verifing 0 < score < 100
|
||||||
if ( score < 0 ) score = 0
|
if ( score < 0 ) score = 0
|
||||||
if ( score > 100 ) score = 100
|
if ( score > 100 ) score = 100
|
||||||
|
|
||||||
if (score < 34 ) return badPass
|
if (score < 34 ) return badPass
|
||||||
if (score < 68 ) return goodPass
|
if (score < 68 ) return goodPass
|
||||||
return strongPass
|
return strongPass
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ function tag_update_quickclicks() {
|
|||||||
// jQuery.merge( current_tags, current_tags ); // this doesn't work anymore, need something to array_unique
|
// jQuery.merge( current_tags, current_tags ); // this doesn't work anymore, need something to array_unique
|
||||||
jQuery.each( current_tags, function( key, val ) {
|
jQuery.each( current_tags, function( key, val ) {
|
||||||
val = val.replace( /^\s+/, '' ).replace( /\s+$/, '' ); // trim
|
val = val.replace( /^\s+/, '' ).replace( /\s+$/, '' ); // trim
|
||||||
if ( !val.match(/^\s+$/) && '' != val ) {
|
if ( !val.match(/^\s+$/) && '' != val ) {
|
||||||
txt = '<span><a id="tag-check-' + key + '" class="ntdelbutton">X</a> ' + val + '</span> ';
|
txt = '<span><a id="tag-check-' + key + '" class="ntdelbutton">X</a> ' + val + '</span> ';
|
||||||
jQuery( '#tagchecklist' ).append( txt );
|
jQuery( '#tagchecklist' ).append( txt );
|
||||||
jQuery( '#tag-check-' + key ).click( new_tag_remove_tag );
|
jQuery( '#tag-check-' + key ).click( new_tag_remove_tag );
|
||||||
@ -63,12 +63,12 @@ addLoadEvent( function() {
|
|||||||
|
|
||||||
// If no tags on the page, skip the tag and category stuff.
|
// If no tags on the page, skip the tag and category stuff.
|
||||||
if ( !jQuery('#tags-input').size() ) {
|
if ( !jQuery('#tags-input').size() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Editable slugs
|
// Editable slugs
|
||||||
make_slugedit_clickable();
|
make_slugedit_clickable();
|
||||||
|
|
||||||
// hide advanced slug field
|
// hide advanced slug field
|
||||||
jQuery('#slugdiv').hide();
|
jQuery('#slugdiv').hide();
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
function edit_permalink(post_id) {
|
function edit_permalink(post_id) {
|
||||||
var i, c = 0;
|
var i, c = 0;
|
||||||
var e = jQuery('#editable-post-name');
|
var e = jQuery('#editable-post-name');
|
||||||
var revert_e = e.html();
|
var revert_e = e.html();
|
||||||
var real_slug = jQuery('#post_name');
|
var real_slug = jQuery('#post_name');
|
||||||
var revert_slug = real_slug.html();
|
var revert_slug = real_slug.html();
|
||||||
var b = jQuery('#edit-slug-buttons');
|
var b = jQuery('#edit-slug-buttons');
|
||||||
@ -18,7 +18,7 @@ function edit_permalink(post_id) {
|
|||||||
samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) {
|
samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) {
|
||||||
jQuery('#edit-slug-box').html(data);
|
jQuery('#edit-slug-box').html(data);
|
||||||
b.html(revert_b);
|
b.html(revert_b);
|
||||||
real_slug.attr('value', new_slug);
|
real_slug.attr('value', new_slug);
|
||||||
make_slugedit_clickable();
|
make_slugedit_clickable();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
@ -5,7 +5,7 @@ addLoadEvent( function() {
|
|||||||
tab: '',
|
tab: '',
|
||||||
postID: 0,
|
postID: 0,
|
||||||
|
|
||||||
// cookie create and read functions adapted from http://www.quirksmode.org/js/cookies.html
|
// cookie create and read functions adapted from http://www.quirksmode.org/js/cookies.html
|
||||||
createCookie: function(name,value,days) {
|
createCookie: function(name,value,days) {
|
||||||
if (days) {
|
if (days) {
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
@ -28,8 +28,8 @@ addLoadEvent( function() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
assignCookieOnChange: function() {
|
assignCookieOnChange: function() {
|
||||||
jQuery(this).bind("change", function(){
|
jQuery(this).bind("change", function(){
|
||||||
theFileList.createCookie(jQuery(this).attr('name'),jQuery(this).attr('id'),365);
|
theFileList.createCookie(jQuery(this).attr('name'),jQuery(this).attr('id'),365);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ addLoadEvent( function() {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for ( var property in uploadL10n )
|
for ( var property in uploadL10n )
|
||||||
theFileList[property] = uploadL10n[property];
|
theFileList[property] = uploadL10n[property];
|
||||||
theFileList.initializeVars();
|
theFileList.initializeVars();
|
||||||
theFileList.initializeLinks();
|
theFileList.initializeLinks();
|
||||||
|
@ -87,7 +87,7 @@ jQuery(function($) {
|
|||||||
var addWidgetControls = function( context ) {
|
var addWidgetControls = function( context ) {
|
||||||
if ( !context )
|
if ( !context )
|
||||||
context = document;
|
context = document;
|
||||||
|
|
||||||
$('a.widget-control-edit', context).click( editClick );
|
$('a.widget-control-edit', context).click( editClick );
|
||||||
|
|
||||||
// onclick for save links
|
// onclick for save links
|
||||||
|
@ -21,7 +21,7 @@ if ( isset($_GET['deleteit']) && isset($_GET['linkcheck']) ) {
|
|||||||
exit;
|
exit;
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_enqueue_script('admin-forms');
|
wp_enqueue_script('admin-forms');
|
||||||
@ -170,7 +170,7 @@ if ( $links ) {
|
|||||||
foreach($link_columns as $column_name=>$column_display_name) {
|
foreach($link_columns as $column_name=>$column_display_name) {
|
||||||
switch($column_name) {
|
switch($column_name) {
|
||||||
case 'name':
|
case 'name':
|
||||||
|
|
||||||
echo "<td><strong><a class='row-title' href='link.php?link_id=$link->link_id&action=edit' class='edit'>$link->link_name</a></strong><br />";
|
echo "<td><strong><a class='row-title' href='link.php?link_id=$link->link_id&action=edit' class='edit'>$link->link_name</a></strong><br />";
|
||||||
echo $link->link_description . "</td>";
|
echo $link->link_description . "</td>";
|
||||||
break;
|
break;
|
||||||
|
@ -57,7 +57,7 @@ include('./admin-header.php');
|
|||||||
<th scope="row"><?php _e('Timezone') ?> </th>
|
<th scope="row"><?php _e('Timezone') ?> </th>
|
||||||
<td>
|
<td>
|
||||||
<select name="gmt_offset">
|
<select name="gmt_offset">
|
||||||
<?php
|
<?php
|
||||||
$current_offset = get_option('gmt_offset');
|
$current_offset = get_option('gmt_offset');
|
||||||
$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
|
$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
|
||||||
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12);
|
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12);
|
||||||
|
@ -13,7 +13,7 @@ if ('b' == $_GET['a']) {
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
|
||||||
<title>WordPress › Posted</title>
|
<title>WordPress › Posted</title>
|
||||||
<?php
|
<?php
|
||||||
wp_admin_css( 'css/global' );
|
wp_admin_css( 'css/global' );
|
||||||
wp_admin_css();
|
wp_admin_css();
|
||||||
?>
|
?>
|
||||||
@ -31,7 +31,7 @@ wp_admin_css();
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
|
||||||
<title>WordPress › Sidebar</title>
|
<title>WordPress › Sidebar</title>
|
||||||
<?php
|
<?php
|
||||||
wp_admin_css( 'css/global' );
|
wp_admin_css( 'css/global' );
|
||||||
wp_admin_css();
|
wp_admin_css();
|
||||||
?>
|
?>
|
||||||
|
@ -83,7 +83,7 @@ default:
|
|||||||
?>
|
?>
|
||||||
<?php if (isset($_GET['a'])) : ?>
|
<?php if (isset($_GET['a'])) : ?>
|
||||||
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
||||||
<?php endif;
|
<?php endif;
|
||||||
|
|
||||||
$description = get_file_description($file);
|
$description = get_file_description($file);
|
||||||
$desc_header = ( $description != $file_show ) ? "$description</strong> (%s)" : "%s";
|
$desc_header = ( $description != $file_show ) ? "$description</strong> (%s)" : "%s";
|
||||||
@ -134,7 +134,7 @@ if ($allowed_files) :
|
|||||||
</ul>
|
</ul>
|
||||||
<h4 style="margin-bottom: 0px;"><?php _e('Styles'); ?></h4>
|
<h4 style="margin-bottom: 0px;"><?php _e('Styles'); ?></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach($themes[$theme]['Stylesheet Files'] as $style_file) :
|
<?php foreach($themes[$theme]['Stylesheet Files'] as $style_file) :
|
||||||
$description = get_file_description($style_file);
|
$description = get_file_description($style_file);
|
||||||
$style_show = basename($style_file);
|
$style_show = basename($style_file);
|
||||||
$filedesc = ( $description != $style_file ) ? "$description <span class='nonessential'>($style_show)</span>" : "$description";
|
$filedesc = ( $description != $style_file ) ? "$description <span class='nonessential'>($style_show)</span>" : "$description";
|
||||||
@ -155,7 +155,7 @@ if ($allowed_files) :
|
|||||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||||
<input type="hidden" name="theme" value="<?php echo $theme ?>" />
|
<input type="hidden" name="theme" value="<?php echo $theme ?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<?php if ( is_writeable($real_file) ) : ?>
|
<?php if ( is_writeable($real_file) ) : ?>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
|
@ -110,7 +110,7 @@ if ( isset($_GET['action']) ) {
|
|||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
do_plugin_upgrade($plugin);
|
do_plugin_upgrade($plugin);
|
||||||
include('admin-footer.php');
|
include('admin-footer.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
if (!current_user_can('upload_files'))
|
if (!current_user_can('upload_files'))
|
||||||
wp_die(__('You do not have permission to upload files.'));
|
wp_die(__('You do not have permission to upload files.'));
|
||||||
|
|
||||||
// Handle bulk deletes
|
// Handle bulk deletes
|
||||||
if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
||||||
@ -26,7 +26,7 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
|
|||||||
exit();
|
exit();
|
||||||
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
} elseif ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = __('Media Library');
|
$title = __('Media Library');
|
||||||
@ -154,12 +154,12 @@ foreach ($arc_result as $arc_row) {
|
|||||||
if ( $arc_row->yyear == 0 )
|
if ( $arc_row->yyear == 0 )
|
||||||
continue;
|
continue;
|
||||||
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
||||||
|
|
||||||
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
|
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
|
||||||
$default = ' selected="selected"';
|
$default = ' selected="selected"';
|
||||||
else
|
else
|
||||||
$default = '';
|
$default = '';
|
||||||
|
|
||||||
echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
|
echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
|
||||||
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
||||||
echo "</option>\n";
|
echo "</option>\n";
|
||||||
|
@ -184,7 +184,7 @@ default:
|
|||||||
|
|
||||||
if ( !empty($_GET['_wp_http_referer']) ) {
|
if ( !empty($_GET['_wp_http_referer']) ) {
|
||||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_enqueue_script('admin-users');
|
wp_enqueue_script('admin-users');
|
||||||
|
@ -170,7 +170,7 @@ form#upload #post_content {
|
|||||||
border: none;
|
border: none;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
-moz-border-radius: 3px;
|
-moz-border-radius: 3px;
|
||||||
-khtml-border-radius: 3px;
|
-khtml-border-radius: 3px;
|
||||||
-webkit-border-radius: 3px;
|
-webkit-border-radius: 3px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: #246;
|
color: #246;
|
||||||
@ -234,8 +234,8 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
background: #f00;
|
background: #f00;
|
||||||
border: 1px solid #800;
|
border: 1px solid #800;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ input.disabled, textarea.disabled {
|
|||||||
#searchform fieldset legend {
|
#searchform fieldset legend {
|
||||||
padding: 0 0 .2em 1px;
|
padding: 0 0 .2em 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchform #s {
|
#searchform #s {
|
||||||
padding: 4px 3px;
|
padding: 4px 3px;
|
||||||
}
|
}
|
||||||
@ -569,7 +569,7 @@ p.pagenav {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #555;
|
color: #555;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#update-nag a, .plugin-update a {
|
#update-nag a, .plugin-update a {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
@ -578,30 +578,30 @@ p.pagenav {
|
|||||||
color: #036;
|
color: #036;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pass-strength-result {
|
#pass-strength-result {
|
||||||
padding: 3px 5px 3px 5px;
|
padding: 3px 5px 3px 5px;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #e3e3e3;
|
background-color: #e3e3e3;
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pass-strength-result.short {
|
#pass-strength-result.short {
|
||||||
background-color: #e3e3e3;
|
background-color: #e3e3e3;
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pass-strength-result.bad {
|
#pass-strength-result.bad {
|
||||||
background-color: #ffeff7;
|
background-color: #ffeff7;
|
||||||
border: 1px solid #cc6699;
|
border: 1px solid #cc6699;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pass-strength-result.good {
|
#pass-strength-result.good {
|
||||||
background-color: #effff4;
|
background-color: #effff4;
|
||||||
border: 1px solid #66cc87;
|
border: 1px solid #66cc87;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pass-strength-result.strong {
|
#pass-strength-result.strong {
|
||||||
background-color: #59ef86;
|
background-color: #59ef86;
|
||||||
border: 1px solid #319f52;
|
border: 1px solid #319f52;
|
||||||
}
|
}
|
||||||
@ -694,7 +694,7 @@ a.view-comment-post-link {
|
|||||||
-khtml-border-top-left-radius: 3px;
|
-khtml-border-top-left-radius: 3px;
|
||||||
-webkit-border-top-left-radius: 3px;
|
-webkit-border-top-left-radius: 3px;
|
||||||
border-top-left-radius: 3px;
|
border-top-left-radius: 3px;
|
||||||
-moz-border-radius-topright: 3px;
|
-moz-border-radius-topright: 3px;
|
||||||
-khtml-border-top-right-radius: 3px;
|
-khtml-border-top-right-radius: 3px;
|
||||||
-webkit-border-top-right-radius: 3px;
|
-webkit-border-top-right-radius: 3px;
|
||||||
border-top-right-radius: 3px;
|
border-top-right-radius: 3px;
|
||||||
@ -891,8 +891,8 @@ strong .post-com-count span {
|
|||||||
html, body {
|
html, body {
|
||||||
height:100%;
|
height:100%;
|
||||||
}
|
}
|
||||||
#wpwrap {
|
#wpwrap {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
#wpcontent{
|
#wpcontent{
|
||||||
@ -905,8 +905,8 @@ html, body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
background: #464646 url('images/logo-ghost.png') no-repeat 20px 10px;
|
background: #464646 url('images/logo-ghost.png') no-repeat 20px 10px;
|
||||||
color: #999;
|
color: #999;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: -75px;
|
margin-top: -75px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer a {
|
#footer a {
|
||||||
@ -1064,7 +1064,7 @@ html, body {
|
|||||||
#link_name, #link_url, #link_description {
|
#link_name, #link_url, #link_description {
|
||||||
font-size: 1.7em;
|
font-size: 1.7em;
|
||||||
padding: 4px 3px;
|
padding: 4px 3px;
|
||||||
width: 98%;
|
width: 98%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#edit-slug-box {
|
#edit-slug-box {
|
||||||
|
@ -1,68 +1,68 @@
|
|||||||
/* Based on Arabic (RTL) version of Kubrick theme, converted by Serdal (Serdal.com) */
|
/* Based on Arabic (RTL) version of Kubrick theme, converted by Serdal (Serdal.com) */
|
||||||
|
|
||||||
.narrowcolumn, .alignleft, .widecolumn .smallattachment { float: right; }
|
.narrowcolumn, .alignleft, .widecolumn .smallattachment { float: right; }
|
||||||
.alignright, #commentform #submit { float: left; }
|
.alignright, #commentform #submit { float: left; }
|
||||||
|
|
||||||
#page, .post, #wp-calendar #prev a { text-align: right; }
|
#page, .post, #wp-calendar #prev a { text-align: right; }
|
||||||
|
|
||||||
body, #commentform p { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
body, #commentform p { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
||||||
|
|
||||||
small { font-family: 'Geeza Pro', Tahoma, Arial, Helvetica, Sans-Serif; }
|
small { font-family: 'Geeza Pro', Tahoma, Arial, Helvetica, Sans-Serif; }
|
||||||
|
|
||||||
h1, h2, h3 { font-family: 'Al Bayan', 'Traditional Arabic', 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
h1, h2, h3 { font-family: 'Al Bayan', 'Traditional Arabic', 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
||||||
|
|
||||||
#sidebar h2 { font-family: 'Al Bayan', 'Traditional Arabic', 'Lucida Grande', Verdana, Sans-Serif; }
|
#sidebar h2 { font-family: 'Al Bayan', 'Traditional Arabic', 'Lucida Grande', Verdana, Sans-Serif; }
|
||||||
|
|
||||||
.commentlist li, #commentform input, #commentform textarea { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
.commentlist li, #commentform input, #commentform textarea { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
||||||
|
|
||||||
#sidebar { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
#sidebar { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
||||||
|
|
||||||
#wp-calendar caption { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
#wp-calendar caption { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; }
|
||||||
|
|
||||||
acronym, abbr, span.caps { letter-spacing: normal; }
|
acronym, abbr, span.caps { letter-spacing: normal; }
|
||||||
|
|
||||||
#header { margin: 0 1px 0 0; }
|
#header { margin: 0 1px 0 0; }
|
||||||
|
|
||||||
.narrowcolumn { padding: 0 45px 20px 0; }
|
.narrowcolumn { padding: 0 45px 20px 0; }
|
||||||
|
|
||||||
.widecolumn { margin: 5px 150px 0 0; }
|
.widecolumn { margin: 5px 150px 0 0; }
|
||||||
|
|
||||||
.widecolumn .smallattachment { margin: 5px 0px 5px 5px; }
|
.widecolumn .smallattachment { margin: 5px 0px 5px 5px; }
|
||||||
|
|
||||||
.postmetadata { clear: right; }
|
.postmetadata { clear: right; }
|
||||||
|
|
||||||
img.alignright { margin: 0 7px 2px 0; }
|
img.alignright { margin: 0 7px 2px 0; }
|
||||||
|
|
||||||
img.alignleft { margin: 0 0 2px 7px; }
|
img.alignleft { margin: 0 0 2px 7px; }
|
||||||
|
|
||||||
.entry ol { padding: 0 35px 0 0; }
|
.entry ol { padding: 0 35px 0 0; }
|
||||||
|
|
||||||
#sidebar ul ul, #sidebar ul ol { margin: 5px 10px 0 0; }
|
#sidebar ul ul, #sidebar ul ol { margin: 5px 10px 0 0; }
|
||||||
|
|
||||||
#sidebar ul ul ul, #sidebar ul ol { margin: 0 10px 0 0; }
|
#sidebar ul ul ul, #sidebar ul ol { margin: 0 10px 0 0; }
|
||||||
|
|
||||||
#commentform input { margin: 5px 0 1px 5px; }
|
#commentform input { margin: 5px 0 1px 5px; }
|
||||||
|
|
||||||
.commentlist p { margin: 10px 0 10px 5px; }
|
.commentlist p { margin: 10px 0 10px 5px; }
|
||||||
|
|
||||||
html>body .entry li { margin: 7px 10px 8px 0; }
|
html>body .entry li { margin: 7px 10px 8px 0; }
|
||||||
|
|
||||||
html>body .entry ul {
|
html>body .entry ul {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
padding: 0 30px 0 0;
|
padding: 0 30px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: 545px;
|
margin-right: 545px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wp-calendar #prev a, html>body .entry ul {
|
#wp-calendar #prev a, html>body .entry ul {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-right: 5px solid #ddd;
|
border-right: 5px solid #ddd;
|
||||||
@ -70,7 +70,7 @@ blockquote {
|
|||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
margin: 15px 10px 0 30px;
|
margin: 15px 10px 0 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wp-calendar #next a {
|
#wp-calendar #next a {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Theme Name: WordPress Default
|
Theme Name: WordPress Default
|
||||||
Theme URI: http://wordpress.org/
|
Theme URI: http://wordpress.org/
|
||||||
Description: The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.
|
Description: The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.
|
||||||
@ -39,11 +39,11 @@ body {
|
|||||||
background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center;
|
background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headerimg {
|
#headerimg {
|
||||||
margin: 7px 9px 0;
|
margin: 7px 9px 0;
|
||||||
height: 192px;
|
height: 192px;
|
||||||
width: 740px;
|
width: 740px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
font-size: 1.2em
|
font-size: 1.2em
|
||||||
@ -72,7 +72,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
background: #eee url('images/kubrickfooter.jpg') no-repeat top;
|
background: #eee url('images/kubrickfooter.jpg') no-repeat top;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ a:hover {
|
|||||||
/* Begin Structure */
|
/* Begin Structure */
|
||||||
body {
|
body {
|
||||||
margin: 0 0 20px 0;
|
margin: 0 0 20px 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
@ -224,9 +224,9 @@ body {
|
|||||||
|
|
||||||
#header {
|
#header {
|
||||||
background-color: #73a0c5;
|
background-color: #73a0c5;
|
||||||
margin: 0 0 0 1px;
|
margin: 0 0 0 1px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
width: 758px;
|
width: 758px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ html>body .entry ul {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
text-indent: -10px;
|
text-indent: -10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
html>body .entry li {
|
html>body .entry li {
|
||||||
margin: 7px 0 8px 10px;
|
margin: 7px 0 8px 10px;
|
||||||
@ -450,7 +450,7 @@ ol li, #sidebar ul ol li {
|
|||||||
/* Begin Form Elements */
|
/* Begin Form Elements */
|
||||||
#searchform {
|
#searchform {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
padding: 5px 3px;
|
padding: 5px 3px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,25 +167,25 @@ function get_the_category_list($separator = '', $parents='', $post_id = false) {
|
|||||||
return apply_filters('the_category', $thelist, $separator, $parents);
|
return apply_filters('the_category', $thelist, $separator, $parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in_category() - Checks whether the current post is within a particular category
|
* in_category() - Checks whether the current post is within a particular category
|
||||||
*
|
*
|
||||||
* This function checks to see if the post is within the supplied category. The categoy
|
* This function checks to see if the post is within the supplied category. The categoy
|
||||||
* can be specified by number or name and will be checked as a name first to allow for categories with numeric names.
|
* can be specified by number or name and will be checked as a name first to allow for categories with numeric names.
|
||||||
* Note: Prior to v2.5 of WordPress category names where not supported.
|
* Note: Prior to v2.5 of WordPress category names where not supported.
|
||||||
*
|
*
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*
|
*
|
||||||
* @param int|string $category
|
* @param int|string $category
|
||||||
* @return bool true if the post is in the supplied category
|
* @return bool true if the post is in the supplied category
|
||||||
*/
|
*/
|
||||||
function in_category( $category ) { // Check if the current post is in the given category
|
function in_category( $category ) { // Check if the current post is in the given category
|
||||||
global $post;
|
global $post;
|
||||||
|
|
||||||
$cat_ID = get_cat_ID($category);
|
$cat_ID = get_cat_ID($category);
|
||||||
if (0 != $cat_ID)
|
if (0 != $cat_ID)
|
||||||
$category = $cat_ID;
|
$category = $cat_ID;
|
||||||
|
|
||||||
$categories = get_object_term_cache($post->ID, 'category');
|
$categories = get_object_term_cache($post->ID, 'category');
|
||||||
if ( false === $categories )
|
if ( false === $categories )
|
||||||
$categories = wp_get_object_terms($post->ID, 'category');
|
$categories = wp_get_object_terms($post->ID, 'category');
|
||||||
|
@ -416,34 +416,34 @@ class Walker {
|
|||||||
$cb_args = array_merge( array($output, $element, $depth), $args);
|
$cb_args = array_merge( array($output, $element, $depth), $args);
|
||||||
$output = call_user_func_array(array(&$this, 'start_el'), $cb_args);
|
$output = call_user_func_array(array(&$this, 'start_el'), $cb_args);
|
||||||
|
|
||||||
if ( $max_depth == 0 ||
|
if ( $max_depth == 0 ||
|
||||||
($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend
|
($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend
|
||||||
|
|
||||||
for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
|
for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
|
||||||
|
|
||||||
$child = $children_elements[$i];
|
$child = $children_elements[$i];
|
||||||
if ( $child->$parent_field == $element->$id_field ) {
|
if ( $child->$parent_field == $element->$id_field ) {
|
||||||
|
|
||||||
if ( !isset($newlevel) ) {
|
if ( !isset($newlevel) ) {
|
||||||
$newlevel = true;
|
$newlevel = true;
|
||||||
//start the child delimiter
|
//start the child delimiter
|
||||||
$cb_args = array_merge( array($output, $depth), $args);
|
$cb_args = array_merge( array($output, $depth), $args);
|
||||||
$output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
|
$output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_splice( $children_elements, $i, 1 );
|
array_splice( $children_elements, $i, 1 );
|
||||||
$output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
|
$output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
|
||||||
$i = -1;
|
$i = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($newlevel) && $newlevel ){
|
if ( isset($newlevel) && $newlevel ){
|
||||||
//end the child delimiter
|
//end the child delimiter
|
||||||
$cb_args = array_merge( array($output, $depth), $args);
|
$cb_args = array_merge( array($output, $depth), $args);
|
||||||
$output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
|
$output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
//end this element
|
//end this element
|
||||||
$cb_args = array_merge( array($output, $element, $depth), $args);
|
$cb_args = array_merge( array($output, $element, $depth), $args);
|
||||||
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
|
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
|
||||||
|
@ -1276,7 +1276,7 @@ function documentation_link( $deprecated = '' ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* gzip_compression() - Unused function
|
* gzip_compression() - Unused function
|
||||||
*
|
*
|
||||||
* @deprecated 2.5
|
* @deprecated 2.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -5,14 +5,14 @@ function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {
|
|||||||
$m = $mysqlstring;
|
$m = $mysqlstring;
|
||||||
if ( empty( $m ) )
|
if ( empty( $m ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( 'G' == $dateformatstring ) {
|
if( 'G' == $dateformatstring ) {
|
||||||
return gmmktime(
|
return gmmktime(
|
||||||
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
||||||
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = mktime(
|
$i = mktime(
|
||||||
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
||||||
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
||||||
@ -906,7 +906,7 @@ function do_feed() {
|
|||||||
wp_die($message);
|
wp_die($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( $hook, $wp_query->is_comment_feed );
|
do_action( $hook, $wp_query->is_comment_feed );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1043,7 +1043,7 @@ function path_is_absolute( $path ) {
|
|||||||
|
|
||||||
if ( strlen($path) == 0 || $path{0} == '.' )
|
if ( strlen($path) == 0 || $path{0} == '.' )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// windows allows absolute paths like this
|
// windows allows absolute paths like this
|
||||||
if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
|
if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
|
||||||
return true;
|
return true;
|
||||||
@ -1056,7 +1056,7 @@ function path_is_absolute( $path ) {
|
|||||||
function path_join( $base, $path ) {
|
function path_join( $base, $path ) {
|
||||||
if ( path_is_absolute($path) )
|
if ( path_is_absolute($path) )
|
||||||
return $path;
|
return $path;
|
||||||
|
|
||||||
return rtrim($base, '/') . '/' . ltrim($path, '/');
|
return rtrim($base, '/') . '/' . ltrim($path, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1064,7 +1064,7 @@ function path_join( $base, $path ) {
|
|||||||
function wp_upload_dir( $time = NULL ) {
|
function wp_upload_dir( $time = NULL ) {
|
||||||
$siteurl = get_option( 'siteurl' );
|
$siteurl = get_option( 'siteurl' );
|
||||||
$upload_path = $dir = get_option( 'upload_path' );
|
$upload_path = $dir = get_option( 'upload_path' );
|
||||||
|
|
||||||
// $dir is absolute, $path is (maybe) relative to ABSPATH
|
// $dir is absolute, $path is (maybe) relative to ABSPATH
|
||||||
$dir = path_join( ABSPATH, $upload_path );
|
$dir = path_join( ABSPATH, $upload_path );
|
||||||
$path = str_replace( ABSPATH, '', trim( $upload_path ) );
|
$path = str_replace( ABSPATH, '', trim( $upload_path ) );
|
||||||
@ -1089,7 +1089,7 @@ function wp_upload_dir( $time = NULL ) {
|
|||||||
$m = substr( $time, 5, 2 );
|
$m = substr( $time, 5, 2 );
|
||||||
$subdir = "/$y/$m";
|
$subdir = "/$y/$m";
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir .= $subdir;
|
$dir .= $subdir;
|
||||||
$url .= $subdir;
|
$url .= $subdir;
|
||||||
|
|
||||||
@ -1184,7 +1184,7 @@ function wp_ext2type( $ext ) {
|
|||||||
'interactive' => array('ppt','key','odp','swf'),
|
'interactive' => array('ppt','key','odp','swf'),
|
||||||
'text' => array('txt'),
|
'text' => array('txt'),
|
||||||
'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
|
'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
|
||||||
'code' => array('css','html','php','js'),
|
'code' => array('css','html','php','js'),
|
||||||
));
|
));
|
||||||
foreach ( $ext2type as $type => $exts )
|
foreach ( $ext2type as $type => $exts )
|
||||||
if ( in_array($ext, $exts) )
|
if ( in_array($ext, $exts) )
|
||||||
|
@ -937,8 +937,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button
|
|||||||
<a id="edButtonHTML" class="active"><?php _e('HTML'); ?></a>
|
<a id="edButtonHTML" class="active"><?php _e('HTML'); ?></a>
|
||||||
<a id="edButtonPreview" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('Visual'); ?></a>
|
<a id="edButtonPreview" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('Visual'); ?></a>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $media_buttons ) { ?>
|
if ( $media_buttons ) { ?>
|
||||||
<div id="media-buttons">
|
<div id="media-buttons">
|
||||||
<?php do_action( 'media_buttons' ); ?>
|
<?php do_action( 'media_buttons' ); ?>
|
||||||
|
@ -132,7 +132,7 @@ var autosave = function() {
|
|||||||
|
|
||||||
/* Gotta do this up here so we can check the length when tinyMCE is in use */
|
/* Gotta do this up here so we can check the length when tinyMCE is in use */
|
||||||
if ( rich ) { tinyMCE.triggerSave(); }
|
if ( rich ) { tinyMCE.triggerSave(); }
|
||||||
|
|
||||||
post_data["content"] = jQuery("#content").val();
|
post_data["content"] = jQuery("#content").val();
|
||||||
if ( jQuery('#post_name').val() )
|
if ( jQuery('#post_name').val() )
|
||||||
post_data["post_name"] = jQuery('#post_name').val();
|
post_data["post_name"] = jQuery('#post_name').val();
|
||||||
|
@ -25,15 +25,15 @@ function zeroise(number, threshold) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var datetime = now.getUTCFullYear() + '-' +
|
var datetime = now.getUTCFullYear() + '-' +
|
||||||
zeroise(now.getUTCMonth() + 1, 2) + '-' +
|
zeroise(now.getUTCMonth() + 1, 2) + '-' +
|
||||||
zeroise(now.getUTCDate(), 2) + 'T' +
|
zeroise(now.getUTCDate(), 2) + 'T' +
|
||||||
zeroise(now.getUTCHours(), 2) + ':' +
|
zeroise(now.getUTCHours(), 2) + ':' +
|
||||||
zeroise(now.getUTCMinutes(), 2) + ':' +
|
zeroise(now.getUTCMinutes(), 2) + ':' +
|
||||||
zeroise(now.getUTCSeconds() ,2) +
|
zeroise(now.getUTCSeconds() ,2) +
|
||||||
'+00:00';
|
'+00:00';
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_strong'
|
new edButton('ed_strong'
|
||||||
,'b'
|
,'b'
|
||||||
,'<strong>'
|
,'<strong>'
|
||||||
@ -41,7 +41,7 @@ new edButton('ed_strong'
|
|||||||
,'b'
|
,'b'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_em'
|
new edButton('ed_em'
|
||||||
,'i'
|
,'i'
|
||||||
,'<em>'
|
,'<em>'
|
||||||
@ -49,7 +49,7 @@ new edButton('ed_em'
|
|||||||
,'i'
|
,'i'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_link'
|
new edButton('ed_link'
|
||||||
,'link'
|
,'link'
|
||||||
,''
|
,''
|
||||||
@ -57,7 +57,7 @@ new edButton('ed_link'
|
|||||||
,'a'
|
,'a'
|
||||||
); // special case
|
); // special case
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_block'
|
new edButton('ed_block'
|
||||||
,'b-quote'
|
,'b-quote'
|
||||||
,'\n\n<blockquote>'
|
,'\n\n<blockquote>'
|
||||||
@ -66,7 +66,7 @@ new edButton('ed_block'
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_del'
|
new edButton('ed_del'
|
||||||
,'del'
|
,'del'
|
||||||
,'<del datetime="' + datetime + '">'
|
,'<del datetime="' + datetime + '">'
|
||||||
@ -74,7 +74,7 @@ new edButton('ed_del'
|
|||||||
,'d'
|
,'d'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_ins'
|
new edButton('ed_ins'
|
||||||
,'ins'
|
,'ins'
|
||||||
,'<ins datetime="' + datetime + '">'
|
,'<ins datetime="' + datetime + '">'
|
||||||
@ -82,7 +82,7 @@ new edButton('ed_ins'
|
|||||||
,'s'
|
,'s'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_img'
|
new edButton('ed_img'
|
||||||
,'img'
|
,'img'
|
||||||
,''
|
,''
|
||||||
@ -91,7 +91,7 @@ new edButton('ed_img'
|
|||||||
,-1
|
,-1
|
||||||
); // special case
|
); // special case
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_ul'
|
new edButton('ed_ul'
|
||||||
,'ul'
|
,'ul'
|
||||||
,'<ul>\n'
|
,'<ul>\n'
|
||||||
@ -99,7 +99,7 @@ new edButton('ed_ul'
|
|||||||
,'u'
|
,'u'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_ol'
|
new edButton('ed_ol'
|
||||||
,'ol'
|
,'ol'
|
||||||
,'<ol>\n'
|
,'<ol>\n'
|
||||||
@ -107,7 +107,7 @@ new edButton('ed_ol'
|
|||||||
,'o'
|
,'o'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_li'
|
new edButton('ed_li'
|
||||||
,'li'
|
,'li'
|
||||||
,'\t<li>'
|
,'\t<li>'
|
||||||
@ -115,7 +115,7 @@ new edButton('ed_li'
|
|||||||
,'l'
|
,'l'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_code'
|
new edButton('ed_code'
|
||||||
,'code'
|
,'code'
|
||||||
,'<code>'
|
,'<code>'
|
||||||
@ -123,7 +123,7 @@ new edButton('ed_code'
|
|||||||
,'c'
|
,'c'
|
||||||
);
|
);
|
||||||
|
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_more'
|
new edButton('ed_more'
|
||||||
,'more'
|
,'more'
|
||||||
,'<!--more-->'
|
,'<!--more-->'
|
||||||
@ -132,7 +132,7 @@ new edButton('ed_more'
|
|||||||
,-1
|
,-1
|
||||||
);
|
);
|
||||||
/*
|
/*
|
||||||
edButtons[edButtons.length] =
|
edButtons[edButtons.length] =
|
||||||
new edButton('ed_next'
|
new edButton('ed_next'
|
||||||
,'page'
|
,'page'
|
||||||
,'<!--nextpage-->'
|
,'<!--nextpage-->'
|
||||||
@ -220,7 +220,7 @@ function edQuickLink(i, thisSelect) {
|
|||||||
if (edLinks[i].newWin == 1) {
|
if (edLinks[i].newWin == 1) {
|
||||||
newWin = ' target="_blank"';
|
newWin = ' target="_blank"';
|
||||||
}
|
}
|
||||||
var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
|
var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
|
||||||
+ edLinks[i].display
|
+ edLinks[i].display
|
||||||
+ '</a>';
|
+ '</a>';
|
||||||
thisSelect.selectedIndex = 0;
|
thisSelect.selectedIndex = 0;
|
||||||
@ -298,21 +298,21 @@ function edInsertTag(myField, i) {
|
|||||||
if (startPos != endPos) {
|
if (startPos != endPos) {
|
||||||
myField.value = myField.value.substring(0, startPos)
|
myField.value = myField.value.substring(0, startPos)
|
||||||
+ edButtons[i].tagStart
|
+ edButtons[i].tagStart
|
||||||
+ myField.value.substring(startPos, endPos)
|
+ myField.value.substring(startPos, endPos)
|
||||||
+ edButtons[i].tagEnd
|
+ edButtons[i].tagEnd
|
||||||
+ myField.value.substring(endPos, myField.value.length);
|
+ myField.value.substring(endPos, myField.value.length);
|
||||||
cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length;
|
cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
|
if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
|
||||||
myField.value = myField.value.substring(0, startPos)
|
myField.value = myField.value.substring(0, startPos)
|
||||||
+ edButtons[i].tagStart
|
+ edButtons[i].tagStart
|
||||||
+ myField.value.substring(endPos, myField.value.length);
|
+ myField.value.substring(endPos, myField.value.length);
|
||||||
edAddTag(i);
|
edAddTag(i);
|
||||||
cursorPos = startPos + edButtons[i].tagStart.length;
|
cursorPos = startPos + edButtons[i].tagStart.length;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myField.value = myField.value.substring(0, startPos)
|
myField.value = myField.value.substring(0, startPos)
|
||||||
+ edButtons[i].tagEnd
|
+ edButtons[i].tagEnd
|
||||||
+ myField.value.substring(endPos, myField.value.length);
|
+ myField.value.substring(endPos, myField.value.length);
|
||||||
edRemoveTag(i);
|
edRemoveTag(i);
|
||||||
@ -350,7 +350,7 @@ function edInsertContent(myField, myValue) {
|
|||||||
var startPos = myField.selectionStart;
|
var startPos = myField.selectionStart;
|
||||||
var endPos = myField.selectionEnd;
|
var endPos = myField.selectionEnd;
|
||||||
myField.value = myField.value.substring(0, startPos)
|
myField.value = myField.value.substring(0, startPos)
|
||||||
+ myValue
|
+ myValue
|
||||||
+ myField.value.substring(endPos, myField.value.length);
|
+ myField.value.substring(endPos, myField.value.length);
|
||||||
myField.focus();
|
myField.focus();
|
||||||
myField.selectionStart = startPos + myValue.length;
|
myField.selectionStart = startPos + myValue.length;
|
||||||
@ -380,9 +380,9 @@ function edInsertLink(myField, i, defaultValue) {
|
|||||||
function edInsertImage(myField) {
|
function edInsertImage(myField) {
|
||||||
var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
|
var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
|
||||||
if (myValue) {
|
if (myValue) {
|
||||||
myValue = '<img src="'
|
myValue = '<img src="'
|
||||||
+ myValue
|
+ myValue
|
||||||
+ '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
|
+ '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
|
||||||
+ '" />';
|
+ '" />';
|
||||||
edInsertContent(myField, myValue);
|
edInsertContent(myField, myValue);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ var wpList = {
|
|||||||
s.element = cls[2] || e.attr( 'id' ) || s.element || null;
|
s.element = cls[2] || e.attr( 'id' ) || s.element || null;
|
||||||
if ( cls[3] ) { s.addColor = '#' + cls[3]; }
|
if ( cls[3] ) { s.addColor = '#' + cls[3]; }
|
||||||
else { s.addColor = s.addColor || '#FFFF33'; }
|
else { s.addColor = s.addColor || '#FFFF33'; }
|
||||||
|
|
||||||
if ( !s ) { return false; }
|
if ( !s ) { return false; }
|
||||||
|
|
||||||
if ( !e.is("[class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); }
|
if ( !e.is("[class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); }
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
// scale down the default size of an image so it's a better fit for the editor and theme
|
// scale down the default size of an image so it's a better fit for the editor and theme
|
||||||
function image_constrain_size_for_editor($width, $height, $size = 'medium') {
|
function image_constrain_size_for_editor($width, $height, $size = 'medium') {
|
||||||
|
|
||||||
if ( $size == 'thumb' ) {
|
if ( $size == 'thumb' ) {
|
||||||
$max_width = intval(get_option('thumbnail_size_w'));
|
$max_width = intval(get_option('thumbnail_size_w'));
|
||||||
$max_height = intval(get_option('thumbnail_size_h'));
|
$max_height = intval(get_option('thumbnail_size_h'));
|
||||||
@ -33,7 +33,7 @@ function image_constrain_size_for_editor($width, $height, $size = 'medium') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size );
|
list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size );
|
||||||
|
|
||||||
return wp_constrain_dimensions( $width, $height, $max_width, $max_height );
|
return wp_constrain_dimensions( $width, $height, $max_width, $max_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,15 +51,15 @@ function image_hwstring($width, $height) {
|
|||||||
// The URL might be the original image, or it might be a resized version.
|
// The URL might be the original image, or it might be a resized version.
|
||||||
// returns an array($url, $width, $height)
|
// returns an array($url, $width, $height)
|
||||||
function image_downsize($id, $size = 'medium') {
|
function image_downsize($id, $size = 'medium') {
|
||||||
|
|
||||||
$img_url = wp_get_attachment_url($id);
|
$img_url = wp_get_attachment_url($id);
|
||||||
$meta = wp_get_attachment_metadata($id);
|
$meta = wp_get_attachment_metadata($id);
|
||||||
$width = $height = 0;
|
$width = $height = 0;
|
||||||
|
|
||||||
// plugins can use this to provide resize services
|
// plugins can use this to provide resize services
|
||||||
if ( $out = apply_filters('image_downsize', false, $id, $size) )
|
if ( $out = apply_filters('image_downsize', false, $id, $size) )
|
||||||
return $out;
|
return $out;
|
||||||
|
|
||||||
if ( $size == 'thumb' ) {
|
if ( $size == 'thumb' ) {
|
||||||
// thumbnail: use the thumb as the displayed image, and constrain based on its dimensions
|
// thumbnail: use the thumb as the displayed image, and constrain based on its dimensions
|
||||||
$thumb_path = wp_get_attachment_thumb_file($id);
|
$thumb_path = wp_get_attachment_thumb_file($id);
|
||||||
@ -74,9 +74,9 @@ function image_downsize($id, $size = 'medium') {
|
|||||||
// any other type: use the real image and constrain it
|
// any other type: use the real image and constrain it
|
||||||
list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size );
|
list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size );
|
||||||
}
|
}
|
||||||
|
|
||||||
return array( $img_url, $width, $height );
|
return array( $img_url, $width, $height );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// return an <img src /> tag for the given image attachment, scaling it down if requested
|
// return an <img src /> tag for the given image attachment, scaling it down if requested
|
||||||
@ -97,31 +97,31 @@ function get_image_tag($id, $alt, $title, $align, $rel = false, $size='medium')
|
|||||||
function wp_constrain_dimensions( $current_width, $current_height, $max_width=0, $max_height=0 ) {
|
function wp_constrain_dimensions( $current_width, $current_height, $max_width=0, $max_height=0 ) {
|
||||||
if ( !$max_width and !$max_height )
|
if ( !$max_width and !$max_height )
|
||||||
return array( $current_width, $current_height );
|
return array( $current_width, $current_height );
|
||||||
|
|
||||||
$width_ratio = $height_ratio = 1.0;
|
$width_ratio = $height_ratio = 1.0;
|
||||||
|
|
||||||
if ( $max_width > 0 && $current_width > $max_width )
|
if ( $max_width > 0 && $current_width > $max_width )
|
||||||
$width_ratio = $max_width / $current_width;
|
$width_ratio = $max_width / $current_width;
|
||||||
|
|
||||||
if ( $max_height > 0 && $current_height > $max_height )
|
if ( $max_height > 0 && $current_height > $max_height )
|
||||||
$height_ratio = $max_height / $current_height;
|
$height_ratio = $max_height / $current_height;
|
||||||
|
|
||||||
// the smaller ratio is the one we need to fit it to the constraining box
|
// the smaller ratio is the one we need to fit it to the constraining box
|
||||||
$ratio = min( $width_ratio, $height_ratio );
|
$ratio = min( $width_ratio, $height_ratio );
|
||||||
|
|
||||||
return array( intval($current_width * $ratio), intval($current_height * $ratio) );
|
return array( intval($current_width * $ratio), intval($current_height * $ratio) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate dimensions and coordinates for a resized image that fits within a specified width and height
|
// calculate dimensions and coordinates for a resized image that fits within a specified width and height
|
||||||
// if $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size
|
// if $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size
|
||||||
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false) {
|
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false) {
|
||||||
|
|
||||||
if ($orig_w <= 0 || $orig_h <= 0)
|
if ($orig_w <= 0 || $orig_h <= 0)
|
||||||
return false;
|
return false;
|
||||||
// at least one of dest_w or dest_h must be specific
|
// at least one of dest_w or dest_h must be specific
|
||||||
if ($dest_w <= 0 && $dest_h <= 0)
|
if ($dest_w <= 0 && $dest_h <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( $crop ) {
|
if ( $crop ) {
|
||||||
// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h
|
// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h
|
||||||
$aspect_ratio = $orig_w / $orig_h;
|
$aspect_ratio = $orig_w / $orig_h;
|
||||||
@ -135,7 +135,7 @@ function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false
|
|||||||
}
|
}
|
||||||
|
|
||||||
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
|
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
|
||||||
|
|
||||||
$crop_w = ceil($new_w / $size_ratio);
|
$crop_w = ceil($new_w / $size_ratio);
|
||||||
$crop_h = ceil($new_h / $size_ratio);
|
$crop_h = ceil($new_h / $size_ratio);
|
||||||
|
|
||||||
@ -146,13 +146,13 @@ function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false
|
|||||||
// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
|
// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
|
||||||
$crop_w = $orig_w;
|
$crop_w = $orig_w;
|
||||||
$crop_h = $orig_h;
|
$crop_h = $orig_h;
|
||||||
|
|
||||||
$s_x = 0;
|
$s_x = 0;
|
||||||
$s_y = 0;
|
$s_y = 0;
|
||||||
|
|
||||||
list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );
|
list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the resulting image would be the same size or larger we don't want to resize it
|
// if the resulting image would be the same size or larger we don't want to resize it
|
||||||
if ($new_w >= $orig_w && $new_h >= $orig_h)
|
if ($new_w >= $orig_w && $new_h >= $orig_h)
|
||||||
return false;
|
return false;
|
||||||
@ -175,7 +175,7 @@ function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_p
|
|||||||
if (!$dims)
|
if (!$dims)
|
||||||
return $dims;
|
return $dims;
|
||||||
list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims;
|
list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims;
|
||||||
|
|
||||||
$newimage = imagecreatetruecolor( $dst_w, $dst_h);
|
$newimage = imagecreatetruecolor( $dst_w, $dst_h);
|
||||||
|
|
||||||
// preserve PNG transparency
|
// preserve PNG transparency
|
||||||
|
@ -650,7 +650,7 @@ function check_ajax_referer( $action = -1, $query_arg = false ) {
|
|||||||
else
|
else
|
||||||
$nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
|
$nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
|
||||||
|
|
||||||
if ( !wp_verify_nonce( $nonce, $action ) )
|
if ( !wp_verify_nonce( $nonce, $action ) )
|
||||||
die('-1');
|
die('-1');
|
||||||
|
|
||||||
do_action('check_ajax_referer');
|
do_action('check_ajax_referer');
|
||||||
@ -856,7 +856,7 @@ function wp_notify_moderator($comment_id) {
|
|||||||
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
|
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
|
||||||
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
|
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
|
||||||
|
|
||||||
switch ($comment->comment_type)
|
switch ($comment->comment_type)
|
||||||
{
|
{
|
||||||
case 'trackback':
|
case 'trackback':
|
||||||
$notify_message = sprintf( __('A new trackback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
|
$notify_message = sprintf( __('A new trackback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
|
||||||
@ -882,11 +882,11 @@ function wp_notify_moderator($comment_id) {
|
|||||||
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
|
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$notify_message .= sprintf( __('Approve it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
|
$notify_message .= sprintf( __('Approve it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
|
||||||
$notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
|
$notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
|
||||||
$notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
|
$notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
|
||||||
|
|
||||||
$strCommentsPending = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
|
$strCommentsPending = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
|
||||||
$notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
|
$notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
|
||||||
$notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
|
$notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
|
||||||
|
@ -1428,8 +1428,8 @@ function wp_publish_post($post_id) {
|
|||||||
/**
|
/**
|
||||||
* check_and_publish_future_post() - check to make sure post has correct status before
|
* check_and_publish_future_post() - check to make sure post has correct status before
|
||||||
* passing it on to be published. Invoked by cron 'publish_future_post' event
|
* passing it on to be published. Invoked by cron 'publish_future_post' event
|
||||||
* This safeguard prevents cron from publishing drafts, etc.
|
* This safeguard prevents cron from publishing drafts, etc.
|
||||||
*
|
*
|
||||||
* {@internal Missing Long Description}}
|
* {@internal Missing Long Description}}
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
@ -1441,7 +1441,7 @@ function wp_publish_post($post_id) {
|
|||||||
* @return int|null {@internal Missing Description}}
|
* @return int|null {@internal Missing Description}}
|
||||||
*/
|
*/
|
||||||
function check_and_publish_future_post($post_id) {
|
function check_and_publish_future_post($post_id) {
|
||||||
|
|
||||||
$post = get_post($post_id);
|
$post = get_post($post_id);
|
||||||
|
|
||||||
if ( empty($post) )
|
if ( empty($post) )
|
||||||
@ -1450,7 +1450,7 @@ function check_and_publish_future_post($post_id) {
|
|||||||
if ( 'future' != $post->post_status )
|
if ( 'future' != $post->post_status )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
return wp_publish_post($post_id);
|
return wp_publish_post($post_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_add_post_tags($post_id = 0, $tags = '') {
|
function wp_add_post_tags($post_id = 0, $tags = '') {
|
||||||
@ -2931,7 +2931,7 @@ function _get_post_ancestors(&$_post) {
|
|||||||
|
|
||||||
if ( !empty($_post->ancestors) )
|
if ( !empty($_post->ancestors) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$_post->ancestors = array();
|
$_post->ancestors = array();
|
||||||
|
|
||||||
if ( empty($_post->post_parent) || $_post->ID == $_post->post_parent )
|
if ( empty($_post->post_parent) || $_post->ID == $_post->post_parent )
|
||||||
|
@ -32,13 +32,13 @@ class WP_Scripts {
|
|||||||
// Let a plugin replace the visual editor
|
// Let a plugin replace the visual editor
|
||||||
$visual_editor = apply_filters('visual_editor', array('tiny_mce'));
|
$visual_editor = apply_filters('visual_editor', array('tiny_mce'));
|
||||||
$this->add( 'editor', false, $visual_editor, '20080218' );
|
$this->add( 'editor', false, $visual_editor, '20080218' );
|
||||||
|
|
||||||
$this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080221' );
|
$this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080221' );
|
||||||
|
|
||||||
// Modify this version when tinyMCE plugins are changed.
|
// Modify this version when tinyMCE plugins are changed.
|
||||||
$mce_version = apply_filters('tiny_mce_version', '20080226');
|
$mce_version = apply_filters('tiny_mce_version', '20080226');
|
||||||
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
|
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
|
||||||
|
|
||||||
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
|
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
|
||||||
|
|
||||||
$this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080229' . mt_rand() );
|
$this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080229' . mt_rand() );
|
||||||
@ -479,12 +479,12 @@ function wp_prototype_before_jquery( $js_array ) {
|
|||||||
return $js_array;
|
return $js_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// These localizations require information that may not be loaded even by init
|
// These localizations require information that may not be loaded even by init
|
||||||
function wp_just_in_time_script_localization() {
|
function wp_just_in_time_script_localization() {
|
||||||
wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
|
wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
|
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
|
||||||
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -262,7 +262,7 @@ function is_active_widget($callback, $widget_id = false) {
|
|||||||
if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback )
|
if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback )
|
||||||
if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
|
if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
|
||||||
return $sidebar;
|
return $sidebar;
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user