diff --git a/bundled-libs/serendipity_generateFTPChecksums.php b/bundled-libs/serendipity_generateFTPChecksums.php index 57cdfe137..ea3f94ff5 100644 --- a/bundled-libs/serendipity_generateFTPChecksums.php +++ b/bundled-libs/serendipity_generateFTPChecksums.php @@ -9,10 +9,15 @@ die ("Don't hack!\n"); } +echo "Creating checksums.\n"; + $basedir = realpath(dirname(__FILE__) . '/../') . '/'; require_once $basedir . 'include/functions_installer.inc.php'; require_once $basedir . 'include/functions_images.inc.php'; +$conf = file_get_contents($basedir . 'serendipity_config.inc.php'); +preg_match('@\$serendipity\[\'version\'\]\s*=\s*\'(.+)\'@imsU', $conf, $vmatch); + // Find all the files in the serendipity directory and calculate their md5 sums $sums = array(); $excludes = array( @@ -21,6 +26,7 @@ ); $files = serendipity_traversePath($basedir, '', false); foreach ($files as $fdata) { + echo $fdata['relpath'] . "\n"; // Don't take checksums of directories if ($fdata['directory']) { continue; @@ -48,7 +54,7 @@ if (!$file) { die('Unable to open output file!'); } - fwrite($file, ' $sum) { fwrite($file, "'$fname' => '$sum',\n"); } diff --git a/checksums.inc.php b/checksums.inc.php new file mode 100644 index 000000000..e69de29bb diff --git a/include/admin/upgrader.inc.php b/include/admin/upgrader.inc.php index 309332871..d2e97df51 100644 --- a/include/admin/upgrader.inc.php +++ b/include/admin/upgrader.inc.php @@ -276,7 +276,7 @@ function serendipity_upgraderResultDiagnose($result, $s) { echo serendipity_upgraderResultDiagnose(S9Y_U_SUCCESS, CHECKSUMS_PASS); } else { foreach ($badsums as $rfile => $sum) { - echo serendipity_upgraderResultDiagnose(S9Y_U_ERROR, sprintf(CHECKSUM_FAILED, $rfile)); + echo serendipity_upgraderResultDiagnose(S9Y_U_WARNING, sprintf(CHECKSUM_FAILED, $rfile)) . "
\n"; } } ?> diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index c8ec467b0..410a9abe4 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -887,6 +887,9 @@ function serendipity_getSessionLanguage() { return $serendipity['lang']; } */ + if (isset($serendipity['lang']) && !isset($serendipity['languages'][$serendipity['lang']])) { + $serendipity['lang'] = $serendipity['autolang']; + } if (isset($_REQUEST['user_language']) && (!empty($serendipity['languages'][$_REQUEST['user_language']])) && !headers_sent()) { serendipity_setCookie('serendipityLanguage', $_REQUEST['user_language'], false); diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index bb3987f41..3b7cb14ed 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -1273,12 +1273,26 @@ function serendipity_FTPChecksum($filename, $type = null) { * relative path of the file, and values are the bad checksum */ function serendipity_verifyFTPChecksums() { + global $serendipity; + + $badsums = array(); + // Load the checksums - require_once S9Y_INCLUDE_PATH . 'checksums.inc.php'; + $f = S9Y_INCLUDE_PATH . 'checksums.inc.php'; + + if (!file_exists($f) || filesize($f) < 1) { + return $badsums; + } + + require_once $f; // Verify that every file in the checksum list was uploaded correctly - $badsums = array(); $basedir = realpath(dirname(__FILE__) . '/../'); - foreach ($serendipity['checksums'] as $prel => $sum) { + + if (!is_array($serendipity['checksums_' . $serendipity['version']])) { + return $badsums; + } + + foreach ($serendipity['checksums_' . $serendipity['version']] as $prel => $sum) { $path = $basedir . '/' . $prel; // Don't take checksums of directories if (is_dir($path)) { diff --git a/include/lang.inc.php b/include/lang.inc.php index 6f13822e3..14ab6b440 100644 --- a/include/lang.inc.php +++ b/include/lang.inc.php @@ -6,6 +6,10 @@ die ("Don't hack!"); } +if (isset($serendipity['lang']) && !isset($serendipity['languages'][$serendipity['lang']])) { + $serendipity['lang'] = $serendipity['autolang']; +} + if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) { $charset = serendipity_getCharset(); @@ -21,6 +25,7 @@ } // Try and include preferred language from the configurated setting + if (@include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) { // Only here can we truely say the language is loaded define('serendipity_LANG_LOADED', true);