fixed some errors occuring in Apache error log - thx laborix

This commit is contained in:
azett 2022-10-09 15:09:55 +02:00
parent 36b3e50006
commit 1b9022c5f6
3 changed files with 102 additions and 118 deletions

View File

@ -28,7 +28,7 @@
{/if} {/if}
<input type="text" class="{$class}" <input type="text" class="{$class}"
name="subject" id="subject" name="subject" id="subject"
value="{$subject|default:$smarty.request.subject|wp_specialchars:1}" /><br /> value="{$subject|default:{$smarty.request.subject|default:''}|wp_specialchars:1}" /><br />
<input type="hidden" name="timestamp" value="{$date}" /> <input type="hidden" name="timestamp" value="{$date}" />
<input type="hidden" name="entry" value="{$id}" /> <input type="hidden" name="entry" value="{$id}" />
</p> </p>
@ -40,7 +40,7 @@
{/if} {/if}
<p> <p>
<textarea name="content" class="{$class}" <textarea name="content" class="{$class}"
id="content" rows="20" cols="74">{$content|default:$smarty.request.content|htmlspecialchars}</textarea><br /> id="content" rows="20" cols="74">{$content|default:{$smarty.request.content|default:''}|htmlspecialchars}</textarea><br />
{*here will go a plugin hook*} {*here will go a plugin hook*}
{action hook=simple_edit_form} {action hook=simple_edit_form}

View File

@ -177,7 +177,7 @@ function smarty_block_draft($params, $content, &$smarty, &$repeat) {
'version' => '', 'version' => '',
'id' => '' 'id' => ''
)); ));
$arr = & $smarty->getTemplateVars('draft_list'); $arr = $smarty->getTemplateVars('draft_list');
$id = $subject = null; $id = $subject = null;
if ($arr) { if ($arr) {

View File

@ -1,13 +1,11 @@
<?php <?php
function lang_load($postfix = null) { function lang_load($postfix = null) {
global $fp_config; global $fp_config;
$pluginpath = ''; $pluginpath = '';
// checks if we already loaded this lang file // checks if we already loaded this lang file
$vals = explode('.', $postfix); // my.file.name ---> my, file, name
$old_lang = &$GLOBALS ['lang']; $old_lang = &$GLOBALS ['lang'];
if (!$old_lang) if (!$old_lang)
@ -20,22 +18,18 @@
} }
$file = "lang.$postfix.php"; $file = "lang.$postfix.php";
} else { } else {
$postfix = 'default'; $postfix = 'default';
$file = "lang.default.php"; $file = "lang.default.php";
} }
$fpath = LANG_DIR . "{$fp_config['locale']['lang']}/$file"; $fpath = LANG_DIR . "{$fp_config['locale']['lang']}/$file";
$fallback = LANG_DIR . LANG_DEFAULT . "/$file"; $fallback = LANG_DIR . LANG_DEFAULT . "/$file";
$path = ''; $path = '';
$plugin = $pluginpath; $plugin = $pluginpath;
if ($pluginpath) { if ($pluginpath) {
if (($n = strpos($pluginpath, '/')) !== false) { if (($n = strpos($pluginpath, '/')) !== false) {
$plugin = substr($plugin, 0, $n - 1); $plugin = substr($plugin, 0, $n - 1);
@ -47,7 +41,6 @@
$fpath = $dir . "lang/lang.{$fp_config['locale']['lang']}{$path}.php"; $fpath = $dir . "lang/lang.{$fp_config['locale']['lang']}{$path}.php";
$fallback = $dir . "lang/lang." . LANG_DEFAULT . "{$path}.php"; $fallback = $dir . "lang/lang." . LANG_DEFAULT . "{$path}.php";
} }
if (!file_exists($fpath)) { if (!file_exists($fpath)) {
@ -58,7 +51,6 @@
} }
$fpath = $fallback; $fpath = $fallback;
} }
/* load $lang from file */ /* load $lang from file */
@ -72,19 +64,15 @@
include_once ($fpath); include_once ($fpath);
if (!isset($lang)) { if (!isset($lang)) {
return $GLOBALS ['lang']; return $GLOBALS ['lang'];
} }
ob_end_clean(); ob_end_clean();
$GLOBALS ['lang'] = array_merge_recursive($lang, $old_lang); $GLOBALS ['lang'] = array_merge_recursive($lang, $old_lang);
return $GLOBALS ['lang']; return $GLOBALS ['lang'];
} }
function lang_getconf($id) { function lang_getconf($id) {
@ -98,21 +86,18 @@
trigger_error("Error loading config for language \"$file\"", E_USER_WARNING); trigger_error("Error loading config for language \"$file\"", E_USER_WARNING);
} }
class lang_indexer extends fs_filelister { class lang_indexer extends fs_filelister {
var $_directory = LANG_DIR; var $_directory = LANG_DIR;
function _checkFile($directory, $file) { function _checkFile($directory, $file) {
if (is_dir("$directory/$file")) { if (is_dir("$directory/$file")) {
if (!preg_match('![a-z]{2}-[a-z]{2}!', $file)) return 0; if (!preg_match('![a-z]{2}-[a-z]{2}!', $file))
return 0;
$this->_list [$file] = lang_getconf($file); $this->_list [$file] = lang_getconf($file);
} }
return 0; return 0;
} }
} }
@ -122,5 +107,4 @@
return $obj->getList(); return $obj->getList();
} }
?> ?>