X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=aaa7aa0b9e62161b0cb74f7010d122a60a1d5487;hb=7d0a7f6be9e6c281ddafdfed799bf8b46785424a;hp=3bce492682d16b782863a379aa432111d74e3957;hpb=65f809f5cb0e8c30327e7dca0f54b4ee53cdd6e2;p=friendica.git diff --git a/update.php b/update.php index 3bce492682..aaa7aa0b9e 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ is_valid()) { + if ($ph->is_valid()) { $ph->scaleImage(48); $ph->store($rr['uid'],$rr['contact-id'],$rr['resource-id'],$rr['filename'],$rr['album'],6,(($rr['profile']) ? 1 : 0)); } @@ -308,9 +308,9 @@ function update_1030() { function update_1031() { // Repair any bad links that slipped into the item table $r = q("SELECT `id`, `object` FROM `item` WHERE `object` != '' "); - if($r && dbm::is_result($r)) { + if (dbm::is_result($r)) { foreach ($r as $rr) { - if(strstr($rr['object'],'type="http')) { + if (strstr($rr['object'],'type="http')) { q("UPDATE `item` SET `object` = '%s' WHERE `id` = %d", dbesc(str_replace('type="http','href="http',$rr['object'])), intval($rr['id']) @@ -326,22 +326,23 @@ function update_1032() { function update_1033() { q("CREATE TABLE IF NOT EXISTS `cache` ( - `k` CHAR( 255 ) NOT NULL PRIMARY KEY , - `v` TEXT NOT NULL, - `updated` DATETIME NOT NULL - ) ENGINE = MYISAM DEFAULT CHARSET=utf8 "); + `k` CHAR( 255 ) NOT NULL PRIMARY KEY , + `v` TEXT NOT NULL, + `updated` DATETIME NOT NULL + ) DEFAULT CHARSET=utf8 "); } function update_1034() { - // If you have any of these parent-less posts they can cause problems, and - // we need to delete them. You can't see them anyway. - // Legitimate items will usually get re-created on the next - // pull from the hub. - // But don't get rid of a post that may have just come in - // and may not yet have the parent id set. - + /* + * If you have any of these parent-less posts they can cause problems, and + * we need to delete them. You can't see them anyway. + * Legitimate items will usually get re-created on the next + * pull from the hub. + * But don't get rid of a post that may have just come in + * and may not yet have the parent id set. + */ q("DELETE FROM `item` WHERE `parent` = 0 AND `created` < UTC_TIMESTAMP() - INTERVAL 2 MINUTE"); } @@ -355,7 +356,7 @@ function update_1035() { function update_1036() { - $r = dbq("SELECT * FROM `contact` WHERE `network` = 'dfrn' && `photo` LIKE '%include/photo%' "); + $r = dbq("SELECT * FROM `contact` WHERE `network` = 'dfrn' AND `photo` LIKE '%include/photo%' "); if (dbm::is_result($r)) { foreach ($r as $rr) { q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d", @@ -1651,7 +1652,7 @@ function update_1180() { function update_1188() { - if (strlen(get_config('system','directory_submit_url')) AND + if (strlen(get_config('system','directory_submit_url')) && !strlen(get_config('system','directory'))) { set_config('system','directory', dirname(get_config('system','directory_submit_url'))); del_config('system','directory_submit_url'); @@ -1671,7 +1672,7 @@ function update_1190() { $plugins = get_config('system','addon'); $plugins_arr = array(); - if($plugins) { + if ($plugins) { $plugins_arr = explode(",",str_replace(" ", "",$plugins)); $idx = array_search($plugin, $plugins_arr);