vsprintf error on update

This commit is contained in:
friendica 2014-02-20 02:30:37 -08:00
parent d8434bb480
commit 4944070e79
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
if($a->poi) {
$xchan = $a->poi;
}
elseif($a->profile['channel_hash']) {
elseif(is_array($a->profile) && $a->profile['channel_hash']) {
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($a->profile['channel_hash'])
);
@ -114,7 +114,7 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
return replace_macros(get_markup_template('xchan_vcard.tpl'),array(
'$name' => $xchan['xchan_name'],
'$photo' => ((array_key_exists('photo',$a->profile)) ? $a->profile['photo'] : $xchan['xchan_photo_l']),
'$photo' => ((is_array($a->profile) && array_key_exists('photo',$a->profile)) ? $a->profile['photo'] : $xchan['xchan_photo_l']),
'$follow' => $xchan['xchan_addr'],
'$connect' => $connect,
'$newwin' => (($mode === 'chanview') ? t('New window') : ''),

View File

@ -1088,7 +1088,7 @@ function update_r1097() {
// fix some mangled hublocs from a bug long ago
$r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%/%'");
$r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'");
if($r) {
foreach($r as $rr) {
q("update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1",