From: Brion Vibber Date: Wed, 17 Mar 2010 19:15:12 +0000 (-0700) Subject: Merge branch 'master' into testing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ca5612c451e4dabde107ff2cfbc737a2f69136df;hp=22f827134c3be845494bebd76bda9e4a074e710b;p=quix0rs-gnu-social.git Merge branch 'master' into testing --- diff --git a/classes/Subscription.php b/classes/Subscription.php index 9cef2df1ad..5ac95f9222 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -105,8 +105,8 @@ class Subscription extends Memcached_DataObject $auto = new Subscription(); - $auto->subscriber = $subscriber->id; - $auto->subscribed = $other->id; + $auto->subscriber = $other->id; + $auto->subscribed = $subscriber->id; $auto->created = common_sql_now(); $result = $auto->insert(); diff --git a/scripts/fixup_files.php b/scripts/fixup_files.php new file mode 100755 index 0000000000..18feaf2218 --- /dev/null +++ b/scripts/fixup_files.php @@ -0,0 +1,77 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$longoptions = array('dry-run'); + +$helptext = <<title = 'h'; +$f->mimetype = 'h'; +$f->size = 0; +$f->protected = 0; +$f->find(); +echo "Found $f->N bad items:\n"; + +while ($f->fetch()) { + echo "$f->id $f->url"; + + $data = File_redirection::lookupWhere($f->url); + if ($dry) { + if (is_array($data)) { + echo " (unchanged)\n"; + } else { + echo " (unchanged, but embedding lookup failed)\n"; + } + } else { + // NULL out the mime/title/size/protected fields + $sql = sprintf("UPDATE file " . + "SET mimetype=null,title=null,size=null,protected=null " . + "WHERE id=%d", + $f->id); + $f->query($sql); + $f->decache(); + + if (is_array($data)) { + if ($f->saveOembed($data, $f->url)) { + echo " (ok)\n"; + } else { + echo " (ok, no embedding data)\n"; + } + } else { + echo " (ok, but embedding lookup failed)\n"; + } + } +} + +echo "done.\n"; +