4
« on: July 18, 2012, 07:43:26 PM »
Hier für alle die manuell updaten wollen (von 1.7.10 auf 1.7.11):
details.php
suche nach:
$meta_keywords = !empty($image_row['image_keywords']) ? implode(", ", explode(",", $image_row['image_keywords'])) : "";
ersetze mit:
$meta_keywords = !empty($image_row['image_keywords']) ? strip_tags(implode(", ", explode(",", $image_row['image_keywords']))) : "";
rss.php
suche nach:
function format_rss_html($text) {
$text = format_text(trim($text), 1, 0, 1);
return $text;
}
ersetze mit:
function format_rss_html($text) {
$text = format_text(trim($text), 2, 0, 1);
return $text;
}
admin/categories.php
suche nach:
$cat_parent_id = (isset($HTTP_GET_VARS['cat_parent_id'])) ? $HTTP_GET_VARS['cat_parent_id'] : 0;
ersetze mit:
$cat_parent_id = (isset($HTTP_GET_VARS['cat_parent_id'])) ? intval($HTTP_GET_VARS['cat_parent_id']) : 0;
admin/index.php
suche nach:
if ($redirect != "") {
show_admin_header("<meta http-equiv=\"Refresh\" content=\"0; URL=".$site_sess->url($redirect)."\">");
echo "<p><a href=\"".$site_sess->url($redirect)."\">".$lang['admin_login_redirect']."</a></p>";
show_admin_footer();
exit;
}
ersetze mit:
if ($redirect != "") {
if (strpos($redirect, '://') === false) {
show_admin_header("<meta http-equiv=\"Refresh\" content=\"0; URL=".$site_sess->url($redirect)."\">");
echo "<p><a href=\"".$site_sess->url($redirect)."\">".$lang['admin_login_redirect']."</a></p>";
show_admin_footer();
} else {
redirect('home.php');
}
exit;
}
suche nach:
if ($action == "frames") {
if ($goto != "") {
$framesrc = $site_sess->url($goto);
}
else {
$framesrc = $site_sess->url("home.php");
}
ersetze mit:
if ($action == "frames") {
if ($goto != "" && strpos($goto, '://') === false) {
$framesrc = $site_sess->url($goto);
}
else {
$framesrc = $site_sess->url("home.php");
}
admin/users.php
suche nach:
else {
$activation = 0;
}
ersetzen mit:
else {
if ($config['account_activation'] == 2 && $user_row['user_level'] == USER_AWAITING) {
$activation = 1;
} else {
$activation = 0;
}
}
data/database/default/mysql_default.sql
einfach die Datei aus dem neuen Archiv kopieren.
includes/db_mysql.php
suche nach:
function Db($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
$connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
if (!$this->connection = @$connect_handle($db_host, $db_user, $db_password)) {
$this->error("Could not connect to the database server ($db_host, $db_user).", 1);
}
if ($db_name != "") {
if (!@mysql_select_db($db_name)) {
@mysql_close($this->connection);
$this->error("Could not select database ($db_name).", 1);
}
}
return $this->connection;
}
ersetze mit:
function Db($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
$connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
if (!$this->connection = @$connect_handle($db_host, $db_user, $db_password)) {
$this->error("Could not connect to the database server ($db_host, $db_user).", 1);
}
if ($db_name != "") {
if (!@mysql_select_db($db_name)) {
@mysql_close($this->connection);
$this->error("Could not select database ($db_name).", 1);
}
}
return $this->connection;
}
function escape($value) {
return mysql_real_escape_string($value, $this->connection);
}
includes/functions.php
suche nach:
function check_email($email) {
return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) ? 1 : 0;
}
ersetze mit:
function check_email($email) {
return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,}$/i', $email)) ? 1 : 0;
}
includes/search_utils.php
suche nach:
$word_cache = array();
foreach ($split_words as $word) {
$word_cache[$word] = 1;
$allwords_sql .= ($allwords_sql != "") ? ", '".$word."'" : "'".$word."'";
}
ersetze mit:
$word_cache = array();
foreach ($split_words as $word) {
$word_cache[$word] = 1;
$allwords_sql .= ($allwords_sql != "") ? ", '".addslashes($word)."'" : "'".addslashes($word)."'";
}
suche nach:
$sql = "INSERT INTO ".WORDMATCH_TABLE." (image_id, word_id".$match_insert_key_sql.")
SELECT DISTINCT $image_id, word_id".$match_insert_val_sql."
FROM ".WORDLIST_TABLE."
WHERE word_text = '$key'";
$site_db->query($sql);
ersetze mit:
$sql = "INSERT INTO ".WORDMATCH_TABLE." (image_id, word_id".$match_insert_key_sql.")
SELECT DISTINCT $image_id, word_id".$match_insert_val_sql."
FROM ".WORDLIST_TABLE."
WHERE word_text = '" . addslashes($key) . "'";
$site_db->query($sql);
includes/sessions.php
suche nach:
if (secure_compare($this->read_cookie_data("userpass"), md5($this->user_info['user_password'])) && $this->user_info['user_level'] > USER_AWAITING) {
$this->set_cookie_data("userpass", $this->user_info['user_password']);
}
ersetze mit:
if (secure_compare($this->read_cookie_data("userpass"), md5($this->user_info['user_password'])) && $this->user_info['user_level'] > USER_AWAITING) {
$this->set_cookie_data("userpass", md5($this->user_info['user_password']));
}
Wer will kann noch in der constants.php die Version anpassen, um die Updatemeldung im Adminbereich auszublenden.
So das war es;) Viel Spaß beim updaten.