Version Description
- Reverted to the old access-checking algorithm + some error suppression.
Download this release
Release Info
| Developer | whiteshadow |
| Plugin | |
| Version | 0.7.3 |
| Comparing to | |
| See all releases | |
Code changes from version 0.7.2 to 0.7.3
- broken-link-checker.php +1 -1
- core.php +12 -14
- readme.txt +4 -1
- utility-class.php +0 -48
broken-link-checker.php
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
Plugin Name: Broken Link Checker
|
| 5 |
Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
|
| 6 |
Description: Checks your posts for broken links and missing images and notifies you on the dashboard if any are found.
|
| 7 |
-
Version: 0.7.
|
| 8 |
Author: Janis Elsts
|
| 9 |
Author URI: http://w-shadow.com/blog/
|
| 10 |
Text Domain: broken-link-checker
|
| 4 |
Plugin Name: Broken Link Checker
|
| 5 |
Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
|
| 6 |
Description: Checks your posts for broken links and missing images and notifies you on the dashboard if any are found.
|
| 7 |
+
Version: 0.7.3
|
| 8 |
Author: Janis Elsts
|
| 9 |
Author URI: http://w-shadow.com/blog/
|
| 10 |
Text Domain: broken-link-checker
|
core.php
CHANGED
|
@@ -527,7 +527,7 @@ class wsBrokenLinkChecker {
|
|
| 527 |
$this->conf->options['custom_fields'] = $new_custom_fields;
|
| 528 |
|
| 529 |
//Temporary file directory
|
| 530 |
-
$this->conf->options['custom_tmp_dir'] =
|
| 531 |
|
| 532 |
//HTTP timeout
|
| 533 |
$new_timeout = intval($_POST['timeout']);
|
|
@@ -743,7 +743,7 @@ class wsBrokenLinkChecker {
|
|
| 743 |
<?php
|
| 744 |
if ( !empty( $this->conf->options['custom_tmp_dir'] ) ) {
|
| 745 |
if ( @is_dir( $this->conf->options['custom_tmp_dir'] ) ){
|
| 746 |
-
if (
|
| 747 |
echo "<strong>", __('OK', 'broken-link-checker'), "</strong>";
|
| 748 |
} else {
|
| 749 |
echo '<span class="error">';
|
|
@@ -2712,30 +2712,28 @@ div.search-box{
|
|
| 2712 |
function lockfile_name(){
|
| 2713 |
//Try the user-specified temp. directory first, if any
|
| 2714 |
if ( !empty( $this->conf->options['custom_tmp_dir'] ) ) {
|
| 2715 |
-
$
|
| 2716 |
-
|
| 2717 |
-
return $custom_dir . 'wp_blc_lock';
|
| 2718 |
} else {
|
| 2719 |
return false;
|
| 2720 |
}
|
| 2721 |
}
|
| 2722 |
|
| 2723 |
//Try the plugin's own directory.
|
| 2724 |
-
|
| 2725 |
-
|
| 2726 |
-
return $plugins_directory . 'wp_blc_lock';
|
| 2727 |
} else {
|
| 2728 |
|
| 2729 |
//Try the system-wide temp directory
|
| 2730 |
-
$path =
|
| 2731 |
-
if ( $path &&
|
| 2732 |
-
return $path . 'wp_blc_lock';
|
| 2733 |
}
|
| 2734 |
|
| 2735 |
//Try the upload directory.
|
| 2736 |
-
$path =
|
| 2737 |
-
if ( $path &&
|
| 2738 |
-
return $path . 'wp_blc_lock';
|
| 2739 |
}
|
| 2740 |
|
| 2741 |
//Fail
|
| 527 |
$this->conf->options['custom_fields'] = $new_custom_fields;
|
| 528 |
|
| 529 |
//Temporary file directory
|
| 530 |
+
$this->conf->options['custom_tmp_dir'] = trim( stripslashes(strval($_POST['custom_tmp_dir'])) );
|
| 531 |
|
| 532 |
//HTTP timeout
|
| 533 |
$new_timeout = intval($_POST['timeout']);
|
| 743 |
<?php
|
| 744 |
if ( !empty( $this->conf->options['custom_tmp_dir'] ) ) {
|
| 745 |
if ( @is_dir( $this->conf->options['custom_tmp_dir'] ) ){
|
| 746 |
+
if ( @is_writable( $this->conf->options['custom_tmp_dir'] ) ){
|
| 747 |
echo "<strong>", __('OK', 'broken-link-checker'), "</strong>";
|
| 748 |
} else {
|
| 749 |
echo '<span class="error">';
|
| 2712 |
function lockfile_name(){
|
| 2713 |
//Try the user-specified temp. directory first, if any
|
| 2714 |
if ( !empty( $this->conf->options['custom_tmp_dir'] ) ) {
|
| 2715 |
+
if ( @is_writable($this->conf->options['custom_tmp_dir']) && @is_dir($this->conf->options['custom_tmp_dir']) ) {
|
| 2716 |
+
return trailingslashit($this->conf->options['custom_tmp_dir']) . 'wp_blc_lock';
|
|
|
|
| 2717 |
} else {
|
| 2718 |
return false;
|
| 2719 |
}
|
| 2720 |
}
|
| 2721 |
|
| 2722 |
//Try the plugin's own directory.
|
| 2723 |
+
if ( @is_writable( dirname(__FILE__) ) ){
|
| 2724 |
+
return dirname(__FILE__) . '/wp_blc_lock';
|
|
|
|
| 2725 |
} else {
|
| 2726 |
|
| 2727 |
//Try the system-wide temp directory
|
| 2728 |
+
$path = sys_get_temp_dir();
|
| 2729 |
+
if ( $path && @is_writable($path)){
|
| 2730 |
+
return trailingslashit($path) . 'wp_blc_lock';
|
| 2731 |
}
|
| 2732 |
|
| 2733 |
//Try the upload directory.
|
| 2734 |
+
$path = ini_get('upload_tmp_dir');
|
| 2735 |
+
if ( $path && @is_writable($path)){
|
| 2736 |
+
return trailingslashit($path) . 'wp_blc_lock';
|
| 2737 |
}
|
| 2738 |
|
| 2739 |
//Fail
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: whiteshadow
|
|
| 3 |
Tags: links, broken, maintenance, blogroll, custom fields, admin
|
| 4 |
Requires at least: 2.8.0
|
| 5 |
Tested up to: 2.9
|
| 6 |
-
Stable tag: 0.7.
|
| 7 |
|
| 8 |
This plugin will check your posts, custom fields and the blogroll for broken links and missing images and notify you if any are found.
|
| 9 |
|
|
@@ -74,6 +74,9 @@ To upgrade your installation
|
|
| 74 |
|
| 75 |
*This is an automatically generated changelog*
|
| 76 |
|
|
|
|
|
|
|
|
|
|
| 77 |
= 0.7.2 =
|
| 78 |
* Only use the custom access rights detection routine if open\_basedir is set.
|
| 79 |
|
| 3 |
Tags: links, broken, maintenance, blogroll, custom fields, admin
|
| 4 |
Requires at least: 2.8.0
|
| 5 |
Tested up to: 2.9
|
| 6 |
+
Stable tag: 0.7.3
|
| 7 |
|
| 8 |
This plugin will check your posts, custom fields and the blogroll for broken links and missing images and notify you if any are found.
|
| 9 |
|
| 74 |
|
| 75 |
*This is an automatically generated changelog*
|
| 76 |
|
| 77 |
+
= 0.7.3 =
|
| 78 |
+
* Reverted to the old access-checking algorithm + some error suppression.
|
| 79 |
+
|
| 80 |
= 0.7.2 =
|
| 81 |
* Only use the custom access rights detection routine if open\_basedir is set.
|
| 82 |
|
utility-class.php
CHANGED
|
@@ -205,54 +205,6 @@ class blcUtility {
|
|
| 205 |
return $open_basedir && ( strtolower($open_basedir) != 'none' );
|
| 206 |
}
|
| 207 |
|
| 208 |
-
/**
|
| 209 |
-
* blcUtility::is_writable()
|
| 210 |
-
* Check if a file or directory is writable.
|
| 211 |
-
*
|
| 212 |
-
* @param string $path
|
| 213 |
-
* @return bool
|
| 214 |
-
*/
|
| 215 |
-
function is_writable($path){
|
| 216 |
-
//The raison d'etre of this function is that the built-in is_writable() function
|
| 217 |
-
//may behave incorrectly when open_basedir is set. So we check for it and use
|
| 218 |
-
//a custom algorithm if that's the case.
|
| 219 |
-
if ( blcUtility::is_open_basedir() ){
|
| 220 |
-
return blcUtility::_custom_is_writable( $path );
|
| 221 |
-
} else {
|
| 222 |
-
return is_writable($path);
|
| 223 |
-
}
|
| 224 |
-
}
|
| 225 |
-
|
| 226 |
-
/**
|
| 227 |
-
* blcUtility::_custom_is_writable()
|
| 228 |
-
* Check if a file or directory is writable by attempting to actually write to that file or directory.
|
| 229 |
-
*
|
| 230 |
-
* @param string $path
|
| 231 |
-
* @return bool
|
| 232 |
-
*/
|
| 233 |
-
function _custom_is_writable($path){
|
| 234 |
-
//will work in despite of Windows ACLs bug
|
| 235 |
-
//NOTE: use a trailing slash for folders!!!
|
| 236 |
-
//see http://bugs.php.net/bug.php?id=27609
|
| 237 |
-
//see http://bugs.php.net/bug.php?id=30931
|
| 238 |
-
|
| 239 |
-
if ($path{strlen($path) - 1} == '/') // recursively return a temporary file path
|
| 240 |
-
return blcUtility::_custom_is_writable($path . uniqid(mt_rand()) . '.tmp');
|
| 241 |
-
else
|
| 242 |
-
if (@is_dir($path))
|
| 243 |
-
return blcUtility::_custom_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');
|
| 244 |
-
// check tmp file for read/write capabilities
|
| 245 |
-
$rm = @file_exists($path);
|
| 246 |
-
$f = @fopen($path, 'a');
|
| 247 |
-
if ($f === false)
|
| 248 |
-
return false;
|
| 249 |
-
fclose($f);
|
| 250 |
-
if (!$rm)
|
| 251 |
-
unlink($path);
|
| 252 |
-
return true;
|
| 253 |
-
}
|
| 254 |
-
|
| 255 |
-
|
| 256 |
}//class
|
| 257 |
|
| 258 |
}//class_exists
|
| 205 |
return $open_basedir && ( strtolower($open_basedir) != 'none' );
|
| 206 |
}
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
}//class
|
| 209 |
|
| 210 |
}//class_exists
|
