From cbeff9243a3c4df0f56984ca10ed8680afc865f4 Mon Sep 17 00:00:00 2001 From: rurban Date: Sun, 7 Jan 2007 18:41:42 +0000 Subject: [PATCH] Add array_diff_assoc() fallback: fixes Blog with php < 4.3.x. Support UPLOAD_FILE_PATH, UPLOAD_DATA_PATH overrides. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@5435 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/config.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/config.php b/lib/config.php index 9b1023ce6..057c50b5c 100644 --- a/lib/config.php +++ b/lib/config.php @@ -1,5 +1,5 @@ "green", "b" => "brown", "c" => "blue"); + * $array2 = array("a" => "green", "y" => "yellow", "r" => "red"); + * => b => brown, c => blue + */ +if (!function_exists('array_diff_assoc')) { + function array_diff_assoc($a1, $a2) { + $result = array(); + foreach ($a1 as $k => $v) { + if (!isset($a2[$k]) or !$a2[$k]) + $result[$k] = $v; + } + return $result; + } +} + /** * wordwrap() might crash between 4.1.2 and php-4.3.0RC2, fixed in 4.3.0 * See http://bugs.php.net/bug.php?id=20927 and @@ -554,12 +574,14 @@ function safe_wordwrap($str, $width=80, $break="\n", $cut=false) { } function getUploadFilePath() { + if (defined('UPLOAD_FILE_PATH')) return UPLOAD_FILE_PATH; return defined('PHPWIKI_DIR') ? PHPWIKI_DIR . "/uploads/" : realpath(dirname(__FILE__) . "/../uploads/"); } function getUploadDataPath() { - return SERVER_URL . ((substr(DATA_PATH,0,1)=='/') ? '' : "/") . DATA_PATH . '/uploads/'; + if (defined('UPLOAD_DATA_PATH')) return UPLOAD_DATA_PATH; + return SERVER_URL . ((substr(DATA_PATH,0,1)=='/') ? '' : "/") . DATA_PATH . '/uploads/'; } /** @@ -590,6 +612,9 @@ function htmlspecialchars_workaround($str, $quote=ENT_COMPAT, $charset='iso-8859 */ // $Log: not supported by cvs2svn $ +// Revision 1.140 2007/01/02 13:21:30 rurban +// added _DEBUG_REMOTE flag, omit want_content if not necessary +// // Revision 1.139 2006/03/19 14:50:42 rurban // sf.net patch #1438442 by Matt Brown: Unitialised variable reference in config.php // -- 2.45.0