From d13454fb84061357681e600762b470c9fc257f04 Mon Sep 17 00:00:00 2001
From: Akio Nishimura
Date: Thu, 21 Jan 2016 08:10:35 +0900
Subject: [PATCH 001/415] Now we can delete a group logo.
---
actions/grouplogo.php | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/actions/grouplogo.php b/actions/grouplogo.php
index 0d9c135785..e3906847d3 100644
--- a/actions/grouplogo.php
+++ b/actions/grouplogo.php
@@ -211,6 +211,10 @@ class GrouplogoAction extends GroupAction
'height' => AVATAR_PROFILE_SIZE,
'alt' => $this->group->nickname));
$this->elementEnd('div');
+ if (!empty($this->group->homepage_logo)) {
+ // TRANS: Button on group logo upload page to delete current group logo.
+ $this->submit('delete', _('Delete'));
+ }
$this->elementEnd('li');
}
@@ -315,6 +319,8 @@ class GrouplogoAction extends GroupAction
$this->uploadLogo();
} else if ($this->arg('crop')) {
$this->cropLogo();
+ } else if ($this->arg('delete')) {
+ $this->deleteLogo();
} else {
// TRANS: Form validation error message when an unsupported argument is used.
$this->showForm(_('Unexpected form submission.'));
@@ -409,6 +415,29 @@ class GrouplogoAction extends GroupAction
}
}
+ /**
+ * Get rid of the current group logo.
+ *
+ * @return void
+ */
+ function deleteLogo()
+ {
+ $orig = clone($this->group);
+ Avatar::deleteFromProfile($this->group->getProfile());
+ @unlink(Avatar::path(basename($this->group->original_logo)));
+ @unlink(Avatar::path(basename($this->group->homepage_logo)));
+ @unlink(Avatar::path(basename($this->group->stream_logo)));
+ @unlink(Avatar::path(basename($this->group->mini_logo)));
+ $this->group->original_logo=User_group::defaultLogo(AVATAR_PROFILE_SIZE);
+ $this->group->homepage_logo=User_group::defaultLogo(AVATAR_PROFILE_SIZE);
+ $this->group->stream_logo=User_group::defaultLogo(AVATAR_STREAM_SIZE);
+ $this->group->mini_logo=User_group::defaultLogo(AVATAR_MINI_SIZE);
+ $this->group->update($orig);
+
+ // TRANS: Success message for deleting the group logo.
+ $this->showForm(_('Logo deleted.'));
+ }
+
function showPageNotice()
{
if ($this->msg) {
From efd2326a29ab4ec723b4d8882c45eb70d341e1b5 Mon Sep 17 00:00:00 2001
From: hannes
Date: Fri, 29 Jan 2016 00:34:32 +0000
Subject: [PATCH 002/415] the last url in the redirection chain can actually
also be a redirection (e.g. if it's one of our /attachment/{file_id} links)
---
classes/File_redirection.php | 88 ++++++++++++++++++++++--------------
1 file changed, 55 insertions(+), 33 deletions(-)
diff --git a/classes/File_redirection.php b/classes/File_redirection.php
index 9b872f3556..32c9cc7a3a 100644
--- a/classes/File_redirection.php
+++ b/classes/File_redirection.php
@@ -170,56 +170,78 @@ class File_redirection extends Managed_DataObject
try {
$r = File_redirection::getByUrl($in_url);
- if($r instanceof File_redirection) {
- try {
- $f = File::getKV('id',$r->file_id);
- $r->file = $f;
- $r->redir_url = $f->url;
- } catch (NoResultException $e) {
- // Invalid entry, delete and run again
- common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and creating new File and File_redirection entries.");
- $r->delete();
- return self::where($in_url);
- }
- return $r;
+ try {
+ $f = File::getKV('id',$r->file_id);
+ $r->file = $f;
+ $r->redir_url = $f->url;
+ } catch (NoResultException $e) {
+ // Invalid entry, delete and run again
+ common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and and trying again...");
+ $r->delete();
+ return self::where($in_url);
}
+ // File_redirecion and File record found, return both
+ return $r;
+
} catch (NoResultException $e) {
+ // File_redirecion record not found, but this might be a direct link to a file
try {
$f = File::getByUrl($in_url);
$redir->file_id = $f->id;
$redir->file = $f;
return $redir;
} catch (NoResultException $e) {
- // Oh well, let's keep going
+ // nope, this was not a direct link to a file either, let's keep going
}
}
if ($discover) {
+ // try to follow redirects and get the final url
$redir_info = File_redirection::lookupWhere($in_url);
if(is_string($redir_info)) {
$redir_info = array('url' => $redir_info);
}
-
- // Save the file if we don't have it already
- $redir->file = File::saveNew($redir_info,$redir_info['url']);
-
- // If this is a redirection, save it
- // (if it hasn't been saved yet by some other process while we we
- // were running lookupWhere())
- if($redir_info['url'] != $in_url) {
- try {
- $file_redir = File_redirection::getByUrl($in_url);
- } catch (NoResultException $e) {
- $file_redir = new File_redirection();
- $file_redir->urlhash = File::hashurl($in_url);
- $file_redir->url = $in_url;
- $file_redir->file_id = $redir->file->getID();
- $file_redir->insert();
- $file_redir->redir_url = $redir->file->url;
- }
+
+ // the last url in the redirection chain can actually be a redirect!
+ // this is the case with local /attachment/{file_id} links
+ // in that case we have the file id already
+ try {
+ $r = File_redirection::getByUrl($redir_info['url']);
+ try {
+ $f = File::getKV('id',$r->file_id);
+ $redir->file = $f;
+ $redir->redir_url = $f->url;
+ } catch (NoResultException $e) {
+ // Invalid entry in File_redirection, delete and run again
+ common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File_redirection entry and trying again...");
+ $r->delete();
+ return self::where($in_url);
+ }
+ } catch (NoResultException $e) {
+ // save the file now when we know that we don't have it in File_redirection
+ try {
+ $redir->file = File::saveNew($redir_info,$redir_info['url']);
+ } catch (ServerException $e) {
+ common_log(LOG_ERR, $e);
+ }
+ }
+
+ // If this is a redirection and we have a file to redirect to, save it
+ // (if it doesn't exist in File_redirection already)
+ if($redir->file instanceof File && $redir_info['url'] != $in_url) {
+ try {
+ $file_redir = File_redirection::getByUrl($in_url);
+ } catch (NoResultException $e) {
+ $file_redir = new File_redirection();
+ $file_redir->urlhash = File::hashurl($in_url);
+ $file_redir->url = $in_url;
+ $file_redir->file_id = $redir->file->getID();
+ $file_redir->insert();
+ $file_redir->redir_url = $redir->file->url;
+ }
- $file_redir->file = $redir->file;
- return $file_redir;
+ $file_redir->file = $redir->file;
+ return $file_redir;
}
}
From f708a5b016d518b186eb0d4682152d81cb0c607c Mon Sep 17 00:00:00 2001
From: hannes
Date: Fri, 29 Jan 2016 00:36:30 +0000
Subject: [PATCH 003/415] Never save our /attachment/{file_id} links as links
in the file table, return the old file
---
classes/File.php | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/classes/File.php b/classes/File.php
index 6cad978a70..428eb9f285 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -106,6 +106,19 @@ class File extends Managed_DataObject
// We don't have the file's URL since before, so let's continue.
}
+ // if the given url is an local attachment url and the id already exists, don't
+ // save a new file record. This should never happen, but let's make it foolproof
+ $attachment_path = common_path('attachment/');
+ if(strpos($given_url,$attachment_path) == 0) {
+ $possible_file_id = substr($given_url,strlen($attachment_path));
+ if(is_numeric($possible_file_id)) {
+ $file = File::getKV('id',$possible_file_id);
+ if($file instanceof File) {
+ return $file;
+ }
+ }
+ }
+
$file = new File;
$file->url = $given_url;
if (!empty($redir_data['protected'])) $file->protected = $redir_data['protected'];
From 7aca4e7463f40dc267e5bb505a9c3dcf5b784258 Mon Sep 17 00:00:00 2001
From: Chimo
Date: Thu, 4 Feb 2016 15:20:37 +0000
Subject: [PATCH 004/415] CONFIGURE: Replace short urls with their target
Transparency and resilience against shorteners going away.
---
CONFIGURE | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/CONFIGURE b/CONFIGURE
index d0b6a24484..b1141fa69e 100644
--- a/CONFIGURE
+++ b/CONFIGURE
@@ -116,8 +116,9 @@ db
--
This section is a reference to the configuration options for
-DB_DataObject (see ). The ones that you may want to
-set are listed below for clarity.
+DB_DataObject (see
+).
+The ones that you may want to set are listed below for clarity.
database: a DSN (Data Source Name) for your StatusNet database. This is
in the format 'protocol://username:password@hostname/databasename',
@@ -318,8 +319,8 @@ server: If set, defines another server where avatars are stored in the
the client to speed up page loading, either with another
virtual server or with an NFS or SAMBA share. Clients
typically only make 2 connections to a single server at a
- time , so this can parallelize the job.
- Defaults to null.
+ time ,
+ so this can parallelize the job. Defaults to null.
ssl: Whether to access avatars using HTTPS. Defaults to null, meaning
to guess based on site-wide SSL settings.
@@ -686,7 +687,7 @@ Web crawlers. See http://www.robotstxt.org/ for more information
on the format of this file.
crawldelay: if non-empty, this value is provided as the Crawl-Delay:
- for the robots.txt file. see http://ur1.ca/l5a0
+ for the robots.txt file. see https://help.yahoo.com/kb/search
for more information. Default is zero, no explicit delay.
disallow: Array of (virtual) directories to disallow. Default is 'main',
'search', 'message', 'settings', 'admin'. Ignored when site
From 2c5cba28b6a8e13a58fe7584835340aa9779b146 Mon Sep 17 00:00:00 2001
From: Chimo
Date: Fri, 22 Jan 2016 16:38:42 +0000
Subject: [PATCH 005/415] Change status.net/wiki URLs to git.gnu.io
---
plugins/AccountManager/AccountManagerPlugin.php | 2 +-
plugins/Activity/ActivityPlugin.php | 2 +-
plugins/ActivitySpam/ActivitySpamPlugin.php | 2 +-
plugins/AnonymousFave/AnonymousFavePlugin.php | 2 +-
plugins/ApiLogger/ApiLoggerPlugin.php | 2 +-
plugins/AuthCrypt/AuthCryptPlugin.php | 2 +-
plugins/AutoSandbox/AutoSandboxPlugin.php | 2 +-
plugins/Autocomplete/AutocompletePlugin.php | 2 +-
plugins/Awesomeness/AwesomenessPlugin.php | 2 +-
plugins/BitlyUrl/BitlyUrlPlugin.php | 2 +-
plugins/Blacklist/BlacklistPlugin.php | 2 +-
plugins/BlankAd/BlankAdPlugin.php | 2 +-
plugins/BlogspamNet/BlogspamNetPlugin.php | 2 +-
plugins/CacheLog/CacheLogPlugin.php | 2 +-
plugins/CasAuthentication/CasAuthenticationPlugin.php | 2 +-
plugins/ClientSideShorten/ClientSideShortenPlugin.php | 2 +-
plugins/Comet/CometPlugin.php | 2 +-
plugins/DirectionDetector/DirectionDetectorPlugin.php | 2 +-
plugins/Directory/DirectoryPlugin.php | 2 +-
plugins/DiskCache/DiskCachePlugin.php | 2 +-
plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php | 2 +-
plugins/DomainWhitelist/DomainWhitelistPlugin.php | 2 +-
plugins/EmailAuthentication/EmailAuthenticationPlugin.php | 2 +-
plugins/EmailRegistration/EmailRegistrationPlugin.php | 2 +-
plugins/EmailReminder/EmailReminderPlugin.php | 2 +-
plugins/EmailSummary/EmailSummaryPlugin.php | 2 +-
plugins/Event/EventPlugin.php | 2 +-
plugins/ExtendedProfile/ExtendedProfilePlugin.php | 2 +-
plugins/FacebookBridge/FacebookBridgePlugin.php | 2 +-
plugins/FollowEveryone/FollowEveryonePlugin.php | 2 +-
plugins/ForceGroup/ForceGroupPlugin.php | 2 +-
plugins/GeoURL/GeoURLPlugin.php | 2 +-
plugins/Geonames/GeonamesPlugin.php | 2 +-
plugins/GroupFavorited/GroupFavoritedPlugin.php | 2 +-
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php | 2 +-
plugins/Imap/ImapPlugin.php | 2 +-
plugins/InProcessCache/InProcessCachePlugin.php | 2 +-
plugins/InfiniteScroll/InfiniteScrollPlugin.php | 2 +-
plugins/LdapAuthentication/LdapAuthenticationPlugin.php | 2 +-
plugins/LdapAuthorization/LdapAuthorizationPlugin.php | 2 +-
plugins/LilUrl/LilUrlPlugin.php | 2 +-
plugins/LinkPreview/LinkPreviewPlugin.php | 2 +-
plugins/Linkback/LinkbackPlugin.php | 2 +-
plugins/LogFilter/LogFilterPlugin.php | 2 +-
plugins/Mapstraction/MapstractionPlugin.php | 2 +-
plugins/Memcache/MemcachePlugin.php | 2 +-
plugins/Memcached/MemcachedPlugin.php | 2 +-
plugins/Meteor/MeteorPlugin.php | 2 +-
plugins/Minify/MinifyPlugin.php | 2 +-
plugins/MobileProfile/MobileProfilePlugin.php | 2 +-
plugins/ModHelper/ModHelperPlugin.php | 2 +-
plugins/ModLog/ModLogPlugin.php | 2 +-
plugins/ModPlus/ModPlusPlugin.php | 2 +-
plugins/NoticeTitle/NoticeTitlePlugin.php | 2 +-
plugins/OStatus/OStatusPlugin.php | 2 +-
plugins/OfflineBackup/OfflineBackupPlugin.php | 2 +-
plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php | 2 +-
plugins/OpenID/OpenIDPlugin.php | 2 +-
plugins/OpenX/OpenXPlugin.php | 2 +-
plugins/Orbited/OrbitedPlugin.php | 2 +-
plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php | 2 +-
plugins/Poll/PollPlugin.php | 2 +-
plugins/PostDebug/PostDebugPlugin.php | 2 +-
plugins/PtitUrl/PtitUrlPlugin.php | 2 +-
plugins/QnA/QnAPlugin.php | 2 +-
plugins/RSSCloud/RSSCloudPlugin.php | 2 +-
plugins/Recaptcha/RecaptchaPlugin.php | 2 +-
plugins/RegisterThrottle/RegisterThrottlePlugin.php | 2 +-
plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php | 2 +-
.../ReverseUsernameAuthenticationPlugin.php | 2 +-
plugins/SQLProfile/SQLProfilePlugin.php | 2 +-
plugins/SQLStats/SQLStatsPlugin.php | 2 +-
plugins/Sample/SamplePlugin.php | 2 +-
plugins/SearchSub/SearchSubPlugin.php | 2 +-
plugins/ShareNotice/ShareNoticePlugin.php | 2 +-
plugins/SimpleUrl/SimpleUrlPlugin.php | 2 +-
plugins/Sitemap/SitemapPlugin.php | 2 +-
plugins/SlicedFavorites/SlicedFavoritesPlugin.php | 2 +-
plugins/SphinxSearch/SphinxSearchPlugin.php | 2 +-
.../StrictTransportSecurity/StrictTransportSecurityPlugin.php | 2 +-
plugins/SubMirror/SubMirrorPlugin.php | 2 +-
plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php | 2 +-
plugins/TabFocus/TabFocusPlugin.php | 2 +-
plugins/TagSub/TagSubPlugin.php | 2 +-
plugins/TightUrl/TightUrlPlugin.php | 2 +-
plugins/TwitterBridge/TwitterBridgePlugin.php | 2 +-
plugins/UserFlag/UserFlagPlugin.php | 2 +-
plugins/UserLimit/UserLimitPlugin.php | 2 +-
plugins/WikiHashtags/WikiHashtagsPlugin.php | 2 +-
plugins/WikiHowProfile/WikiHowProfilePlugin.php | 2 +-
plugins/Xmpp/XmppPlugin.php | 2 +-
91 files changed, 91 insertions(+), 91 deletions(-)
diff --git a/plugins/AccountManager/AccountManagerPlugin.php b/plugins/AccountManager/AccountManagerPlugin.php
index 768f71510f..429e9d4e5e 100644
--- a/plugins/AccountManager/AccountManagerPlugin.php
+++ b/plugins/AccountManager/AccountManagerPlugin.php
@@ -92,7 +92,7 @@ class AccountManagerPlugin extends Plugin
$versions[] = array('name' => 'AccountManager',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:AccountManager',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/AccountManager',
'rawdescription' =>
// TRANS: Plugin description.
_m('The Account Manager plugin implements the Account Manager specification.'));
diff --git a/plugins/Activity/ActivityPlugin.php b/plugins/Activity/ActivityPlugin.php
index 6805b4fe07..0f306a427c 100644
--- a/plugins/Activity/ActivityPlugin.php
+++ b/plugins/Activity/ActivityPlugin.php
@@ -344,7 +344,7 @@ class ActivityPlugin extends Plugin
$versions[] = array('name' => 'Activity',
'version' => self::VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Activity',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Activity',
'rawdescription' =>
// TRANS: Plugin description.
_m('Emits notices when social activities happen.'));
diff --git a/plugins/ActivitySpam/ActivitySpamPlugin.php b/plugins/ActivitySpam/ActivitySpamPlugin.php
index 9d61b2dddd..d63d64c718 100644
--- a/plugins/ActivitySpam/ActivitySpamPlugin.php
+++ b/plugins/ActivitySpam/ActivitySpamPlugin.php
@@ -220,7 +220,7 @@ class ActivitySpamPlugin extends Plugin
$versions[] = array('name' => 'ActivitySpam',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:ActivitySpam',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ActivitySpam',
'description' =>
_m('Test notices against the Activity Spam service.'));
return true;
diff --git a/plugins/AnonymousFave/AnonymousFavePlugin.php b/plugins/AnonymousFave/AnonymousFavePlugin.php
index 841b652401..ca4bdc832f 100644
--- a/plugins/AnonymousFave/AnonymousFavePlugin.php
+++ b/plugins/AnonymousFave/AnonymousFavePlugin.php
@@ -273,7 +273,7 @@ class AnonymousFavePlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:AnonymousFave';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/AnonymousFave';
$versions[] = array('name' => 'AnonymousFave',
'version' => ANONYMOUS_FAVE_PLUGIN_VERSION,
diff --git a/plugins/ApiLogger/ApiLoggerPlugin.php b/plugins/ApiLogger/ApiLoggerPlugin.php
index 920009de5a..3877c464f0 100644
--- a/plugins/ApiLogger/ApiLoggerPlugin.php
+++ b/plugins/ApiLogger/ApiLoggerPlugin.php
@@ -80,7 +80,7 @@ class ApiLoggerPlugin extends Plugin
$versions[] = array('name' => 'ApiLogger',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:ApiLogger',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ApiLogger',
'rawdescription' =>
// TRANS: Plugin description.
_m('Allows random sampling of API requests.'));
diff --git a/plugins/AuthCrypt/AuthCryptPlugin.php b/plugins/AuthCrypt/AuthCryptPlugin.php
index 540019f9c2..62019aa015 100644
--- a/plugins/AuthCrypt/AuthCryptPlugin.php
+++ b/plugins/AuthCrypt/AuthCryptPlugin.php
@@ -155,7 +155,7 @@ class AuthCryptPlugin extends AuthenticationPlugin
$versions[] = array('name' => 'AuthCrypt',
'version' => GNUSOCIAL_VERSION,
'author' => 'Mikael Nordfeldth',
- 'homepage' => 'http://status.net/wiki/Plugin:AuthCrypt',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/AuthCrypt',
'rawdescription' =>
// TRANS: Plugin description.
_m('Authentication and password hashing with crypt()'));
diff --git a/plugins/AutoSandbox/AutoSandboxPlugin.php b/plugins/AutoSandbox/AutoSandboxPlugin.php
index e914977cc9..706523564a 100644
--- a/plugins/AutoSandbox/AutoSandboxPlugin.php
+++ b/plugins/AutoSandbox/AutoSandboxPlugin.php
@@ -61,7 +61,7 @@ class AutoSandboxPlugin extends Plugin
$versions[] = array('name' => 'AutoSandbox',
'version' => GNUSOCIAL_VERSION,
'author' => 'Sean Carmody',
- 'homepage' => 'http://status.net/wiki/Plugin:AutoSandbox',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/AutoSandbox',
'rawdescription' =>
// TRANS: Plugin description.
_m('Automatically sandboxes newly registered members.'));
diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php
index 0f0c2592c2..55bdb8894a 100644
--- a/plugins/Autocomplete/AutocompletePlugin.php
+++ b/plugins/Autocomplete/AutocompletePlugin.php
@@ -57,7 +57,7 @@ class AutocompletePlugin extends Plugin
$versions[] = array('name' => 'Autocomplete',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:Autocomplete',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Autocomplete',
'rawdescription' =>
// TRANS: Plugin description.
_m('The autocomplete plugin adds autocompletion for @ replies.'));
diff --git a/plugins/Awesomeness/AwesomenessPlugin.php b/plugins/Awesomeness/AwesomenessPlugin.php
index ca3b281df6..fff833d4ee 100644
--- a/plugins/Awesomeness/AwesomenessPlugin.php
+++ b/plugins/Awesomeness/AwesomenessPlugin.php
@@ -50,7 +50,7 @@ class AwesomenessPlugin extends Plugin
'name' => 'Awesomeness',
'version' => self::VERSION,
'author' => 'Jeroen De Dauw',
- 'homepage' => 'http://status.net/wiki/Plugin:Awesomeness',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Awesomeness',
// TRANS: Plugin description for a sample plugin.
'rawdescription' => _m('The Awesomeness plugin adds additional awesomeness ' .
'to a StatusNet installation.'
diff --git a/plugins/BitlyUrl/BitlyUrlPlugin.php b/plugins/BitlyUrl/BitlyUrlPlugin.php
index 13a1bf2ec4..079a06a3e7 100644
--- a/plugins/BitlyUrl/BitlyUrlPlugin.php
+++ b/plugins/BitlyUrl/BitlyUrlPlugin.php
@@ -150,7 +150,7 @@ class BitlyUrlPlugin extends UrlShortenerPlugin
$versions[] = array('name' => sprintf('BitlyUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews, Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:BitlyUrl',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/BitlyUrl',
'rawdescription' =>
// TRANS: Plugin description. %1$s is the URL shortening service base URL (for example "bit.ly").
sprintf(_m('Uses %1$s URL-shortener service.'),
diff --git a/plugins/Blacklist/BlacklistPlugin.php b/plugins/Blacklist/BlacklistPlugin.php
index bad89f2457..31929fcadc 100644
--- a/plugins/Blacklist/BlacklistPlugin.php
+++ b/plugins/Blacklist/BlacklistPlugin.php
@@ -297,7 +297,7 @@ class BlacklistPlugin extends Plugin
'version' => self::VERSION,
'author' => 'Evan Prodromou',
'homepage' =>
- 'http://status.net/wiki/Plugin:Blacklist',
+ 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Blacklist',
'description' =>
// TRANS: Plugin description.
_m('Keeps a blacklist of forbidden nickname '.
diff --git a/plugins/BlankAd/BlankAdPlugin.php b/plugins/BlankAd/BlankAdPlugin.php
index b5cd968c7f..fbcf70bb03 100644
--- a/plugins/BlankAd/BlankAdPlugin.php
+++ b/plugins/BlankAd/BlankAdPlugin.php
@@ -122,7 +122,7 @@ class BlankAdPlugin extends UAPPlugin
$versions[] = array('name' => 'BlankAd',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:BlankAdPlugin',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/BlankAdPlugin',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin for testing ad layout.'));
diff --git a/plugins/BlogspamNet/BlogspamNetPlugin.php b/plugins/BlogspamNet/BlogspamNetPlugin.php
index 2cab69be30..30e9cffe16 100644
--- a/plugins/BlogspamNet/BlogspamNetPlugin.php
+++ b/plugins/BlogspamNet/BlogspamNetPlugin.php
@@ -153,7 +153,7 @@ class BlogspamNetPlugin extends Plugin
$versions[] = array('name' => 'BlogspamNet',
'version' => BLOGSPAMNETPLUGIN_VERSION,
'author' => 'Evan Prodromou, Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:BlogspamNet',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/BlogspamNet',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to check submitted notices with blogspam.net.'));
diff --git a/plugins/CacheLog/CacheLogPlugin.php b/plugins/CacheLog/CacheLogPlugin.php
index 5c1b57e0e6..cf7e3a9884 100644
--- a/plugins/CacheLog/CacheLogPlugin.php
+++ b/plugins/CacheLog/CacheLogPlugin.php
@@ -101,7 +101,7 @@ class CacheLogPlugin extends Plugin
$versions[] = array('name' => 'CacheLog',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:CacheLog',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/CacheLog',
'description' =>
// TRANS: Plugin description.
_m('Log reads and writes to the cache.'));
diff --git a/plugins/CasAuthentication/CasAuthenticationPlugin.php b/plugins/CasAuthentication/CasAuthenticationPlugin.php
index 461655264e..cf0bf4ac52 100644
--- a/plugins/CasAuthentication/CasAuthenticationPlugin.php
+++ b/plugins/CasAuthentication/CasAuthenticationPlugin.php
@@ -152,7 +152,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
$versions[] = array('name' => 'CAS Authentication',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:CasAuthentication',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/CasAuthentication',
// TRANS: Plugin description. CAS is Central Authentication Service.
'rawdescription' => _m('The CAS Authentication plugin allows for StatusNet to handle authentication through CAS (Central Authentication Service).'));
return true;
diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php
index 4d87ab2240..0e4e7969aa 100644
--- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php
+++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php
@@ -59,7 +59,7 @@ class ClientSideShortenPlugin extends Plugin
$versions[] = array('name' => 'Shorten',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:ClientSideShorten',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ClientSideShorten',
'rawdescription' =>
// TRANS: Plugin description.
_m('ClientSideShorten causes the web interface\'s notice form to automatically shorten URLs as they entered, and before the notice is submitted.'));
diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php
index 5b38b2ae11..83c4e70990 100644
--- a/plugins/Comet/CometPlugin.php
+++ b/plugins/Comet/CometPlugin.php
@@ -109,7 +109,7 @@ class CometPlugin extends RealtimePlugin
$versions[] = array('name' => 'Comet',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Comet',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Comet',
'rawdescription' =>
// TRANS: Plugin description message. Bayeux is a protocol for transporting asynchronous messages
// TRANS: and Comet is a web application model.
diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php
index b721ebb20e..1f77a61acc 100644
--- a/plugins/DirectionDetector/DirectionDetectorPlugin.php
+++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php
@@ -246,7 +246,7 @@ class DirectionDetectorPlugin extends Plugin {
* plugin details
*/
function onPluginVersion(array &$versions){
- $url = 'http://status.net/wiki/Plugin:DirectionDetector';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/DirectionDetector';
$versions[] = array(
'name' => 'Direction detector',
diff --git a/plugins/Directory/DirectoryPlugin.php b/plugins/Directory/DirectoryPlugin.php
index e06c1c7271..e8ef98969f 100644
--- a/plugins/Directory/DirectoryPlugin.php
+++ b/plugins/Directory/DirectoryPlugin.php
@@ -257,7 +257,7 @@ class DirectoryPlugin extends Plugin
'name' => 'Directory',
'version' => GNUSOCIAL_VERSION,
'author' => 'Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:Directory',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Directory',
// TRANS: Plugin description.
'rawdescription' => _m('Add a user directory.')
);
diff --git a/plugins/DiskCache/DiskCachePlugin.php b/plugins/DiskCache/DiskCachePlugin.php
index 967990c12f..a574bf5158 100644
--- a/plugins/DiskCache/DiskCachePlugin.php
+++ b/plugins/DiskCache/DiskCachePlugin.php
@@ -166,7 +166,7 @@ class DiskCachePlugin extends Plugin
$versions[] = array('name' => 'DiskCache',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:DiskCache',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/DiskCache',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to implement cache interface with disk files.'));
diff --git a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php
index 062151db17..24ca6c90b0 100644
--- a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php
+++ b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php
@@ -195,7 +195,7 @@ class DomainStatusNetworkPlugin extends Plugin
$versions[] = array('name' => 'DomainStatusNetwork',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:DomainStatusNetwork',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/DomainStatusNetwork',
'rawdescription' =>
// TRANS: Plugin description.
_m('A plugin that maps a single status_network to an email domain.'));
diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php
index 2e15dd809a..e965cfaa04 100644
--- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php
+++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php
@@ -272,7 +272,7 @@ class DomainWhitelistPlugin extends Plugin
$versions[] = array('name' => 'DomainWhitelist',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou, Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:DomainWhitelist',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/DomainWhitelist',
'rawdescription' =>
// TRANS: Plugin description.
_m('Restrict domains for email users.'));
diff --git a/plugins/EmailAuthentication/EmailAuthenticationPlugin.php b/plugins/EmailAuthentication/EmailAuthenticationPlugin.php
index 524f1a6411..fda99a12f8 100644
--- a/plugins/EmailAuthentication/EmailAuthenticationPlugin.php
+++ b/plugins/EmailAuthentication/EmailAuthenticationPlugin.php
@@ -54,7 +54,7 @@ class EmailAuthenticationPlugin extends Plugin
$versions[] = array('name' => 'Email Authentication',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:EmailAuthentication',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/EmailAuthentication',
'rawdescription' =>
// TRANS: Plugin description.
_m('The Email Authentication plugin allows users to login using their email address.'));
diff --git a/plugins/EmailRegistration/EmailRegistrationPlugin.php b/plugins/EmailRegistration/EmailRegistrationPlugin.php
index 9e0fd58856..56e022435e 100644
--- a/plugins/EmailRegistration/EmailRegistrationPlugin.php
+++ b/plugins/EmailRegistration/EmailRegistrationPlugin.php
@@ -177,7 +177,7 @@ class EmailRegistrationPlugin extends Plugin
$versions[] = array('name' => 'EmailRegistration',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:EmailRegistration',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/EmailRegistration',
'rawdescription' =>
// TRANS: Plugin description.
_m('Use email only for registration.'));
diff --git a/plugins/EmailReminder/EmailReminderPlugin.php b/plugins/EmailReminder/EmailReminderPlugin.php
index 9ac6275537..f30e8d9273 100644
--- a/plugins/EmailReminder/EmailReminderPlugin.php
+++ b/plugins/EmailReminder/EmailReminderPlugin.php
@@ -185,7 +185,7 @@ class EmailReminderPlugin extends Plugin
'name' => 'EmailReminder',
'version' => GNUSOCIAL_VERSION,
'author' => 'Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:EmailReminder',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/EmailReminder',
// TRANS: Plugin description.
'rawdescription' => _m('Send email reminders for various things.')
);
diff --git a/plugins/EmailSummary/EmailSummaryPlugin.php b/plugins/EmailSummary/EmailSummaryPlugin.php
index bc47fdece9..75985da32e 100644
--- a/plugins/EmailSummary/EmailSummaryPlugin.php
+++ b/plugins/EmailSummary/EmailSummaryPlugin.php
@@ -71,7 +71,7 @@ class EmailSummaryPlugin extends Plugin
$versions[] = array('name' => 'EmailSummary',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:EmailSummary',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/EmailSummary',
'rawdescription' =>
// TRANS: Plugin description.
_m('Send an email summary of the inbox to users.'));
diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php
index 82ba2c19cb..ed6a01e9b4 100644
--- a/plugins/Event/EventPlugin.php
+++ b/plugins/Event/EventPlugin.php
@@ -102,7 +102,7 @@ class EventPlugin extends ActivityVerbHandlerPlugin
$versions[] = array('name' => 'Event',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Event',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Event',
'description' =>
// TRANS: Plugin description.
_m('Event invitations and RSVPs.'));
diff --git a/plugins/ExtendedProfile/ExtendedProfilePlugin.php b/plugins/ExtendedProfile/ExtendedProfilePlugin.php
index ea928b995e..a1717c897e 100644
--- a/plugins/ExtendedProfile/ExtendedProfilePlugin.php
+++ b/plugins/ExtendedProfile/ExtendedProfilePlugin.php
@@ -35,7 +35,7 @@ class ExtendedProfilePlugin extends Plugin
'name' => 'ExtendedProfile',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber, Samantha Doherty, Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:ExtendedProfile',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ExtendedProfile',
// TRANS: Plugin description.
'rawdescription' => _m('UI extensions for additional profile fields.')
);
diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php
index a19cc0349b..0f4c59fbaf 100644
--- a/plugins/FacebookBridge/FacebookBridgePlugin.php
+++ b/plugins/FacebookBridge/FacebookBridgePlugin.php
@@ -618,7 +618,7 @@ ENDOFSCRIPT;
'name' => 'Facebook Bridge',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews, Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:FacebookBridge',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/FacebookBridge',
'rawdescription' =>
// TRANS: Plugin description.
_m('A plugin for integrating StatusNet with Facebook.')
diff --git a/plugins/FollowEveryone/FollowEveryonePlugin.php b/plugins/FollowEveryone/FollowEveryonePlugin.php
index 3c26963e3e..58aae85ed0 100644
--- a/plugins/FollowEveryone/FollowEveryonePlugin.php
+++ b/plugins/FollowEveryone/FollowEveryonePlugin.php
@@ -170,7 +170,7 @@ class FollowEveryonePlugin extends Plugin
$versions[] = array('name' => 'FollowEveryone',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:FollowEveryone',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/FollowEveryone',
'rawdescription' =>
// TRANS: Plugin description.
_m('New users follow everyone at registration and are followed in return.'));
diff --git a/plugins/ForceGroup/ForceGroupPlugin.php b/plugins/ForceGroup/ForceGroupPlugin.php
index 56e33355e8..e0ab59822e 100644
--- a/plugins/ForceGroup/ForceGroupPlugin.php
+++ b/plugins/ForceGroup/ForceGroupPlugin.php
@@ -107,7 +107,7 @@ class ForceGroupPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:ForceGroup';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ForceGroup';
$versions[] = array('name' => 'ForceGroup',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/GeoURL/GeoURLPlugin.php b/plugins/GeoURL/GeoURLPlugin.php
index a64ac7f4fd..be47bd5d27 100644
--- a/plugins/GeoURL/GeoURLPlugin.php
+++ b/plugins/GeoURL/GeoURLPlugin.php
@@ -121,7 +121,7 @@ class GeoURLPlugin extends Plugin
$versions[] = array('name' => 'GeoURL',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:GeoURL',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/GeoURL',
'rawdescription' =>
// TRANS: Plugin description.
_m('Ping GeoURL when '.
diff --git a/plugins/Geonames/GeonamesPlugin.php b/plugins/Geonames/GeonamesPlugin.php
index ff9192283f..14a95a2114 100644
--- a/plugins/Geonames/GeonamesPlugin.php
+++ b/plugins/Geonames/GeonamesPlugin.php
@@ -492,7 +492,7 @@ class GeonamesPlugin extends Plugin
$versions[] = array('name' => 'Geonames',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Geonames',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Geonames',
'rawdescription' =>
// TRANS: Plugin description.
_m('Uses Geonames service to get human-readable '.
diff --git a/plugins/GroupFavorited/GroupFavoritedPlugin.php b/plugins/GroupFavorited/GroupFavoritedPlugin.php
index bfb7374d1d..3c6fbd3af4 100644
--- a/plugins/GroupFavorited/GroupFavoritedPlugin.php
+++ b/plugins/GroupFavorited/GroupFavoritedPlugin.php
@@ -67,7 +67,7 @@ class GroupFavoritedPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:GroupFavorited';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/GroupFavorited';
$versions[] = array('name' => 'GroupFavorited',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
index 61828239ca..bee504491f 100644
--- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
+++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
@@ -410,7 +410,7 @@ class GroupPrivateMessagePlugin extends Plugin
$versions[] = array('name' => 'GroupPrivateMessage',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:GroupPrivateMessage',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/GroupPrivateMessage',
'rawdescription' =>
// TRANS: Plugin description.
_m('Allow posting private messages to groups.'));
diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php
index ea6eaabef8..15bd8159d7 100644
--- a/plugins/Imap/ImapPlugin.php
+++ b/plugins/Imap/ImapPlugin.php
@@ -81,7 +81,7 @@ class ImapPlugin extends Plugin
$versions[] = array('name' => 'IMAP',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:IMAP',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/IMAP',
'rawdescription' =>
// TRANS: Plugin description.
_m('The IMAP plugin allows for StatusNet to check a POP or IMAP mailbox for incoming mail containing user posts.'));
diff --git a/plugins/InProcessCache/InProcessCachePlugin.php b/plugins/InProcessCache/InProcessCachePlugin.php
index 4684d0169f..4bcfb8e2da 100644
--- a/plugins/InProcessCache/InProcessCachePlugin.php
+++ b/plugins/InProcessCache/InProcessCachePlugin.php
@@ -172,7 +172,7 @@ class InProcessCachePlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:InProcessCache';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/InProcessCache';
$versions[] = array('name' => 'InProcessCache',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
index 986ba36075..c9107ad824 100644
--- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php
+++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
@@ -46,7 +46,7 @@ class InfiniteScrollPlugin extends Plugin
$versions[] = array('name' => 'InfiniteScroll',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/InfiniteScroll',
'rawdescription' =>
// TRANS: Plugin dscription.
_m('Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.'));
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index 0efaec99b2..2a09ad7c81 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -147,7 +147,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
$versions[] = array('name' => 'LDAP Authentication',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/LdapAuthentication',
'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.'));
diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
index eca8e037a0..fb86ba57b8 100644
--- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
+++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
@@ -123,7 +123,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
$versions[] = array('name' => 'LDAP Authorization',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/LdapAuthorization',
'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.'));
diff --git a/plugins/LilUrl/LilUrlPlugin.php b/plugins/LilUrl/LilUrlPlugin.php
index fcbee2b56d..1e4d135cc3 100644
--- a/plugins/LilUrl/LilUrlPlugin.php
+++ b/plugins/LilUrl/LilUrlPlugin.php
@@ -62,7 +62,7 @@ class LilUrlPlugin extends UrlShortenerPlugin
$versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/LilUrl',
'rawdescription' =>
// TRANS: Plugin description.
// TRANS: %1$s is the service URL.
diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php
index 5edf66767d..25e31f3f79 100644
--- a/plugins/LinkPreview/LinkPreviewPlugin.php
+++ b/plugins/LinkPreview/LinkPreviewPlugin.php
@@ -34,7 +34,7 @@ class LinkPreviewPlugin extends Plugin
$versions[] = array('name' => 'LinkPreview',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:LinkPreview',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/LinkPreview',
'rawdescription' =>
// TRANS: Plugin description.
_m('UI extension for previewing thumbnails from links.'));
diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php
index 64165199eb..06c49b0809 100644
--- a/plugins/Linkback/LinkbackPlugin.php
+++ b/plugins/Linkback/LinkbackPlugin.php
@@ -337,7 +337,7 @@ class LinkbackPlugin extends Plugin
$versions[] = array('name' => 'Linkback',
'version' => LINKBACKPLUGIN_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Linkback',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Linkback',
'rawdescription' =>
// TRANS: Plugin description.
_m('Notify blog authors when their posts have been linked in '.
diff --git a/plugins/LogFilter/LogFilterPlugin.php b/plugins/LogFilter/LogFilterPlugin.php
index 028af9bc9c..f0794af4a3 100644
--- a/plugins/LogFilter/LogFilterPlugin.php
+++ b/plugins/LogFilter/LogFilterPlugin.php
@@ -44,7 +44,7 @@ class LogFilterPlugin extends Plugin
$versions[] = array('name' => 'LogFilter',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:LogFilter',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/LogFilter',
'rawdescription' =>
// TRANS: Plugin description.
_m('Provides server-side setting to filter log output by type or keyword.'));
diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php
index fcc9d88e56..bc43b9dff7 100644
--- a/plugins/Mapstraction/MapstractionPlugin.php
+++ b/plugins/Mapstraction/MapstractionPlugin.php
@@ -174,7 +174,7 @@ class MapstractionPlugin extends Plugin
$versions[] = array('name' => 'Mapstraction',
'version' => self::VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Mapstraction',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Mapstraction',
'rawdescription' =>
// TRANS: Plugin description.
_m('Show maps of users\' and friends\' notices '.
diff --git a/plugins/Memcache/MemcachePlugin.php b/plugins/Memcache/MemcachePlugin.php
index 7efb5e0284..dc0f943675 100644
--- a/plugins/Memcache/MemcachePlugin.php
+++ b/plugins/Memcache/MemcachePlugin.php
@@ -241,7 +241,7 @@ class MemcachePlugin extends Plugin
$versions[] = array('name' => 'Memcache',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou, Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:Memcache',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Memcache',
'rawdescription' =>
// TRANS: Plugin description.
_m('Use Memcached to cache query results.'));
diff --git a/plugins/Memcached/MemcachedPlugin.php b/plugins/Memcached/MemcachedPlugin.php
index ca24b7b7d1..33b7772db4 100644
--- a/plugins/Memcached/MemcachedPlugin.php
+++ b/plugins/Memcached/MemcachedPlugin.php
@@ -212,7 +212,7 @@ class MemcachedPlugin extends Plugin
$versions[] = array('name' => 'Memcached',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou, Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:Memcached',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Memcached',
'rawdescription' =>
// TRANS: Plugin description.
_m('Use Memcached to cache query results.'));
diff --git a/plugins/Meteor/MeteorPlugin.php b/plugins/Meteor/MeteorPlugin.php
index 64c2fd3d69..9ce25386c1 100644
--- a/plugins/Meteor/MeteorPlugin.php
+++ b/plugins/Meteor/MeteorPlugin.php
@@ -165,7 +165,7 @@ class MeteorPlugin extends RealtimePlugin
$versions[] = array('name' => 'Meteor',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Meteor',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Meteor',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to do "real time" updates using Meteor.'));
diff --git a/plugins/Minify/MinifyPlugin.php b/plugins/Minify/MinifyPlugin.php
index 1dd3bdcf34..b970cd20c6 100644
--- a/plugins/Minify/MinifyPlugin.php
+++ b/plugins/Minify/MinifyPlugin.php
@@ -162,7 +162,7 @@ class MinifyPlugin extends Plugin
$versions[] = array('name' => 'Minify',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:Minify',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Minify',
'rawdescription' =>
// TRANS: Plugin description.
_m('The Minify plugin minifies StatusNet\'s CSS and JavaScript, removing whitespace and comments.'));
diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php
index 4129035ebb..0e0ba170e8 100644
--- a/plugins/MobileProfile/MobileProfilePlugin.php
+++ b/plugins/MobileProfile/MobileProfilePlugin.php
@@ -373,7 +373,7 @@ class MobileProfilePlugin extends WAP20Plugin
$versions[] = array('name' => 'MobileProfile',
'version' => GNUSOCIAL_VERSION,
'author' => 'Sarven Capadisli',
- 'homepage' => 'http://status.net/wiki/Plugin:MobileProfile',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/MobileProfile',
'rawdescription' =>
// TRANS: Plugin description.
_m('XHTML MobileProfile output for supporting user agents.'));
diff --git a/plugins/ModHelper/ModHelperPlugin.php b/plugins/ModHelper/ModHelperPlugin.php
index 2752a21539..1aa9dad100 100644
--- a/plugins/ModHelper/ModHelperPlugin.php
+++ b/plugins/ModHelper/ModHelperPlugin.php
@@ -34,7 +34,7 @@ class ModHelperPlugin extends Plugin
$versions[] = array('name' => 'ModHelper',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:ModHelper',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ModHelper',
'rawdescription' =>
// TRANS: Plugin description.
_m('Lets users who have been manually marked as "modhelper"s silence accounts.'));
diff --git a/plugins/ModLog/ModLogPlugin.php b/plugins/ModLog/ModLogPlugin.php
index d1e01ca849..84912ac914 100644
--- a/plugins/ModLog/ModLogPlugin.php
+++ b/plugins/ModLog/ModLogPlugin.php
@@ -189,7 +189,7 @@ class ModLogPlugin extends Plugin
$versions[] = array('name' => 'ModLog',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:ModLog',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ModLog',
'description' =>
_m('Show the moderation history for a profile in the sidebar'));
return true;
diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php
index 816034f831..9facd12ef2 100644
--- a/plugins/ModPlus/ModPlusPlugin.php
+++ b/plugins/ModPlus/ModPlusPlugin.php
@@ -32,7 +32,7 @@ class ModPlusPlugin extends Plugin
$versions[] = array('name' => 'ModPlus',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:ModPlus',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ModPlus',
'rawdescription' =>
// TRANS: Plugin description.
_m('UI extension for profile moderation actions.'));
diff --git a/plugins/NoticeTitle/NoticeTitlePlugin.php b/plugins/NoticeTitle/NoticeTitlePlugin.php
index 22528d0b50..7721c343dd 100644
--- a/plugins/NoticeTitle/NoticeTitlePlugin.php
+++ b/plugins/NoticeTitle/NoticeTitlePlugin.php
@@ -86,7 +86,7 @@ class NoticeTitlePlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:NoticeTitle';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/NoticeTitle';
$versions[] = array('name' => 'NoticeTitle',
'version' => NOTICE_TITLE_PLUGIN_VERSION,
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index c108e78e6c..6e002d2805 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -1229,7 +1229,7 @@ class OStatusPlugin extends Plugin
$versions[] = array('name' => 'OStatus',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou, James Walker, Brion Vibber, Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:OStatus',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/OStatus',
// TRANS: Plugin description.
'rawdescription' => _m('Follow people across social networks that implement '.
'OStatus .'));
diff --git a/plugins/OfflineBackup/OfflineBackupPlugin.php b/plugins/OfflineBackup/OfflineBackupPlugin.php
index 1d7a17ca2c..b1c69558ea 100644
--- a/plugins/OfflineBackup/OfflineBackupPlugin.php
+++ b/plugins/OfflineBackup/OfflineBackupPlugin.php
@@ -76,7 +76,7 @@ class OfflineBackupPlugin extends Plugin
$versions[] = array('name' => 'OfflineBackup',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:OfflineBackup',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/OfflineBackup',
'rawdescription' =>
// TRANS: Plugin description.
_m('Backup user data in offline queue and email when ready.'));
diff --git a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php
index 06c75f7a93..89c7cbabfd 100644
--- a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php
+++ b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php
@@ -54,7 +54,7 @@ class OpenExternalLinkTargetPlugin extends Plugin
$versions[] = array('name' => 'OpenExternalLinkTarget',
'version' => GNUSOCIAL_VERSION,
'author' => 'Sarven Capadisli',
- 'homepage' => 'http://status.net/wiki/Plugin:OpenExternalLinkTarget',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/OpenExternalLinkTarget',
'rawdescription' =>
// TRANS: Plugin description.
_m('Opens external links (i.e. with rel=external) on a new window or tab.'));
diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php
index 4e5a0bfe0c..e3577bc4a8 100644
--- a/plugins/OpenID/OpenIDPlugin.php
+++ b/plugins/OpenID/OpenIDPlugin.php
@@ -620,7 +620,7 @@ class OpenIDPlugin extends Plugin
$versions[] = array('name' => 'OpenID',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou, Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:OpenID',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/OpenID',
'rawdescription' =>
// TRANS: Plugin description.
_m('Use OpenID to login to the site.'));
diff --git a/plugins/OpenX/OpenXPlugin.php b/plugins/OpenX/OpenXPlugin.php
index 8d80197be3..f0c78905aa 100644
--- a/plugins/OpenX/OpenXPlugin.php
+++ b/plugins/OpenX/OpenXPlugin.php
@@ -204,7 +204,7 @@ ENDOFSCRIPT;
$versions[] = array('name' => 'OpenX',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:OpenX',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/OpenX',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin for OpenX Ad Server .'));
diff --git a/plugins/Orbited/OrbitedPlugin.php b/plugins/Orbited/OrbitedPlugin.php
index 5abd27e9ee..e007eebe7e 100644
--- a/plugins/Orbited/OrbitedPlugin.php
+++ b/plugins/Orbited/OrbitedPlugin.php
@@ -164,7 +164,7 @@ class OrbitedPlugin extends RealtimePlugin
$versions[] = array('name' => 'Orbited',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Orbited',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Orbited',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to make updates using Orbited and STOMP.'));
diff --git a/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php
index fa5894a8f5..b700e07db4 100644
--- a/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php
+++ b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php
@@ -108,7 +108,7 @@ ENDOFPIWIK;
$versions[] = array('name' => 'PiwikAnalytics',
'version' => GNUSOCIAL_VERSION,
'author' => 'Tobias Diekershoff, Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Piwik',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Piwik',
'rawdescription' =>
// TRANS: Plugin description.
_m('Use Piwik Open Source web analytics software.'));
diff --git a/plugins/Poll/PollPlugin.php b/plugins/Poll/PollPlugin.php
index 53a491ef47..4f74e82a35 100644
--- a/plugins/Poll/PollPlugin.php
+++ b/plugins/Poll/PollPlugin.php
@@ -125,7 +125,7 @@ class PollPlugin extends MicroAppPlugin
$versions[] = array('name' => 'Poll',
'version' => self::VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:Poll',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Poll',
'rawdescription' =>
// TRANS: Plugin description.
_m('Simple extension for supporting basic polls.'));
diff --git a/plugins/PostDebug/PostDebugPlugin.php b/plugins/PostDebug/PostDebugPlugin.php
index 120feee8fe..9f87494405 100644
--- a/plugins/PostDebug/PostDebugPlugin.php
+++ b/plugins/PostDebug/PostDebugPlugin.php
@@ -53,7 +53,7 @@ class PostDebugPlugin extends Plugin
$versions[] = array('name' => 'PostDebug',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:PostDebug',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/PostDebug',
'rawdescription' =>
// TRANS: Plugin description.
_m('Debugging tool to record request details on POST.'));
diff --git a/plugins/PtitUrl/PtitUrlPlugin.php b/plugins/PtitUrl/PtitUrlPlugin.php
index 0e23a5f64e..031604b57f 100644
--- a/plugins/PtitUrl/PtitUrlPlugin.php
+++ b/plugins/PtitUrl/PtitUrlPlugin.php
@@ -62,7 +62,7 @@ class PtitUrlPlugin extends UrlShortenerPlugin
$versions[] = array('name' => sprintf('PtitUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:PtitUrl',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/PtitUrl',
'rawdescription' =>
// TRANS: Plugin description. %1$s is the URL shortening service base URL (for example "bit.ly").
sprintf(_m('Uses %1$s URL-shortener service.'),
diff --git a/plugins/QnA/QnAPlugin.php b/plugins/QnA/QnAPlugin.php
index e8c983eb9a..6780637009 100644
--- a/plugins/QnA/QnAPlugin.php
+++ b/plugins/QnA/QnAPlugin.php
@@ -130,7 +130,7 @@ class QnAPlugin extends MicroAppPlugin
'name' => 'QnA',
'version' => GNUSOCIAL_VERSION,
'author' => 'Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:QnA',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/QnA',
'description' =>
// TRANS: Plugin description.
_m('Question and Answers micro-app.')
diff --git a/plugins/RSSCloud/RSSCloudPlugin.php b/plugins/RSSCloud/RSSCloudPlugin.php
index 0fff0947a2..3a8a83749c 100644
--- a/plugins/RSSCloud/RSSCloudPlugin.php
+++ b/plugins/RSSCloud/RSSCloudPlugin.php
@@ -203,7 +203,7 @@ class RSSCloudPlugin extends Plugin
$versions[] = array('name' => 'RSSCloud',
'version' => RSSCLOUDPLUGIN_VERSION,
'author' => 'Zach Copley',
- 'homepage' => 'http://status.net/wiki/Plugin:RSSCloud',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/RSSCloud',
'rawdescription' =>
// TRANS: Plugin description.
_m('The RSSCloud plugin enables your StatusNet instance to publish ' .
diff --git a/plugins/Recaptcha/RecaptchaPlugin.php b/plugins/Recaptcha/RecaptchaPlugin.php
index c039dd5350..3cf3b65203 100644
--- a/plugins/Recaptcha/RecaptchaPlugin.php
+++ b/plugins/Recaptcha/RecaptchaPlugin.php
@@ -109,7 +109,7 @@ class RecaptchaPlugin extends Plugin
$versions[] = array('name' => 'Recaptcha',
'version' => GNUSOCIAL_VERSION,
'author' => 'Eric Helgeson',
- 'homepage' => 'http://status.net/wiki/Plugin:Recaptcha',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Recaptcha',
'rawdescription' =>
// TRANS: Plugin description.
_m('Uses Recaptcha service to add a '.
diff --git a/plugins/RegisterThrottle/RegisterThrottlePlugin.php b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
index 9d3be3b8a2..857ce41dba 100644
--- a/plugins/RegisterThrottle/RegisterThrottlePlugin.php
+++ b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
@@ -180,7 +180,7 @@ class RegisterThrottlePlugin extends Plugin
$versions[] = array('name' => 'RegisterThrottle',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:RegisterThrottle',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/RegisterThrottle',
'description' =>
// TRANS: Plugin description.
_m('Throttles excessive registration from a single IP address.'));
diff --git a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
index 734cabbcd5..6ca13b9097 100644
--- a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
+++ b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
@@ -221,7 +221,7 @@ class RequireValidatedEmailPlugin extends Plugin
'Evan Prodromou, '.
'Brion Vibber',
'homepage' =>
- 'http://status.net/wiki/Plugin:RequireValidatedEmail',
+ 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/RequireValidatedEmail',
'rawdescription' =>
// TRANS: Plugin description.
_m('Disables posting without a validated email address.'));
diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
index 9a85a974ae..47f304414e 100644
--- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
+++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
@@ -62,7 +62,7 @@ class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin
$versions[] = array('name' => 'Reverse Username Authentication',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:ReverseUsernameAuthentication',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ReverseUsernameAuthentication',
'rawdescription' =>
// TRANS: Plugin description.
_m('The Reverse Username Authentication plugin allows for StatusNet to handle authentication by checking if the provided password is the same as the reverse of the username.'));
diff --git a/plugins/SQLProfile/SQLProfilePlugin.php b/plugins/SQLProfile/SQLProfilePlugin.php
index a7912844c2..3baa91e494 100644
--- a/plugins/SQLProfile/SQLProfilePlugin.php
+++ b/plugins/SQLProfile/SQLProfilePlugin.php
@@ -36,7 +36,7 @@ class SQLProfilePlugin extends Plugin
$versions[] = array('name' => 'SQLProfile',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:SQLProfile',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SQLProfile',
'rawdescription' =>
// TRANS: Plugin description.
_m('Debug tool to watch for poorly indexed DB queries.'));
diff --git a/plugins/SQLStats/SQLStatsPlugin.php b/plugins/SQLStats/SQLStatsPlugin.php
index f67ed03012..bd83ac0a32 100644
--- a/plugins/SQLStats/SQLStatsPlugin.php
+++ b/plugins/SQLStats/SQLStatsPlugin.php
@@ -39,7 +39,7 @@ class SQLStatsPlugin extends Plugin
$versions[] = array('name' => 'SQLStats',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:SQLStats',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SQLStats',
'rawdescription' =>
// TRANS: Plugin decription.
_m('Debug tool to watch for poorly indexed DB queries.'));
diff --git a/plugins/Sample/SamplePlugin.php b/plugins/Sample/SamplePlugin.php
index 80c46d17c4..4f8351cc08 100644
--- a/plugins/Sample/SamplePlugin.php
+++ b/plugins/Sample/SamplePlugin.php
@@ -227,7 +227,7 @@ class SamplePlugin extends Plugin
$versions[] = array('name' => 'Sample',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber, Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:Sample',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Sample',
'rawdescription' =>
// TRANS: Plugin description.
_m('A sample plugin to show basics of development for new hackers.'));
diff --git a/plugins/SearchSub/SearchSubPlugin.php b/plugins/SearchSub/SearchSubPlugin.php
index 57984d0e01..06d644235e 100644
--- a/plugins/SearchSub/SearchSubPlugin.php
+++ b/plugins/SearchSub/SearchSubPlugin.php
@@ -93,7 +93,7 @@ class SearchSubPlugin extends Plugin
$versions[] = array('name' => 'SearchSub',
'version' => self::VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:SearchSub',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SearchSub',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to allow following all messages with a given search.'));
diff --git a/plugins/ShareNotice/ShareNoticePlugin.php b/plugins/ShareNotice/ShareNoticePlugin.php
index 7a6fd28fee..fb60341e3d 100644
--- a/plugins/ShareNotice/ShareNoticePlugin.php
+++ b/plugins/ShareNotice/ShareNoticePlugin.php
@@ -211,7 +211,7 @@ class FacebookShareTarget extends NoticeShareTarget
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:ShareNotice';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ShareNotice';
$versions[] = array('name' => 'ShareNotice',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/SimpleUrl/SimpleUrlPlugin.php b/plugins/SimpleUrl/SimpleUrlPlugin.php
index 41e1998483..235a330e02 100644
--- a/plugins/SimpleUrl/SimpleUrlPlugin.php
+++ b/plugins/SimpleUrl/SimpleUrlPlugin.php
@@ -52,7 +52,7 @@ class SimpleUrlPlugin extends UrlShortenerPlugin
$versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:SimpleUrl',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SimpleUrl',
'rawdescription' =>
// TRANS: Plugin description.
sprintf(_m('Uses %1$s URL-shortener service.'),
diff --git a/plugins/Sitemap/SitemapPlugin.php b/plugins/Sitemap/SitemapPlugin.php
index a1fe90b4b4..6bc5e07fef 100644
--- a/plugins/Sitemap/SitemapPlugin.php
+++ b/plugins/Sitemap/SitemapPlugin.php
@@ -176,7 +176,7 @@ class SitemapPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:Sitemap';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Sitemap';
$versions[] = array('name' => 'Sitemap',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php
index 4e1129536d..fcf971de6a 100644
--- a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php
+++ b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php
@@ -97,7 +97,7 @@ class SlicedFavoritesPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:SlicedFavorites';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SlicedFavorites';
$versions[] = array('name' => 'SlicedFavorites',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/SphinxSearch/SphinxSearchPlugin.php b/plugins/SphinxSearch/SphinxSearchPlugin.php
index 74744f18e6..8345ea59e7 100644
--- a/plugins/SphinxSearch/SphinxSearchPlugin.php
+++ b/plugins/SphinxSearch/SphinxSearchPlugin.php
@@ -107,7 +107,7 @@ class SphinxSearchPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:SphinxSearch';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SphinxSearch';
$versions[] = array('name' => 'SphinxSearch',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php b/plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php
index 74a643d6d9..8ada31a8a7 100644
--- a/plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php
+++ b/plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php
@@ -55,7 +55,7 @@ class StrictTransportSecurityPlugin extends Plugin
$versions[] = array('name' => 'StrictTransportSecurity',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:StrictTransportSecurity',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/StrictTransportSecurity',
'rawdescription' =>
// TRANS: Plugin description.
_m('The Strict Transport Security plugin implements the Strict Transport Security header, improving the security of HTTPS only sites.'));
diff --git a/plugins/SubMirror/SubMirrorPlugin.php b/plugins/SubMirror/SubMirrorPlugin.php
index 27fc7c984d..83e15a9bd4 100644
--- a/plugins/SubMirror/SubMirrorPlugin.php
+++ b/plugins/SubMirror/SubMirrorPlugin.php
@@ -62,7 +62,7 @@ class SubMirrorPlugin extends Plugin
$versions[] = array('name' => 'SubMirror',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:SubMirror',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SubMirror',
'rawdescription' =>
// TRANS: Plugin description.
_m('Pull feeds into your timeline!'));
diff --git a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php
index fec91afdb7..30b9290273 100644
--- a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php
+++ b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php
@@ -162,7 +162,7 @@ class SubscriptionThrottlePlugin extends Plugin
$versions[] = array('name' => 'SubscriptionThrottle',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:SubscriptionThrottle',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SubscriptionThrottle',
'rawdescription' =>
// TRANS: Plugin description.
_m('Configurable limits for subscriptions and group memberships.'));
diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php
index df69298888..ff43613383 100644
--- a/plugins/TabFocus/TabFocusPlugin.php
+++ b/plugins/TabFocus/TabFocusPlugin.php
@@ -49,7 +49,7 @@ class TabFocusPlugin extends Plugin
$versions[] = array('name' => 'TabFocus',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews and Paul Irish',
- 'homepage' => 'http://status.net/wiki/Plugin:TabFocus',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TabFocus',
'rawdescription' =>
// TRANS: Plugin description.
_m('TabFocus changes the notice form behavior so that, while in the text area, pressing the tab key focuses the "Send" button, matching the behavior of Twitter.'));
diff --git a/plugins/TagSub/TagSubPlugin.php b/plugins/TagSub/TagSubPlugin.php
index f1d1ab4622..14c0cd191b 100644
--- a/plugins/TagSub/TagSubPlugin.php
+++ b/plugins/TagSub/TagSubPlugin.php
@@ -94,7 +94,7 @@ class TagSubPlugin extends Plugin
$versions[] = array('name' => 'TagSub',
'version' => self::VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:TagSub',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TagSub',
'rawdescription' =>
// TRANS: Plugin description.
_m('Plugin to allow following all messages with a given tag.'));
diff --git a/plugins/TightUrl/TightUrlPlugin.php b/plugins/TightUrl/TightUrlPlugin.php
index 52e5184392..a3bc492ad1 100644
--- a/plugins/TightUrl/TightUrlPlugin.php
+++ b/plugins/TightUrl/TightUrlPlugin.php
@@ -62,7 +62,7 @@ class TightUrlPlugin extends UrlShortenerPlugin
$versions[] = array('name' => sprintf('TightUrl (%s)', $this->shortenerName),
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews',
- 'homepage' => 'http://status.net/wiki/Plugin:TightUrl',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TightUrl',
'rawdescription' =>
// TRANS: Plugin description. %s is the shortener name.
sprintf(_m('Uses %1$s URL-shortener service.'),
diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php
index 72c28d4fa4..26ddb3ceab 100644
--- a/plugins/TwitterBridge/TwitterBridgePlugin.php
+++ b/plugins/TwitterBridge/TwitterBridgePlugin.php
@@ -301,7 +301,7 @@ class TwitterBridgePlugin extends Plugin
'name' => 'TwitterBridge',
'version' => self::VERSION,
'author' => 'Zach Copley, Julien C, Jean Baptiste Favre',
- 'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TwitterBridge',
// TRANS: Plugin description.
'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' .
'of a StatusNet instance with ' .
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index d2afeaced8..8b2971f35e 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -229,7 +229,7 @@ class UserFlagPlugin extends Plugin
*/
function onPluginVersion(array &$versions)
{
- $url = 'http://status.net/wiki/Plugin:UserFlag';
+ $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/UserFlag';
$versions[] = array('name' => 'UserFlag',
'version' => GNUSOCIAL_VERSION,
diff --git a/plugins/UserLimit/UserLimitPlugin.php b/plugins/UserLimit/UserLimitPlugin.php
index ac4d503151..2bb1218a72 100644
--- a/plugins/UserLimit/UserLimitPlugin.php
+++ b/plugins/UserLimit/UserLimitPlugin.php
@@ -86,7 +86,7 @@ class UserLimitPlugin extends Plugin
$versions[] = array('name' => 'UserLimit',
'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:UserLimit',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/UserLimit',
'description' =>
// TRANS: Plugin description.
_m('Limit the number of users who can register.'));
diff --git a/plugins/WikiHashtags/WikiHashtagsPlugin.php b/plugins/WikiHashtags/WikiHashtagsPlugin.php
index db33eb801a..46d0470143 100644
--- a/plugins/WikiHashtags/WikiHashtagsPlugin.php
+++ b/plugins/WikiHashtags/WikiHashtagsPlugin.php
@@ -109,7 +109,7 @@ class WikiHashtagsPlugin extends Plugin
$versions[] = array('name' => 'WikiHashtags',
'version' => self::VERSION,
'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:WikiHashtags',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/WikiHashtags',
'rawdescription' =>
// TRANS: Plugin description.
_m('Gets hashtag descriptions from WikiHashtags .'));
diff --git a/plugins/WikiHowProfile/WikiHowProfilePlugin.php b/plugins/WikiHowProfile/WikiHowProfilePlugin.php
index 8656272e48..9d8daf8adb 100644
--- a/plugins/WikiHowProfile/WikiHowProfilePlugin.php
+++ b/plugins/WikiHowProfile/WikiHowProfilePlugin.php
@@ -54,7 +54,7 @@ class WikiHowProfilePlugin extends Plugin
$versions[] = array('name' => 'WikiHow avatar fetcher',
'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
- 'homepage' => 'http://status.net/wiki/Plugin:Sample',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Sample',
'rawdescription' =>
// TRANS: Plugin description.
_m('Fetches avatar and other profile information for WikiHow users when setting up an account via OpenID.'));
diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php
index 6867eb093e..f8476cd8f2 100644
--- a/plugins/Xmpp/XmppPlugin.php
+++ b/plugins/Xmpp/XmppPlugin.php
@@ -461,7 +461,7 @@ class XmppPlugin extends ImPlugin
$versions[] = array('name' => 'XMPP',
'version' => GNUSOCIAL_VERSION,
'author' => 'Craig Andrews, Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:XMPP',
+ 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/XMPP',
'rawdescription' =>
// TRANS: Plugin description.
_m('The XMPP plugin allows users to send and receive notices over the XMPP/Jabber network.'));
From a614205663408328f1b59639d346e0aa3a264341 Mon Sep 17 00:00:00 2001
From: Chimo
Date: Fri, 22 Jan 2016 16:01:24 +0000
Subject: [PATCH 006/415] Add plugin READMEs
---
plugins/ActivitySpam/README | 23 +++++++++++++++++
plugins/AnonymousFave/README | 14 ++++++++++
plugins/AntiBrute/README | 11 ++++++++
plugins/ApiLogger/README | 18 +++++++++++++
plugins/Awesomeness/README | 14 ++++++++++
plugins/Blacklist/README | 17 ++++++++++++
plugins/BlankAd/README | 14 ++++++++++
plugins/BlogspamNet/README | 22 ++++++++++++++++
plugins/CacheLog/README | 23 +++++++++++++++++
plugins/ClientSideShorten/README | 4 +--
plugins/ConversationTree/README | 15 +++++++++++
plugins/Cronish/README | 12 +++++++++
plugins/Diaspora/README | 17 ++++++++++++
plugins/DirectMessage/README | 10 ++++++++
plugins/DirectionDetector/README | 15 +++++++++++
plugins/Directory/README | 15 +++++++++++
plugins/DiskCache/README | 17 ++++++++++++
plugins/DomainStatusNetwork/README | 24 +++++++++++++++++
plugins/DomainWhitelist/README | 16 ++++++++++++
plugins/EmailAuthentication/README | 7 ++++-
plugins/EmailRegistration/README | 25 ++++++++++++++++++
plugins/EmailReminder/README | 21 +++++++++++++++
plugins/EmailSummary/README | 22 ++++++++++++++++
plugins/Event/README | 10 ++++++++
plugins/ExtendedProfile/README | 23 +++++++++++++++++
plugins/Favorite/README | 11 ++++++++
plugins/FeedPoller/README | 16 ++++++++++++
plugins/FollowEveryone/README | 16 ++++++++++++
plugins/ForceGroup/README | 16 ++++++++++++
plugins/GNUsocialPhoto/README | 0
plugins/GNUsocialPhotos/README | 0
plugins/GNUsocialVideo/README | 0
plugins/GeoURL/README | 19 ++++++++++++++
plugins/Geonames/README | 19 ++++++++++++++
plugins/GroupFavorited/README | 15 +++++++++++
plugins/GroupPrivateMessage/README | 15 +++++++++++
plugins/ImageMagick/README | 21 +++++++++++++++
plugins/InProcessCache/README | 23 +++++++++++++++++
plugins/LRDD/README | 14 ++++++++++
plugins/LilUrl/README | 17 ++++++++++++
plugins/LinkPreview/README | 24 ++++++++++++++++-
plugins/Linkback/README | 19 ++++++++++++++
plugins/LogFilter/README | 20 +++++++++++++++
plugins/Mapstraction/README | 21 +++++++++++++++
plugins/Memcache/README | 28 ++++++++++++++++++++
plugins/Memcached/README | 21 +++++++++++++++
plugins/MentionURL/README | 15 +++++++++++
plugins/Mobile/README | 10 ++++++++
plugins/MobileProfile/README | 20 +++++++++++++++
plugins/ModHelper/README | 16 ++++++++++++
plugins/ModLog/README | 15 +++++++++++
plugins/ModPlus/README | 15 +++++++++++
plugins/NoticeTitle/README | 17 ++++++++++++
plugins/Oembed/README | 30 +++++++++++++++++++++-
plugins/OfflineBackup/README | 16 ++++++++++++
plugins/OpenExternalLinkTarget/README | 15 +++++++++++
plugins/OpenID/README | 21 +++++++++++++++
plugins/OpenX/README | 26 +++++++++++++++++++
plugins/Orbited/README | 37 +++++++++++++++++++++++++++
plugins/PiwikAnalytics/README | 23 +++++++++++++++++
plugins/PostDebug/README | 18 +++++++++++++
plugins/PtitUrl/README | 18 +++++++++++++
plugins/QnA/README | 10 ++++++++
plugins/RegisterThrottle/README | 24 +++++++++++++++++
plugins/SQLProfile/README | 17 ++++++++++++
plugins/SQLStats/README | 18 +++++++++++++
plugins/Sample/README | 19 ++++++++++++++
plugins/SearchSub/README | 10 ++++++++
plugins/Share/README | 10 ++++++++
plugins/ShareNotice/README | 23 +++++++++++++++++
plugins/SimpleCaptcha/README | 10 ++++++++
plugins/SimpleUrl/README | 18 +++++++++++++
plugins/SiteNoticeInSidebar/README | 16 ++++++++++++
plugins/Sitemap/README | 20 +++++++++++++++
plugins/SlicedFavorites/README | 30 ++++++++++++++++++++++
plugins/SphinxSearch/README | 6 ++---
plugins/StoreRemoteMedia/README | 22 ++++++++++++++++
plugins/SubMirror/README | 15 +++++++++++
plugins/SubscriptionThrottle/README | 26 +++++++++++++++++++
plugins/TabFocus/README | 17 ++++++++++++
plugins/TagSub/README | 10 ++++++++
plugins/TightUrl/README | 18 +++++++++++++
plugins/UserFlag/README | 18 +++++++++++++
plugins/UserLimit/README | 17 ++++++++++++
plugins/VideoThumbnails/README | 19 ++++++++++++++
plugins/WebFinger/README | 10 ++++++++
plugins/WikiHashtags/REAME | 17 ++++++++++++
87 files changed, 1468 insertions(+), 8 deletions(-)
create mode 100755 plugins/ActivitySpam/README
create mode 100755 plugins/AnonymousFave/README
create mode 100755 plugins/AntiBrute/README
create mode 100755 plugins/ApiLogger/README
create mode 100755 plugins/Awesomeness/README
create mode 100755 plugins/Blacklist/README
create mode 100755 plugins/BlankAd/README
create mode 100755 plugins/BlogspamNet/README
create mode 100755 plugins/CacheLog/README
create mode 100755 plugins/ConversationTree/README
create mode 100755 plugins/Cronish/README
create mode 100755 plugins/Diaspora/README
create mode 100755 plugins/DirectMessage/README
create mode 100755 plugins/DirectionDetector/README
create mode 100755 plugins/Directory/README
create mode 100755 plugins/DiskCache/README
create mode 100755 plugins/DomainStatusNetwork/README
create mode 100755 plugins/DomainWhitelist/README
create mode 100755 plugins/EmailRegistration/README
create mode 100755 plugins/EmailReminder/README
create mode 100755 plugins/EmailSummary/README
create mode 100644 plugins/Event/README
create mode 100644 plugins/ExtendedProfile/README
create mode 100644 plugins/Favorite/README
create mode 100644 plugins/FeedPoller/README
create mode 100644 plugins/FollowEveryone/README
create mode 100644 plugins/ForceGroup/README
create mode 100644 plugins/GNUsocialPhoto/README
create mode 100644 plugins/GNUsocialPhotos/README
create mode 100644 plugins/GNUsocialVideo/README
create mode 100644 plugins/GeoURL/README
create mode 100644 plugins/Geonames/README
create mode 100644 plugins/GroupFavorited/README
create mode 100644 plugins/GroupPrivateMessage/README
create mode 100644 plugins/ImageMagick/README
create mode 100644 plugins/InProcessCache/README
create mode 100644 plugins/LRDD/README
create mode 100644 plugins/LilUrl/README
create mode 100644 plugins/Linkback/README
create mode 100644 plugins/LogFilter/README
create mode 100644 plugins/Mapstraction/README
create mode 100644 plugins/Memcache/README
create mode 100644 plugins/Memcached/README
create mode 100644 plugins/MentionURL/README
create mode 100644 plugins/Mobile/README
create mode 100644 plugins/MobileProfile/README
create mode 100644 plugins/ModHelper/README
create mode 100644 plugins/ModLog/README
create mode 100644 plugins/ModPlus/README
create mode 100644 plugins/NoticeTitle/README
create mode 100644 plugins/OfflineBackup/README
create mode 100644 plugins/OpenExternalLinkTarget/README
create mode 100644 plugins/OpenID/README
create mode 100644 plugins/OpenX/README
create mode 100644 plugins/Orbited/README
create mode 100644 plugins/PiwikAnalytics/README
create mode 100644 plugins/PostDebug/README
create mode 100644 plugins/PtitUrl/README
create mode 100644 plugins/QnA/README
create mode 100644 plugins/RegisterThrottle/README
create mode 100644 plugins/SQLProfile/README
create mode 100644 plugins/SQLStats/README
create mode 100644 plugins/Sample/README
create mode 100644 plugins/SearchSub/README
create mode 100644 plugins/Share/README
create mode 100644 plugins/ShareNotice/README
create mode 100644 plugins/SimpleCaptcha/README
create mode 100644 plugins/SimpleUrl/README
create mode 100644 plugins/SiteNoticeInSidebar/README
create mode 100644 plugins/Sitemap/README
create mode 100644 plugins/SlicedFavorites/README
create mode 100644 plugins/StoreRemoteMedia/README
create mode 100644 plugins/SubMirror/README
create mode 100644 plugins/SubscriptionThrottle/README
create mode 100644 plugins/TabFocus/README
create mode 100644 plugins/TagSub/README
create mode 100644 plugins/TightUrl/README
create mode 100644 plugins/UserFlag/README
create mode 100644 plugins/UserLimit/README
create mode 100644 plugins/VideoThumbnails/README
create mode 100644 plugins/WebFinger/README
create mode 100644 plugins/WikiHashtags/REAME
diff --git a/plugins/ActivitySpam/README b/plugins/ActivitySpam/README
new file mode 100755
index 0000000000..6202c64a9e
--- /dev/null
+++ b/plugins/ActivitySpam/README
@@ -0,0 +1,23 @@
+The ActivitySpam plugin is a spam filter for GNU social.
+
+It needs to connect to a activityspam server.
+You can run one yourself: https://github.com/e14n/activityspam
+Or use a public instance ( ex: https://spamicity.info/ )
+
+Installation
+============
+add "addPlugin('ActivitySpam');"
+to the bottom of your config.php
+
+Settings
+========
+server: URL to the activityspam server
+consumerkey: The "key" provided by the activityspam server after you've registered and configured an account.
+secret: The "secret" provided by the activityspam server after you've registered and configured an account
+
+Example
+=======
+$config['activityspam']['server'] = 'https://spamicity.info/';
+$config['activityspam']['consumerkey'] = 'CONSUMER_KEY';
+$config['activityspam']['secret'] = 'SECRET';
+addPlugin('ActivitySpam');
diff --git a/plugins/AnonymousFave/README b/plugins/AnonymousFave/README
new file mode 100755
index 0000000000..fbe3386775
--- /dev/null
+++ b/plugins/AnonymousFave/README
@@ -0,0 +1,14 @@
+The Anonymous Fave plugin allows anonymous (not logged in) users to favorite notices
+
+Installation
+============
+add "addPlugin('AnonymousFave');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('AnonymousFave');
diff --git a/plugins/AntiBrute/README b/plugins/AntiBrute/README
new file mode 100755
index 0000000000..ef1a486171
--- /dev/null
+++ b/plugins/AntiBrute/README
@@ -0,0 +1,11 @@
+The AntiBrute plugin implements a time delay between successive failed login
+attempts to slow down brute force attacks ( https://en.wikipedia.org/wiki/Brute-force_attack#Countermeasures ).
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/ApiLogger/README b/plugins/ApiLogger/README
new file mode 100755
index 0000000000..9257ac04fd
--- /dev/null
+++ b/plugins/ApiLogger/README
@@ -0,0 +1,18 @@
+The ApiLogger plugin allows random sampling of API requests.
+
+Installation
+============
+add "addPlugin('ApiLogger');"
+to the bottom of your config.php
+
+Settings
+========
+frequency: How often to sample (number between 0.0 and 1.0 representing
+percentage -- e.g.: 0.1 will check about 10% of hits). Default 1.0
+
+Example
+=======
+addPlugin('ApiLogger', array(
+ 'frequency' => 1.0
+));
+
diff --git a/plugins/Awesomeness/README b/plugins/Awesomeness/README
new file mode 100755
index 0000000000..51fa7cf0c7
--- /dev/null
+++ b/plugins/Awesomeness/README
@@ -0,0 +1,14 @@
+Fun sample plugin: tweaks input data and adds a 'Cornify' ( http://www.cornify.com ) widget to sidebar.
+
+Installation
+============
+add "addPlugin('Awesomeness');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('Awesomeness');
diff --git a/plugins/Blacklist/README b/plugins/Blacklist/README
new file mode 100755
index 0000000000..e36dec424e
--- /dev/null
+++ b/plugins/Blacklist/README
@@ -0,0 +1,17 @@
+Plugin to prevent use of nicknames or URLs on a blacklist
+
+Installation
+============
+add "addPlugin('Blacklist');"
+to the bottom of your config.php
+
+Settings
+========
+nicknames: Array of nicknames to blacklist
+urls: Array of URLs to blacklist
+
+Example
+=======
+$config['blacklist']['nicknames'] = array('bad_nickname', 'worse_nickname');
+$config['blacklist']['urls'] = array('http://example.org', 'http://example.net');
+addPlugin('Blacklist');
diff --git a/plugins/BlankAd/README b/plugins/BlankAd/README
new file mode 100755
index 0000000000..68be82b0c8
--- /dev/null
+++ b/plugins/BlankAd/README
@@ -0,0 +1,14 @@
+Plugin for testing ad layout
+
+This plugin uses the UAPPlugin framework to output ad content. However,
+its ad content is just images with one red pixel stretched to the
+right size. It's mostly useful for debugging theme layout.
+
+To use this plugin, set the parameter for the ad size you want to use
+to true (or anything non-null).
+
+Example
+=======
+To make a leaderboard:
+
+addPlugin('BlankAd', array('leaderboard' => true));
diff --git a/plugins/BlogspamNet/README b/plugins/BlogspamNet/README
new file mode 100755
index 0000000000..d4884bb9fe
--- /dev/null
+++ b/plugins/BlogspamNet/README
@@ -0,0 +1,22 @@
+Plugin to check submitted notices with blogspam.net
+
+When new notices are saved, we check their text with blogspam.net (or
+a compatible service).
+
+Blogspam.net is supposed to catch blog comment spam. Some of its tests
+(min/max size, bayesian match) gave a lot of false positives so those
+tests are turned off by default.
+
+Installation
+============
+add "addPlugin('BlogspamNet');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('BlogspamNet');
+
diff --git a/plugins/CacheLog/README b/plugins/CacheLog/README
new file mode 100755
index 0000000000..fea7767733
--- /dev/null
+++ b/plugins/CacheLog/README
@@ -0,0 +1,23 @@
+Log cache access
+
+Adds "Cache MISS, Cache HIT, set cache value, delete cache value" etc.
+information to the log file.
+
+Note: entries are logged at the LOG_INFO level.
+
+Installation
+============
+add "addPlugin('CacheLog');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+Note that since most caching plugins return false for StartCache*
+methods, you should add this plugin before them, i.e.
+
+ addPlugin('CacheLog');
+ addPlugin('XCache');
diff --git a/plugins/ClientSideShorten/README b/plugins/ClientSideShorten/README
index 70300a85b4..c9d6d6cb27 100644
--- a/plugins/ClientSideShorten/README
+++ b/plugins/ClientSideShorten/README
@@ -3,5 +3,5 @@ shorten URLs as they entered, and before the notice is submitted.
Installation
============
-Add "addPlugin('ClientSideShorten');" to the bottom of your config.php
-That's it!
+This plugin is enabled by default
+
diff --git a/plugins/ConversationTree/README b/plugins/ConversationTree/README
new file mode 100755
index 0000000000..5eea62afab
--- /dev/null
+++ b/plugins/ConversationTree/README
@@ -0,0 +1,15 @@
+The ConversationTree plugin displays conversation replies in a hierarchical
+manner like StatusNet pre-v1.0 used to.
+
+Installation
+============
+add "addPlugin('ConversationTree');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ConversationTree');
diff --git a/plugins/Cronish/README b/plugins/Cronish/README
new file mode 100755
index 0000000000..9729699327
--- /dev/null
+++ b/plugins/Cronish/README
@@ -0,0 +1,12 @@
+The Cronish plugin executes events on a near-minutely/hour/day/week basis.
+
+Intervals are approximate and will vary depending on how busy
+the instance is.
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
diff --git a/plugins/Diaspora/README b/plugins/Diaspora/README
new file mode 100755
index 0000000000..a3b45328ec
--- /dev/null
+++ b/plugins/Diaspora/README
@@ -0,0 +1,17 @@
+The Diaspora plugin allows GNU social users to subscribe to Diaspora feeds
+
+Note: The feeds are read-only at the moment. That is, replying to an entry
+coming from Diaspora will not propagate to Diaspora.
+
+Installation
+============
+add "addPlugin('Diaspora');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('Diaspora');
diff --git a/plugins/DirectMessage/README b/plugins/DirectMessage/README
new file mode 100755
index 0000000000..b908a2472f
--- /dev/null
+++ b/plugins/DirectMessage/README
@@ -0,0 +1,10 @@
+The DirectMessage plugin allows users to send Direct Message to other local users
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/DirectionDetector/README b/plugins/DirectionDetector/README
new file mode 100755
index 0000000000..efb0d1acc9
--- /dev/null
+++ b/plugins/DirectionDetector/README
@@ -0,0 +1,15 @@
+The DirectionDetector plugin detects notices with RTL content and displays them
+in the correct direction.
+
+Installation
+============
+add "addPlugin('DirectionDetector');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('DirectionDetector');
diff --git a/plugins/Directory/README b/plugins/Directory/README
new file mode 100755
index 0000000000..d87185c8fe
--- /dev/null
+++ b/plugins/Directory/README
@@ -0,0 +1,15 @@
+The Directory plugin adds a user directory (list)
+
+Installation
+============
+This plugin is enabled by default except on single-user instances, in which
+case, it can be enabled by adding "addPlugin('Directory');" to the bottom of
+your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('Directory');
diff --git a/plugins/DiskCache/README b/plugins/DiskCache/README
new file mode 100755
index 0000000000..488b2c2b06
--- /dev/null
+++ b/plugins/DiskCache/README
@@ -0,0 +1,17 @@
+The DiskCache plugin implements cache interface with disk files.
+
+Installation
+============
+add "addPlugin('DiskCache');"
+to the bottom of your config.php
+
+Settings
+========
+root: Directory where to save cache data. Default /tmp
+
+Example
+=======
+addPlugin('DiskCache', array(
+ 'root' => '/tmp'
+));
+
diff --git a/plugins/DomainStatusNetwork/README b/plugins/DomainStatusNetwork/README
new file mode 100755
index 0000000000..00fdc7a3c5
--- /dev/null
+++ b/plugins/DomainStatusNetwork/README
@@ -0,0 +1,24 @@
+The DomainStatusNetwork plugin adds tools to map one status_network to one
+email domain in a multi-site installation.
+
+Relates to "status_network":
+* /scripts/setup.cfg.sample
+* /scripts/setup_status_network.sh
+* /scripts/settag.php
+* /scripts/delete_status_network.sh
+* /scripts/move_status_network.sh
+
+
+Installation
+============
+add "addPlugin('DomainStatusNetwork');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('DomainStatusNetwork');
+
diff --git a/plugins/DomainWhitelist/README b/plugins/DomainWhitelist/README
new file mode 100755
index 0000000000..6e5afd6785
--- /dev/null
+++ b/plugins/DomainWhitelist/README
@@ -0,0 +1,16 @@
+The DomainWhitelist plugin restricts the email addresses in a domain to a
+select whitelist.
+
+Installation
+============
+add "addPlugin('DomainWhitelist');"
+to the bottom of your config.php
+
+Settings
+========
+whitelist: An array of whitelisted domains
+
+Example
+=======
+$config['email']['whitelist'] = array('example.org', 'example.net');
+addPlugin('DomainWhitelist');
diff --git a/plugins/EmailAuthentication/README b/plugins/EmailAuthentication/README
index 3fc40794be..780bf4648e 100644
--- a/plugins/EmailAuthentication/README
+++ b/plugins/EmailAuthentication/README
@@ -5,4 +5,9 @@ nickname and the provided password is checked.
Installation
============
-add "addPlugin('emailAuthentication');" to the bottom of your config.php.
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/EmailRegistration/README b/plugins/EmailRegistration/README
new file mode 100755
index 0000000000..5140208240
--- /dev/null
+++ b/plugins/EmailRegistration/README
@@ -0,0 +1,25 @@
+The EmailRegistration plugin allows user registration with just an email
+address.
+
+When users register, the part before '@' in their email address will become
+their nickname/username (normalized). In case of collisions, a auto-increment
+number will be added to the username.
+
+For example, if someone registers with "user@example.org", their username
+will be "user". If someone else registers with "user@example.net", their
+username will be user1, and so on.
+
+Installation
+============
+add "addPlugin('EmailRegistration');"
+to the bottom of your config.php
+
+Note: This plugin is enabled by default on private instances.
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('EmailRegistration');
diff --git a/plugins/EmailReminder/README b/plugins/EmailReminder/README
new file mode 100755
index 0000000000..3be8e77bff
--- /dev/null
+++ b/plugins/EmailReminder/README
@@ -0,0 +1,21 @@
+The EmailReminder plugin sends email reminders about various things
+
+It will send reminder emails to email addresses that have been invited
+but haven't registered yet.
+
+It will also send reminders to email addresses that have registered but
+haven't verified their email address yet.
+
+Installation
+============
+add "addPlugin('EmailReminder');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('EmailReminder');
+
diff --git a/plugins/EmailSummary/README b/plugins/EmailSummary/README
new file mode 100755
index 0000000000..1c648e8d43
--- /dev/null
+++ b/plugins/EmailSummary/README
@@ -0,0 +1,22 @@
+The EmailSummary plugin sends an email summary of the inbox to users in the
+network.
+
+After enabling the plugin, users will have an option to enable/disable the
+feature in their "Email Settings" section.
+
+You can run ./script/sendemailsummary.php to send emails (options are
+documented in the file). You can run this script automatically via your OS's
+cron mechanism to send emails regularly.
+
+Installation
+============
+add "addPlugin('EmailSummary');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('EmailSummary');
diff --git a/plugins/Event/README b/plugins/Event/README
new file mode 100644
index 0000000000..9b30dd1f5b
--- /dev/null
+++ b/plugins/Event/README
@@ -0,0 +1,10 @@
+The Event plugin adds event invitations and RSVPs types of notices.
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/ExtendedProfile/README b/plugins/ExtendedProfile/README
new file mode 100644
index 0000000000..f1d32dd3d6
--- /dev/null
+++ b/plugins/ExtendedProfile/README
@@ -0,0 +1,23 @@
+The ExtendedProfile plugin adds additional profile fields such as:
+
+* Phone
+* IM
+* Website
+* Work experience
+* Education
+
+Installation
+============
+add "addPlugin('ExtendedProfile');"
+to the bottom of your config.php
+
+Note: This plugin is enabled by default on private instances.
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ExtendedProfile');
+
diff --git a/plugins/Favorite/README b/plugins/Favorite/README
new file mode 100644
index 0000000000..7032d92e70
--- /dev/null
+++ b/plugins/Favorite/README
@@ -0,0 +1,11 @@
+The Favorite plugin adds the ability to mark a notice as a "favorite"
+(i.e. "like").
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/FeedPoller/README b/plugins/FeedPoller/README
new file mode 100644
index 0000000000..11f28f2ba4
--- /dev/null
+++ b/plugins/FeedPoller/README
@@ -0,0 +1,16 @@
+The FeedPoller plugin allows users to subscribe to non-PuSH-enabled feeds
+by regularly polling the source for new content.
+
+Installation
+============
+add "addPlugin('FeedPoller');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('FeedPoller');
+
diff --git a/plugins/FollowEveryone/README b/plugins/FollowEveryone/README
new file mode 100644
index 0000000000..4c97f787e0
--- /dev/null
+++ b/plugins/FollowEveryone/README
@@ -0,0 +1,16 @@
+The FollowEveryone plugin makes it so that when a new user registers, all
+existing users follow them automatically.
+
+Installation
+============
+add "addPlugin('FollowEveryone');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('FollowEveryone');
+
diff --git a/plugins/ForceGroup/README b/plugins/ForceGroup/README
new file mode 100644
index 0000000000..f906a7950a
--- /dev/null
+++ b/plugins/ForceGroup/README
@@ -0,0 +1,16 @@
+The ForceGroup plugin allows forced group memberships and forces all notices
+to appear in groups that users were forced in.
+
+Installation
+============
+add "addPlugin('ForceGroup');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ForceGroup');
+
diff --git a/plugins/GNUsocialPhoto/README b/plugins/GNUsocialPhoto/README
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/plugins/GNUsocialPhotos/README b/plugins/GNUsocialPhotos/README
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/plugins/GNUsocialVideo/README b/plugins/GNUsocialVideo/README
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/plugins/GeoURL/README b/plugins/GeoURL/README
new file mode 100644
index 0000000000..838152d19c
--- /dev/null
+++ b/plugins/GeoURL/README
@@ -0,0 +1,19 @@
+The GeoURL plugin add extra headers for certain pages that geourl.org
+understands and pings geourl.org when those pages are created.
+
+Note: The third-party service that this plugin depends on (geourl.org) seems to
+be dead.
+
+Installation
+============
+add "addPlugin('GeoURL');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('GeoURL');
+
diff --git a/plugins/Geonames/README b/plugins/Geonames/README
new file mode 100644
index 0000000000..ff548503c9
--- /dev/null
+++ b/plugins/Geonames/README
@@ -0,0 +1,19 @@
+The Geonames plugin uses geonames.org to get human-readable names for locations
+based on user-provided lat/long pairs.
+
+The human-readable names appear after notices that have a lat/long location
+attached to them.
+
+Installation
+============
+add "addPlugin('Geonames');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('Geonames');
+
diff --git a/plugins/GroupFavorited/README b/plugins/GroupFavorited/README
new file mode 100644
index 0000000000..2652e1c795
--- /dev/null
+++ b/plugins/GroupFavorited/README
@@ -0,0 +1,15 @@
+The GroupFavorited plugin adds a menu item for popular notices in groups.
+
+Installation
+============
+add "addPlugin('GroupFavorited');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('GroupFavorited');
+
diff --git a/plugins/GroupPrivateMessage/README b/plugins/GroupPrivateMessage/README
new file mode 100644
index 0000000000..04801c97f6
--- /dev/null
+++ b/plugins/GroupPrivateMessage/README
@@ -0,0 +1,15 @@
+The GroupPrivateMessage plugin allows users to send private messages to a group.
+
+Installation
+============
+add "addPlugin('GroupPrivateMessage');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('GroupPrivateMessage');
+
diff --git a/plugins/ImageMagick/README b/plugins/ImageMagick/README
new file mode 100644
index 0000000000..8994ec3583
--- /dev/null
+++ b/plugins/ImageMagick/README
@@ -0,0 +1,21 @@
+The ImageMagick plugin handles more kinds of image formats for thumbnails,
+thanks to ImageMagick.
+
+Note: This plugin depends on php5-imagick
+
+Installation
+============
+add "addPlugin('ImageMagick');"
+to the bottom of your config.php
+
+Settings
+========
+animated: Whether to resize animated GIFs.
+
+Note: We are not infinitely fast, so resizing animated GIFs is _not_ recommended.
+
+Example
+=======
+$config['thumbnail']['animated'] = true;
+addPlugin('ImageMagick');
+
diff --git a/plugins/InProcessCache/README b/plugins/InProcessCache/README
new file mode 100644
index 0000000000..4efa43a4db
--- /dev/null
+++ b/plugins/InProcessCache/README
@@ -0,0 +1,23 @@
+The InProcessCache plugin adds an extra level of in-process caching to any
+regular cache system like APC, XCache, or Memcache.
+
+Installation
+============
+add "addPlugin('InProcessCache');"
+to the bottom of your config.php
+
+Settings
+========
+stats: Whether to dump statistics (cache size, etc) in the log file.
+
+Note: entries are logged at the LOG_INFO level.
+
+Example
+=======
+Note: since most caching plugins return false for StartCache* methods, you
+should add this plugin before them, i.e.
+
+ $config['inprocess']['stats'] = true;
+ addPlugin('InProcessCache');
+ addPlugin('XCache');
+
diff --git a/plugins/LRDD/README b/plugins/LRDD/README
new file mode 100644
index 0000000000..843ea0c35c
--- /dev/null
+++ b/plugins/LRDD/README
@@ -0,0 +1,14 @@
+The LRDD plugin implements Link-based Resource Descriptor Discovery
+based on RFC6415, Web Host Metadata, i.e. the predecessor to WebFinger resource
+discovery.
+
+See: http://tools.ietf.org/html/rfc6415
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/LilUrl/README b/plugins/LilUrl/README
new file mode 100644
index 0000000000..f52bdc77a2
--- /dev/null
+++ b/plugins/LilUrl/README
@@ -0,0 +1,17 @@
+The LilUrl plugin shortens URLs via a lilURL instance.
+
+See: http://lilurl.sourceforge.net/
+
+Installation
+============
+add "addPlugin('LilUrl', array('serviceUrl' => 'http://example.org'));"
+to the bottom of your config.php
+
+Settings
+========
+serviceUrl: The URL to the LilUrl instance.
+
+Example
+=======
+addPlugin('LilUrl', array('serviceUrl' => 'http://example.org'));
+
diff --git a/plugins/LinkPreview/README b/plugins/LinkPreview/README
index a1b1a87303..e15c67a1a3 100644
--- a/plugins/LinkPreview/README
+++ b/plugins/LinkPreview/README
@@ -1 +1,23 @@
-Depends on the oEmbed plugin (Oembed)
+The LinkPreview plugin adds a UI for previewing thumbnails from links.
+
+Note: This plugin depends on the "Oembed" plugin.
+
+Installation
+============
+add "addPlugin('LinkPreview');"
+to the bottom of your config.php
+
+Settings
+========
+process_links: Whether to process links or not
+thumbwidth: The width of the link preview
+thumbheight: The height of the link preview
+
+Example
+=======
+addPlugin('Oembed'); // Dependency
+$config['attachments']['process_links'] = true;
+$config['attachments']['thumbwidth'] = 42;
+$config['attachments']['thumbheight'] = 42;
+addPlugin('LinkPreview');
+
diff --git a/plugins/Linkback/README b/plugins/Linkback/README
new file mode 100644
index 0000000000..29b493d54f
--- /dev/null
+++ b/plugins/Linkback/README
@@ -0,0 +1,19 @@
+The Linkback plugin performs linkbacks (pingbacks, trackbacks, webmentions) for
+notices containing links.
+
+See:
+* https://en.wikipedia.org/wiki/Linkback
+
+Installation
+============
+add "addPlugin('Linkback');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('Linkback');
+
diff --git a/plugins/LogFilter/README b/plugins/LogFilter/README
new file mode 100644
index 0000000000..fbd54e1663
--- /dev/null
+++ b/plugins/LogFilter/README
@@ -0,0 +1,20 @@
+The LogFilter plugin provides server-side setting to filter log output by type or keyword.
+
+Installation
+============
+add "addPlugin('LogFilter');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+Disable all debug messages and those containing 'About to push':
+
+addPlugin('LogFilter', array(
+ 'priority' => array(LOG_DEBUG => false),
+ 'regex' => array('/About to push/' => false)
+));
+
diff --git a/plugins/Mapstraction/README b/plugins/Mapstraction/README
new file mode 100644
index 0000000000..6a062cc7e9
--- /dev/null
+++ b/plugins/Mapstraction/README
@@ -0,0 +1,21 @@
+The Mapstraction plugin provides map visualization of location data.
+
+Show maps of users' and friends' notices with http://www.mapstraction.com/.
+
+Installation
+============
+add "addPlugin('Mapstraction');"
+to the bottom of your config.php
+
+Settings
+========
+provider: Name of the service providing maps ('cloudmade', 'google', 'microsoft', 'openlayers', 'yahoo')
+apikey: provider API key (or 'appid'), if required
+
+Example
+=======
+addPlugin('Mapstraction', array(
+ 'provider' => 'openlayers',
+ 'apikey' => 'API_KEY'
+));
+
diff --git a/plugins/Memcache/README b/plugins/Memcache/README
new file mode 100644
index 0000000000..1344be8294
--- /dev/null
+++ b/plugins/Memcache/README
@@ -0,0 +1,28 @@
+The Memcache plugin implements cache interface for memcache.
+
+See: http://memcached.org/
+
+Installation
+============
+add "addPlugin('Memcache');"
+to the bottom of your config.php
+
+Settings
+========
+servers: Array of memcache servers addresses
+defaultExpiry: How long before cache expires (in seconds)
+compressThreshold: Items over this size threshold are eligible for compression (in bytes)
+compressMinSaving: If the compression would save more than this ratio, items are eligible for compression
+
+Note: To be compressed, an item must be both over the size threshold AND save
+more than the minimum ratio.
+
+Example
+=======
+addPlugin('Memcache', array(
+ 'servers' => array('127.0.0.1;11211'),
+ 'compressThreshold' => 20480,
+ 'compressMinSaving' => 0.2,
+ 'defaultExpiry' => 86400 // 24h
+));
+
diff --git a/plugins/Memcached/README b/plugins/Memcached/README
new file mode 100644
index 0000000000..05ae884b02
--- /dev/null
+++ b/plugins/Memcached/README
@@ -0,0 +1,21 @@
+The Memcached plugin implements cache interface for memcached.
+
+See: http://memcached.org/
+
+Installation
+============
+add "addPlugin('Memcached');"
+to the bottom of your config.php
+
+Settings
+========
+servers: Array of memcached servers addresses
+defaultExpiry: How long before cache expires (in seconds)
+
+Example
+=======
+addPlugin('Memcached', array(
+ 'servers' => array('127.0.0.1;11211'),
+ 'defaultExpiry' => 86400 // 24h
+));
+
diff --git a/plugins/MentionURL/README b/plugins/MentionURL/README
new file mode 100644
index 0000000000..1c7475da36
--- /dev/null
+++ b/plugins/MentionURL/README
@@ -0,0 +1,15 @@
+The MentionURL plugin allows mentioning arbitrary URLs.
+
+Installation
+============
+add "addPlugin('MentionURL');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('MentionURL');
+
diff --git a/plugins/Mobile/README b/plugins/Mobile/README
new file mode 100644
index 0000000000..04e5b43409
--- /dev/null
+++ b/plugins/Mobile/README
@@ -0,0 +1,10 @@
+Superclass for WAP 2.0 support
+
+Installation
+============
+N/A
+
+Settings
+========
+none
+
diff --git a/plugins/MobileProfile/README b/plugins/MobileProfile/README
new file mode 100644
index 0000000000..ca6dd6a176
--- /dev/null
+++ b/plugins/MobileProfile/README
@@ -0,0 +1,20 @@
+The MobileProfile plugin implements XHTML MobileProfile output for supporting
+user agents.
+
+See: https://en.wikipedia.org/wiki/XHTML_Mobile_Profile
+
+Installation
+============
+add "addPlugin('MobileProfile');"
+to the bottom of your config.php
+
+Note: This plugin is enabled by default on private and single-user instances.
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('MobileProfile');
+
diff --git a/plugins/ModHelper/README b/plugins/ModHelper/README
new file mode 100644
index 0000000000..c968f8a827
--- /dev/null
+++ b/plugins/ModHelper/README
@@ -0,0 +1,16 @@
+The ModHelperPlugin plugin lets users who have been manually marked as
+"modhelper"s silence accounts.
+
+Installation
+============
+add "addPlugin('ModHelperPlugin');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ModHelperPlugin');
+
diff --git a/plugins/ModLog/README b/plugins/ModLog/README
new file mode 100644
index 0000000000..263d4970fb
--- /dev/null
+++ b/plugins/ModLog/README
@@ -0,0 +1,15 @@
+The ModLog plugin shows the moderation history for a profile in the sidebar.
+
+Installation
+============
+add "addPlugin('ModLog');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ModLog');
+
diff --git a/plugins/ModPlus/README b/plugins/ModPlus/README
new file mode 100644
index 0000000000..313453bff6
--- /dev/null
+++ b/plugins/ModPlus/README
@@ -0,0 +1,15 @@
+The ModPlus plugin shows UI extension for profile moderation actions.
+
+Installation
+============
+add "addPlugin('ModPlus');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('ModPlus');
+
diff --git a/plugins/NoticeTitle/README b/plugins/NoticeTitle/README
new file mode 100644
index 0000000000..9f994db881
--- /dev/null
+++ b/plugins/NoticeTitle/README
@@ -0,0 +1,17 @@
+The NoticeTitle plugin allows users to add titles to notices.
+
+Installation
+============
+add "addPlugin('NoticeTitle');"
+to the bottom of your config.php
+
+Settings
+========
+restricted: Whether this option is restriced to users with the "richedit" role.
+
+Example
+=======
+addPlugin('NoticeTitle', array(
+ 'restricted' => false
+));
+
diff --git a/plugins/Oembed/README b/plugins/Oembed/README
index be8c09f7a6..b5e1aeae1f 100644
--- a/plugins/Oembed/README
+++ b/plugins/Oembed/README
@@ -1 +1,29 @@
-It's really called oEmbed.
+The Oembed plugin for using and representing oEmbed data.
+
+See: http://www.oembed.com/
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+width: Maximum width of the thumbnail in pixels.
+height: Maximum height of the thumbnail in pixels.
+show_html: Whether to show HTML oEmbed data.
+domain_whitelist: Array of regular expressions. Always escape your dots and end your strings.
+check_whitelist: Whether to check the domain_whitelist.
+
+Example
+=======
+$config['thumbnail']['width'] = 42;
+$config['thumbnail']['height'] = 42;
+$config['attachments']['show_html'] = true;
+addPlugin('Oembed', array(
+ 'domain_whitelist' => array(
+ '^i\d*\.ytimg\.com$' => 'YouTube',
+ '^i\d*\.vimeocdn\.com$' => 'Vimeo'
+ ),
+ 'check_whitelist' => true
+));
+
diff --git a/plugins/OfflineBackup/README b/plugins/OfflineBackup/README
new file mode 100644
index 0000000000..17537f3561
--- /dev/null
+++ b/plugins/OfflineBackup/README
@@ -0,0 +1,16 @@
+The OfflineBackup plugin backups user data in offline queue and email when
+ready.
+
+Installation
+============
+add "addPlugin('OfflineBackup');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('OfflineBackup');
+
diff --git a/plugins/OpenExternalLinkTarget/README b/plugins/OpenExternalLinkTarget/README
new file mode 100644
index 0000000000..6d4db6437a
--- /dev/null
+++ b/plugins/OpenExternalLinkTarget/README
@@ -0,0 +1,15 @@
+The OpenExternalLinkTarget plugin opens external links in a new window or tab.
+
+Installation
+============
+add "addPlugin('OpenExternalLinkTarget');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('OpenExternalLinkTarget');
+
diff --git a/plugins/OpenID/README b/plugins/OpenID/README
new file mode 100644
index 0000000000..17114a1dc6
--- /dev/null
+++ b/plugins/OpenID/README
@@ -0,0 +1,21 @@
+The OpenID plugin allows users to use OpenID to login.
+
+See: http://openid.net/
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+openidonly: Whether we only allow logins through OpenID.
+trusted_provider: URL to the OpenID provider.
+append_username: Whether to append the username at the end of the OpenID URL
+
+Example
+=======
+$config['site']['openidonly'] = true;
+$config['openid']['trusted_provider'] = "http://example.org";
+$config['openid']['append_username'] = true;
+addPlugin('OpenID');
+
diff --git a/plugins/OpenX/README b/plugins/OpenX/README
new file mode 100644
index 0000000000..6b05e8e4a5
--- /dev/null
+++ b/plugins/OpenX/README
@@ -0,0 +1,26 @@
+The OpenX plugin enables support for OpenX Ad Server.
+
+See: http://www.openx.org/
+
+Installation
+============
+add "addPlugin('OpenX');"
+to the bottom of your config.php
+
+Settings
+========
+mediumRectangle:
+rectangle:
+leaderboard:
+wideSkyscraper:
+adScript:
+
+Example
+=======
+$config['openx']['mediumRectangle'] = '';
+$config['openx']['rectangle'] = '';
+$config['openx']['leaderboard'] = '';
+$config['openx']['wideSkyscraper'] = '';
+$config['openx']['adScript'] = '';
+addPlugin('OpenX');
+
diff --git a/plugins/Orbited/README b/plugins/Orbited/README
new file mode 100644
index 0000000000..20d0598e24
--- /dev/null
+++ b/plugins/Orbited/README
@@ -0,0 +1,37 @@
+The Orbited plugin enables "real time" updates using Orbited + STOMP
+
+See:
+* https://pypi.python.org/pypi/orbited
+* https://en.wikipedia.org/wiki/Streaming_Text_Oriented_Messaging_Protocol
+
+Installation
+============
+add "addPlugin('Orbited');"
+to the bottom of your config.php
+
+Settings
+========
+webserver:
+webport:
+channelbase:
+stompserver:
+stompport:
+username:
+password:
+webuser:
+webpass:
+
+Example
+=======
+addPlugin('Orbited', array(
+ 'webserver' => '',
+ 'webport' => '',
+ 'channelbase' => '',
+ 'stompserver' => '',
+ 'stompport' => '',
+ 'username' => '',
+ 'password' => '',
+ 'webuser' => '',
+ 'webpass' => ''
+));
+
diff --git a/plugins/PiwikAnalytics/README b/plugins/PiwikAnalytics/README
new file mode 100644
index 0000000000..6d47ee89ff
--- /dev/null
+++ b/plugins/PiwikAnalytics/README
@@ -0,0 +1,23 @@
+The PiwikAnalytics plugin adds JavaScript that sends various traffic details
+to a Piwik server to track web access.
+
+See:
+* http://piwik.org/
+
+Installation
+============
+add "addPlugin('PiwikAnalytics');"
+to the bottom of your config.php
+
+Settings
+========
+piwikroot: The root installation URL of the Piwik instance WITHOUT the protocol
+piwikId: The ID provided by the Pwiki instance.
+
+Example
+=======
+addPlugin('PiwikAnalytics', array(
+ 'piwikroot' => 'example.org/piwik/',
+ 'piwikId' => 'PIWIK_ID'
+));
+
diff --git a/plugins/PostDebug/README b/plugins/PostDebug/README
new file mode 100644
index 0000000000..61a69725d3
--- /dev/null
+++ b/plugins/PostDebug/README
@@ -0,0 +1,18 @@
+The PostDebug plugin records detailed data on POSTs requests.
+
+Installation
+============
+add "addPlugin('PostDebug');"
+to the bottom of your config.php
+
+Settings
+========
+dir: The directory where the log file will be saved
+
+Example
+=======
+
+addPlugin('PostDebug', array(
+ 'dir' => '/tmp'
+));
+
diff --git a/plugins/PtitUrl/README b/plugins/PtitUrl/README
new file mode 100644
index 0000000000..507b9ecc26
--- /dev/null
+++ b/plugins/PtitUrl/README
@@ -0,0 +1,18 @@
+The PtitUrl plugin shortens URLS via a PtitUrl URL-shortener service
+
+Installation
+============
+add "addPlugin('PtitUrl');"
+to the bottom of your config.php
+
+Settings
+========
+serviceUrl: The URL to the PtitUrl instance
+
+Example
+=======
+
+addPlugin('PtitUrl', array(
+ 'serviceUrl' => 'http://example.org'
+));
+
diff --git a/plugins/QnA/README b/plugins/QnA/README
new file mode 100644
index 0000000000..c85b8d910d
--- /dev/null
+++ b/plugins/QnA/README
@@ -0,0 +1,10 @@
+The QnA plugin enables Questions and Answers type of notices
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/RegisterThrottle/README b/plugins/RegisterThrottle/README
new file mode 100644
index 0000000000..049bfd77c6
--- /dev/null
+++ b/plugins/RegisterThrottle/README
@@ -0,0 +1,24 @@
+The RegisterThrottle plugin throttles registration by IP address
+
+Installation
+============
+This plugin is enabled by default on public instances, otherwise it can be
+enabled by adding "addPlugin('RegisterThrottle');" to the bottom of your
+config.php
+
+Settings
+========
+regLimits: Array of time spans in seconds to limits. Default is 3 registrations per hour, 5 per day, 10 per week.
+silenced: Disallow registration if a silenced user has registered from this IP address
+
+Example
+=======
+addPlugin('RegisterThrottle', array(
+ 'regLimits' => array(
+ 604800 => 10, // per week
+ 86400 => 5, // per day
+ 3600 => 3 // per hour
+ ),
+ 'silenced' => true
+));
+
diff --git a/plugins/SQLProfile/README b/plugins/SQLProfile/README
new file mode 100644
index 0000000000..03b42b3262
--- /dev/null
+++ b/plugins/SQLProfile/README
@@ -0,0 +1,17 @@
+The SQLProfile plugin watches for poorly indexed DB queries.
+
+Installation
+============
+add "addPlugin('SQLProfile');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Note: entries are logged at the LOG_DEBUG level.
+
+Example
+=======
+addPlugin('SQLProfile');
+
diff --git a/plugins/SQLStats/README b/plugins/SQLStats/README
new file mode 100644
index 0000000000..0f840b1af5
--- /dev/null
+++ b/plugins/SQLStats/README
@@ -0,0 +1,18 @@
+The SQLStats plugin logs statistics on performed SQL queries.
+
+Installation
+============
+add "addPlugin('SQLStats');"
+to the bottom of your config.php
+
+Settings
+========
+verbose: whether to be verbose or not
+
+Note: entries are logged at the LOG_INFO level.
+
+Example
+=======
+$config['sqlstats']['verbose'] = false;
+addPlugin('SQLStats');
+
diff --git a/plugins/Sample/README b/plugins/Sample/README
new file mode 100644
index 0000000000..ff1188d8af
--- /dev/null
+++ b/plugins/Sample/README
@@ -0,0 +1,19 @@
+The Sample plugin shows best practices for development of GNU social plugins.
+
+It adds a "Hello" menu item to the default menu and tracks how many times it
+has greeted each user.
+
+Installation
+============
+add "addPlugin('Sample');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+
+addPlugin('Sample');
+
diff --git a/plugins/SearchSub/README b/plugins/SearchSub/README
new file mode 100644
index 0000000000..7e9e693a8e
--- /dev/null
+++ b/plugins/SearchSub/README
@@ -0,0 +1,10 @@
+The SearchSub plugin allows following all messages with a given search.
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/Share/README b/plugins/Share/README
new file mode 100644
index 0000000000..6ca78ac7d0
--- /dev/null
+++ b/plugins/Share/README
@@ -0,0 +1,10 @@
+The Share plugin implements "Shares" (repeats) type of notices
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/ShareNotice/README b/plugins/ShareNotice/README
new file mode 100644
index 0000000000..0379c594db
--- /dev/null
+++ b/plugins/ShareNotice/README
@@ -0,0 +1,23 @@
+The ShareNotice plugin allows sharing of notices to Twitter, Facebook and other
+platforms.
+
+Installation
+============
+add "addPlugin('ShareNotice');"
+to the bottom of your config.php
+
+Settings
+========
+targets: Array of platforms allowed to share to
+
+Example
+=======
+
+addPlugin('ShareNotice', array(
+ 'targets' => array(
+ array('Twitter'),
+ array('Facebook'),
+ array('StatusNet', array('baseurl' => 'http://example.org'))
+ )
+));
+
diff --git a/plugins/SimpleCaptcha/README b/plugins/SimpleCaptcha/README
new file mode 100644
index 0000000000..754fe13c16
--- /dev/null
+++ b/plugins/SimpleCaptcha/README
@@ -0,0 +1,10 @@
+A simple captcha to get rid of spambots.
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/SimpleUrl/README b/plugins/SimpleUrl/README
new file mode 100644
index 0000000000..5a9f953d5d
--- /dev/null
+++ b/plugins/SimpleUrl/README
@@ -0,0 +1,18 @@
+The SimpleUrl plugin shortens URLS via a SimpleUrl URL-shortener service
+
+Installation
+============
+add "addPlugin('SimpleUrl');"
+to the bottom of your config.php
+
+Settings
+========
+serviceUrl: The URL to the SimpleUrl instance
+
+Example
+=======
+
+addPlugin('SimpleUrl', array(
+ 'serviceUrl' => 'http://example.org'
+));
+
diff --git a/plugins/SiteNoticeInSidebar/README b/plugins/SiteNoticeInSidebar/README
new file mode 100644
index 0000000000..6e70cbc40e
--- /dev/null
+++ b/plugins/SiteNoticeInSidebar/README
@@ -0,0 +1,16 @@
+The SiteNoticeInSidebar plugin puts the site notice in the sidebar.
+
+Installation
+============
+add "addPlugin('SiteNoticeInSidebar');"
+to the bottom of your config.php
+
+Settings
+========
+notice: The text to use in the site notice
+
+Example
+=======
+$config['site']['notice'] = 'Site notice content';
+addPlugin('SiteNoticeInSidebar');
+
diff --git a/plugins/Sitemap/README b/plugins/Sitemap/README
new file mode 100644
index 0000000000..b6717da622
--- /dev/null
+++ b/plugins/Sitemap/README
@@ -0,0 +1,20 @@
+The Sitemap plugin creates a dynamic sitemap for Bing, Yahoo! and Google
+
+Installation
+============
+add "addPlugin('Sitemap');"
+to the bottom of your config.php
+
+Settings
+========
+googlekey: The key provided by Google
+yahookey: The key provided by Yahoo!
+bingkey: The key provided by Bing
+
+Example
+=======
+$config['sitemap']['googlekey'] = 'GOOGLE_KEY';
+$config['sitemap']['yahookey'] = 'YAHOO_KEY';
+$config['sitemap']['bingkey'] = 'BING_KEY';
+addPlugin('Sitemap');
+
diff --git a/plugins/SlicedFavorites/README b/plugins/SlicedFavorites/README
new file mode 100644
index 0000000000..550e2feeb4
--- /dev/null
+++ b/plugins/SlicedFavorites/README
@@ -0,0 +1,30 @@
+The SlicedFavorites plugin shows timelines of popular notices for defined
+subsets of users.
+
+Installation
+============
+add "addPlugin('SlicedFavorites');"
+to the bottom of your config.php
+
+Settings
+========
+slices: Array of subsets
+
+Example
+=======
+addPlugin('SlicedFavorites', array(
+ 'slices' => array(
+ // show only pop's notices on /favorited
+ 'default' => array('include' => array('pop')),
+
+ // show only son's notices on /favorited/blog
+ 'blog' => array('include' => array('son')),
+
+ // show all favorited notices except pop's and son's on /favorited/submitted
+ 'submitted' => array('exclude' => array('pop', 'son')),
+
+ // show all favorited notices on /favorited/everybody
+ 'everybody' => array(),
+ )
+));
+
diff --git a/plugins/SphinxSearch/README b/plugins/SphinxSearch/README
index 5a2c063bd0..873a8cf692 100644
--- a/plugins/SphinxSearch/README
+++ b/plugins/SphinxSearch/README
@@ -8,9 +8,9 @@ Configuration
In StatusNet's configuration, you can adjust the following settings
under 'sphinx':
-enabled: Set to true to enable. Default false.
-server: a string with the hostname of the sphinx server.
-port: an integer with the port number of the sphinx server.
+enabled: Set to true to enable. Default true.
+server: a string with the hostname of the sphinx server. Default localhost
+port: an integer with the port number of the sphinx server. Default 3312
Requirements
diff --git a/plugins/StoreRemoteMedia/README b/plugins/StoreRemoteMedia/README
new file mode 100644
index 0000000000..a6bd91f605
--- /dev/null
+++ b/plugins/StoreRemoteMedia/README
@@ -0,0 +1,22 @@
+The StoreRemoteMedia plugin downloads remotely attached files to local server.
+
+Installation
+============
+add "addPlugin('StoreRemoteMedia');"
+to the bottom of your config.php
+
+Settings
+========
+domain_whitelist: Array of regular expressions. Always escape your dots and end your strings.
+check_whitelist: Whether to check the domain_whitelist.
+
+Example
+=======
+addPlugin('StoreRemoteMedia', array(
+ 'domain_whitelist' => array(
+ '^i\d*\.ytimg\.com$' => 'YouTube',
+ '^i\d*\.vimeocdn\.com$' => 'Vimeo'
+ ),
+ 'check_whitelist' => true
+));
+
diff --git a/plugins/SubMirror/README b/plugins/SubMirror/README
new file mode 100644
index 0000000000..1910874d1c
--- /dev/null
+++ b/plugins/SubMirror/README
@@ -0,0 +1,15 @@
+The SubMirror plugin pull PuSH-enabled feeds into your timeline.
+
+Installation
+============
+add "addPlugin('SubMirror');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('SubMirror');
+
diff --git a/plugins/SubscriptionThrottle/README b/plugins/SubscriptionThrottle/README
new file mode 100644
index 0000000000..686ba2bc2f
--- /dev/null
+++ b/plugins/SubscriptionThrottle/README
@@ -0,0 +1,26 @@
+The SubscriptionThrottle plugin limits how fast users can subscribe to groups
+and other users.
+
+Installation
+============
+add "addPlugin('SubscriptionThrottle');"
+to the bottom of your config.php
+
+Settings
+========
+subLimits: Array of time spans in seconds to limit subscriptions to users.
+groupLimits: Array of time spans in seconds to limit subscriptions to groups.
+
+Example
+=======
+addPlugin('SubscriptionThrottle', array(
+ 'subLimits' => array(
+ 86400 => 100, // 100 subs per day
+ 3600 => 50; // 50 subs per hour
+ ),
+ 'groupLimits' => array(
+ 86400 => 50, // 50 subs per day
+ 3600 => 25; // 25 subs per hour
+ )
+));
+
diff --git a/plugins/TabFocus/README b/plugins/TabFocus/README
new file mode 100644
index 0000000000..61d7c60b2b
--- /dev/null
+++ b/plugins/TabFocus/README
@@ -0,0 +1,17 @@
+The TabFocus plugin changes the notice form behavior so that, while in the text
+area, pressing the tab key focuses the "Send" button, matching the behavior of
+Twitter.
+
+Installation
+============
+add "addPlugin('TabFocus');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('TabFocus');
+
diff --git a/plugins/TagSub/README b/plugins/TagSub/README
new file mode 100644
index 0000000000..a13d4bf471
--- /dev/null
+++ b/plugins/TagSub/README
@@ -0,0 +1,10 @@
+The TagSub plugin allows following all messages with a given tag.
+
+Installation
+============
+This plugin is enabled by default
+
+Settings
+========
+none
+
diff --git a/plugins/TightUrl/README b/plugins/TightUrl/README
new file mode 100644
index 0000000000..35abb3bb7d
--- /dev/null
+++ b/plugins/TightUrl/README
@@ -0,0 +1,18 @@
+The TightUrl plugin shortens URLS via a TightUrl URL-shortener service
+
+Installation
+============
+add "addPlugin('TightUrl');"
+to the bottom of your config.php
+
+Settings
+========
+serviceUrl: The URL to the TightUrl instance
+
+Example
+=======
+
+addPlugin('TightUrl', array(
+ 'serviceUrl' => 'http://example.org'
+));
+
diff --git a/plugins/UserFlag/README b/plugins/UserFlag/README
new file mode 100644
index 0000000000..9fbfcc7c01
--- /dev/null
+++ b/plugins/UserFlag/README
@@ -0,0 +1,18 @@
+The UserFlag plugin allows flagging of profiles for review and reviewing
+flagged profiles.
+
+Installation
+============
+add "addPlugin('UserFlag');"
+to the bottom of your config.php
+
+Settings
+========
+flagOnBlock: Whether to automatically flag a profile when a user blocks it.
+
+Example
+=======
+addPlugin('UserFlag', array(
+ 'flagOnBlock' => true
+));
+
diff --git a/plugins/UserLimit/README b/plugins/UserLimit/README
new file mode 100644
index 0000000000..07f32bb41e
--- /dev/null
+++ b/plugins/UserLimit/README
@@ -0,0 +1,17 @@
+The UserLimit plugin limits the number of users who can register.
+
+Installation
+============
+add "addPlugin('UserLimit');"
+to the bottom of your config.php
+
+Settings
+========
+maxUsers: The number of maximum users allowed.
+
+Example
+=======
+addPlugin('UserLimit', array(
+ 'maxUsers' => 42
+));
+
diff --git a/plugins/VideoThumbnails/README b/plugins/VideoThumbnails/README
new file mode 100644
index 0000000000..0967532c8c
--- /dev/null
+++ b/plugins/VideoThumbnails/README
@@ -0,0 +1,19 @@
+The VideoThumbnails plugin enables video thumbnail preview support.
+
+Installation
+============
+add "addPlugin('VideoThumbnails');"
+to the bottom of your config.php
+
+Note: This plugin depends on
+* avconv
+* php5-gd
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('VideoThumbnails');
+
diff --git a/plugins/WebFinger/README b/plugins/WebFinger/README
new file mode 100644
index 0000000000..3c49338515
--- /dev/null
+++ b/plugins/WebFinger/README
@@ -0,0 +1,10 @@
+The WebFinger plugin adds WebFinger lookup to GNU Social
+
+Installation
+============
+This plugin is enabled by default except on private instances
+
+Settings
+========
+none
+
diff --git a/plugins/WikiHashtags/REAME b/plugins/WikiHashtags/REAME
new file mode 100644
index 0000000000..209b0c3802
--- /dev/null
+++ b/plugins/WikiHashtags/REAME
@@ -0,0 +1,17 @@
+The WikiHashtags plugin shows WikiHashtags content in the sidebar
+
+See: http://hashtags.wikia.com/wiki/WikiHashtags
+
+Installation
+============
+add "addPlugin('WikiHashtags');"
+to the bottom of your config.php
+
+Settings
+========
+none
+
+Example
+=======
+addPlugin('WikiHashtags');
+
From 70d85c58e277b53272520f54a4e6a2c0a75f121c Mon Sep 17 00:00:00 2001
From: abjectio
Date: Thu, 11 Feb 2016 00:24:06 +0100
Subject: [PATCH 007/415] Enable configuration option for number of queuedaemon
threads
---
scripts/queuedaemon.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/queuedaemon.php b/scripts/queuedaemon.php
index 582a3dd888..efc1e04e9e 100755
--- a/scripts/queuedaemon.php
+++ b/scripts/queuedaemon.php
@@ -169,6 +169,9 @@ if (have_option('t')) {
$threads = intval(get_option_value('--threads'));
} else {
$threads = 0;
+ //If there is no argument for number of threads
+ //Try reading a config option for the number
+ $threads = common_config('queue','threads');
}
if (!$threads) {
$threads = getProcessorCount();
From 501d081d3ba9daddb3adf91cff4c496f1b45b3a9 Mon Sep 17 00:00:00 2001
From: hannes
Date: Tue, 16 Feb 2016 19:16:05 +0000
Subject: [PATCH 008/415] getKV doesn't throw exception
---
classes/File_redirection.php | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/classes/File_redirection.php b/classes/File_redirection.php
index 32c9cc7a3a..8ce715e699 100644
--- a/classes/File_redirection.php
+++ b/classes/File_redirection.php
@@ -170,19 +170,22 @@ class File_redirection extends Managed_DataObject
try {
$r = File_redirection::getByUrl($in_url);
- try {
- $f = File::getKV('id',$r->file_id);
+
+ $f = File::getKV('id',$r->file_id);
+
+ if($file instanceof File) {
$r->file = $f;
- $r->redir_url = $f->url;
- } catch (NoResultException $e) {
+ $r->redir_url = $f->url;
+ } else {
// Invalid entry, delete and run again
common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and and trying again...");
$r->delete();
- return self::where($in_url);
+ return self::where($in_url);
}
+
// File_redirecion and File record found, return both
return $r;
-
+
} catch (NoResultException $e) {
// File_redirecion record not found, but this might be a direct link to a file
try {
@@ -207,15 +210,17 @@ class File_redirection extends Managed_DataObject
// in that case we have the file id already
try {
$r = File_redirection::getByUrl($redir_info['url']);
- try {
- $f = File::getKV('id',$r->file_id);
+
+ $f = File::getKV('id',$r->file_id);
+
+ if($f instanceof File) {
$redir->file = $f;
- $redir->redir_url = $f->url;
- } catch (NoResultException $e) {
+ $redir->redir_url = $f->url;
+ } else {
// Invalid entry in File_redirection, delete and run again
common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File_redirection entry and trying again...");
$r->delete();
- return self::where($in_url);
+ return self::where($in_url);
}
} catch (NoResultException $e) {
// save the file now when we know that we don't have it in File_redirection
From 3ef573f67c33010c4656c546e5243f0a64b0e3bb Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 24 Feb 2016 16:42:35 +0100
Subject: [PATCH 009/415] Default to profile size in Avatar::defaultAvatar
---
classes/Avatar.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/Avatar.php b/classes/Avatar.php
index d8cc134b80..62885f402b 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -207,7 +207,7 @@ class Avatar extends Managed_DataObject
}
}
- static function defaultImage($size)
+ static function defaultImage($size=AVATAR_PROFILE_SIZE)
{
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
From 731fd011390ea3149f72de916df49d2ff8b0b0da Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 24 Feb 2016 16:42:54 +0100
Subject: [PATCH 010/415] Allow easy fetching of rel="me" values
---
classes/Profile.php | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/classes/Profile.php b/classes/Profile.php
index 7aae98fb5f..a5e0d092dc 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -900,6 +900,31 @@ class Profile extends Managed_DataObject
return parent::update($dataObject);
}
+ public function getRelSelf()
+ {
+ return ['href' => $this->getUrl(),
+ 'text' => common_config('site', 'name'),
+ 'image' => Avatar::urlByProfile($this)];
+ }
+
+ // All the known rel="me", used for the IndieWeb audience
+ public function getRelMes()
+ {
+ $relMes = array();
+ try {
+ $relMes[] = $this->getRelSelf();
+ } catch (InvalidUrlException $e) {
+ // no valid profile URL available
+ }
+ if (common_valid_http_url($this->getHomepage())) {
+ $relMes[] = ['href' => $this->getHomepage(),
+ 'text' => _('Homepage'),
+ 'image' => null];
+ }
+ Event::handle('OtherAccountProfiles', array($this, &$relMes));
+ return $relMes;
+ }
+
function delete($useWhere=false)
{
// just in case it hadn't been done before... (usually set before adding deluser to queue handling!)
From 1d0a448e07fec01ca0b3b90d29aef2341f97febf Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 24 Feb 2016 16:43:09 +0100
Subject: [PATCH 011/415] Publish rel="me" in Link HTTP headers
---
actions/showstream.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/actions/showstream.php b/actions/showstream.php
index 3ac837a67e..33ec49df99 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -155,6 +155,17 @@ class ShowstreamAction extends NoticestreamAction
sprintf(_('FOAF for %s'), $this->target->getNickname())));
}
+ public function extraHeaders()
+ {
+ parent::extraHeaders();
+ // Publish all the rel="me" in the HTTP headers on our main profile page
+ if (get_class($this) == 'ShowstreamAction') {
+ foreach ($this->target->getRelMes() as $relMe) {
+ header('Link: <'.htmlspecialchars($relMe['href']).'>'.$type.'; rel="me"', false);
+ }
+ }
+ }
+
function extraHead()
{
if ($this->target->bio) {
From 128a00c4ab381417ac4d3be1f72ad16569534708 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 24 Feb 2016 16:48:44 +0100
Subject: [PATCH 012/415] Include feeds in Link HTTP headers, for easier
discovery
---
lib/feed.php | 5 +++++
lib/noticestreamaction.php | 12 ++++++++++++
2 files changed, 17 insertions(+)
diff --git a/lib/feed.php b/lib/feed.php
index e04c69be6c..d61c3e8a34 100644
--- a/lib/feed.php
+++ b/lib/feed.php
@@ -62,6 +62,11 @@ class Feed
$this->title = $title;
}
+ function getUrl()
+ {
+ return $this->url;
+ }
+
function mimeType()
{
switch ($this->type) {
diff --git a/lib/noticestreamaction.php b/lib/noticestreamaction.php
index fb592915a7..e668a27daf 100644
--- a/lib/noticestreamaction.php
+++ b/lib/noticestreamaction.php
@@ -34,6 +34,18 @@ abstract class NoticestreamAction extends ProfileAction
// pass by default
}
+ public function extraHeaders()
+ {
+ parent::extraHeaders();
+ foreach ($this->getFeeds() as $feed) {
+ header('Link: <'.htmlspecialchars($feed->getUrl()).'>;' .
+ ' rel="'.htmlspecialchars($feed->rel()).'";' .
+ ' type="'.htmlspecialchars($feed->mimeType()).'"',
+ false // don't overwrite previous headers of this sort
+ );
+ }
+ }
+
// this fetches the NoticeStream
abstract public function getStream();
}
From 99f2aba6e164795035326f3520979e70c22d1f10 Mon Sep 17 00:00:00 2001
From: Chimo
Date: Wed, 24 Feb 2016 12:42:41 -0500
Subject: [PATCH 013/415] Fix: Cannot remove OpenID
OpenidsettingsAction::removeOpenID() was comparing and int with a string
so always displayed "That OpenID does not belong to you."
---
plugins/OpenID/actions/openidsettings.php | 2 +-
plugins/OpenID/classes/User_openid.php | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/plugins/OpenID/actions/openidsettings.php b/plugins/OpenID/actions/openidsettings.php
index bf5d8886f1..75835ff1f1 100644
--- a/plugins/OpenID/actions/openidsettings.php
+++ b/plugins/OpenID/actions/openidsettings.php
@@ -287,7 +287,7 @@ class OpenidsettingsAction extends SettingsAction
// TRANS: Form validation error for a non-existing OpenID.
throw new ClientException(_m('No such OpenID.'));
}
- if ($this->scoped->getID() !== $oid->user_id) {
+ if ($this->scoped->getID() !== $oid->getID()) {
// TRANS: Form validation error if OpenID is connected to another user.
throw new ClientException(_m('That OpenID does not belong to you.'));
}
diff --git a/plugins/OpenID/classes/User_openid.php b/plugins/OpenID/classes/User_openid.php
index 7e53d8ec95..2221a9e78a 100644
--- a/plugins/OpenID/classes/User_openid.php
+++ b/plugins/OpenID/classes/User_openid.php
@@ -45,6 +45,16 @@ class User_openid extends Managed_DataObject
);
}
+ public function getID()
+ {
+ if (!isset($this->user_id)) {
+ throw new Exception('No ID set.');
+ } elseif (empty($this->user_id)) {
+ throw new Exception('Empty ID for object! (not inserted yet?).');
+ }
+ return intval($this->user_id);
+ }
+
static function hasOpenID($user_id)
{
$oid = new User_openid();
From 54da2526edab29c1132305d858166437ef7e25d3 Mon Sep 17 00:00:00 2001
From: Chimo
Date: Mon, 22 Feb 2016 20:33:25 -0500
Subject: [PATCH 014/415] Fix !group autocomplete
"Call to undefined method User_group::getFullname"
---
classes/User_group.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/classes/User_group.php b/classes/User_group.php
index 2484f3f265..ecec1ee663 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -105,6 +105,11 @@ class User_group extends Managed_DataObject
return $this->getProfile()->getNickname();
}
+ public function getFullname()
+ {
+ return $this->getProfile()->getFullname();
+ }
+
public static function defaultLogo($size)
{
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
From e3e3a91734ba17d6d8a3f8fa36514490df3ec526 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 24 Feb 2016 19:34:12 +0100
Subject: [PATCH 015/415] Correct comment on Notice->conversation in table
schema
---
classes/Notice.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index ccd398003d..5a37834e1a 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -88,7 +88,7 @@ class Notice extends Managed_DataObject
'reply_to' => array('type' => 'int', 'description' => 'notice replied to (usually a guess)'),
'is_local' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'notice was generated by a user'),
'source' => array('type' => 'varchar', 'length' => 32, 'description' => 'source of comment, like "web", "im", or "clientname"'),
- 'conversation' => array('type' => 'int', 'description' => 'id of root notice in this conversation'),
+ 'conversation' => array('type' => 'int', 'description' => 'the local numerical conversation id'),
'repeat_of' => array('type' => 'int', 'description' => 'notice this is a repeat of'),
'object_type' => array('type' => 'varchar', 'length' => 191, 'description' => 'URI representing activity streams object type', 'default' => null),
'verb' => array('type' => 'varchar', 'length' => 191, 'description' => 'URI representing activity streams verb', 'default' => 'http://activitystrea.ms/schema/1.0/post'),
From 6d3aa3276a84b949d09b31de00eeaffc22d1dfca Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 12:32:33 +0100
Subject: [PATCH 016/415] socialfy-your-domain made people think you needed
manual interaction
I don't know why, but people started following those instructions for no
apparent reason and it ended up causing a bunch of federation issues or
homegrown cron script messes.
Maybe changing the name to "another" instead of "your" domain will make
people stop doing stuff randomly.
---
{socialfy-your-domain => socialfy-another-domain}/README.txt | 5 +++++
.../dot-well-known/host-meta | 0
.../dot-well-known/webfinger/example@example.com.xml | 0
.../dot-well-known/webfinger/index.php | 0
4 files changed, 5 insertions(+)
rename {socialfy-your-domain => socialfy-another-domain}/README.txt (85%)
rename {socialfy-your-domain => socialfy-another-domain}/dot-well-known/host-meta (100%)
rename {socialfy-your-domain => socialfy-another-domain}/dot-well-known/webfinger/example@example.com.xml (100%)
rename {socialfy-your-domain => socialfy-another-domain}/dot-well-known/webfinger/index.php (100%)
diff --git a/socialfy-your-domain/README.txt b/socialfy-another-domain/README.txt
similarity index 85%
rename from socialfy-your-domain/README.txt
rename to socialfy-another-domain/README.txt
index b7691abe8d..7cb01ed2ef 100644
--- a/socialfy-your-domain/README.txt
+++ b/socialfy-another-domain/README.txt
@@ -1,6 +1,11 @@
Initial simple way to Webfinger enable your domain -- needs PHP.
================================================================
+This guide needs some updating, since it will only guide you to present
+XML data (while the curl command likely gives you JSON). The workaround
+is to simply make curl get 'webfinger.xml' instead, and/or have another
+file that contains JSON, but that requires editing the PHP file as well.
+
Step 1
======
diff --git a/socialfy-your-domain/dot-well-known/host-meta b/socialfy-another-domain/dot-well-known/host-meta
similarity index 100%
rename from socialfy-your-domain/dot-well-known/host-meta
rename to socialfy-another-domain/dot-well-known/host-meta
diff --git a/socialfy-your-domain/dot-well-known/webfinger/example@example.com.xml b/socialfy-another-domain/dot-well-known/webfinger/example@example.com.xml
similarity index 100%
rename from socialfy-your-domain/dot-well-known/webfinger/example@example.com.xml
rename to socialfy-another-domain/dot-well-known/webfinger/example@example.com.xml
diff --git a/socialfy-your-domain/dot-well-known/webfinger/index.php b/socialfy-another-domain/dot-well-known/webfinger/index.php
similarity index 100%
rename from socialfy-your-domain/dot-well-known/webfinger/index.php
rename to socialfy-another-domain/dot-well-known/webfinger/index.php
From e69f87824103e4fc0e9ff412a757bfde30afd765 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 15:48:37 +0100
Subject: [PATCH 017/415] Notice getRendered() can now be called on uninserted
notices
---
classes/Notice.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 5a37834e1a..c56d68578d 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -260,7 +260,8 @@ class Notice extends Managed_DataObject
public function getRendered()
{
- if (is_null($this->rendered) || $this->rendered === '') {
+ // we test $this->id because if it's not inserted yet, we can't update the field
+ if (!empty($this->id) && (is_null($this->rendered) || $this->rendered === '')) {
// update to include rendered content on-the-fly, so we don't have to have a fix-up script in upgrade.php
common_debug('Rendering notice '.$this->getID().' as it had no rendered HTML content.');
$orig = clone($this);
@@ -854,8 +855,7 @@ class Notice extends Managed_DataObject
}
// Strip out any bad HTML
$stored->rendered = common_purify($content);
- // yeah, just don't use getRendered() here since it's not inserted yet ;)
- $stored->content = common_strip_html($stored->rendered);
+ $stored->content = common_strip_html($stored->getRendered(), true, true);
if (trim($stored->content) === '') {
// TRANS: Error message when the plain text content of a notice has zero length.
throw new ClientException(_('Empty notice content, will not save this.'));
From 4239c952d21ea98cb3c834cc345a9a451ba156b1 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 19:46:17 +0100
Subject: [PATCH 018/415] $metadata->thumbnail_url is not guaranteed to be set
We should probably have a separate class for this, so we can more
easily combine different technologies similar to oEmbed/OpenGraph.
---
plugins/Oembed/OembedPlugin.php | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index c90f57439b..44e4ac9318 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -73,18 +73,20 @@ class OembedPlugin extends Plugin
$metadata = OpenGraphHelper::ogFromHtml($dom);
}
- // sometimes sites serve the path, not the full URL, for images
- // let's "be liberal in what you accept from others"!
- // add protocol and host if the thumbnail_url starts with /
- if(substr($metadata->thumbnail_url,0,1) == '/') {
- $thumbnail_url_parsed = parse_url($metadata->url);
- $metadata->thumbnail_url = $thumbnail_url_parsed['scheme']."://".$thumbnail_url_parsed['host'].$metadata->thumbnail_url;
- }
+ if (isset($metadata->thumbnail_url)) {
+ // sometimes sites serve the path, not the full URL, for images
+ // let's "be liberal in what you accept from others"!
+ // add protocol and host if the thumbnail_url starts with /
+ if(substr($metadata->thumbnail_url,0,1) == '/') {
+ $thumbnail_url_parsed = parse_url($metadata->url);
+ $metadata->thumbnail_url = $thumbnail_url_parsed['scheme']."://".$thumbnail_url_parsed['host'].$metadata->thumbnail_url;
+ }
- // some wordpress opengraph implementations sometimes return a white blank image
- // no need for us to save that!
- if($metadata->thumbnail_url == 'https://s0.wp.com/i/blank.jpg') {
- unset($metadata->thumbnail_url);
+ // some wordpress opengraph implementations sometimes return a white blank image
+ // no need for us to save that!
+ if($metadata->thumbnail_url == 'https://s0.wp.com/i/blank.jpg') {
+ unset($metadata->thumbnail_url);
+ }
}
}
From e6e1705852d7e529b38acb3714549cb052b473e6 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 22:15:54 +0100
Subject: [PATCH 019/415] Make uploads work properly if we accept _all_
attachment types
Also introduced $config['attachments']['extblacklist'] that can disable
certain file extensions (or rewrite them, for example php => phps)
---
classes/File.php | 53 +++++++++++++++++++++++++++++++++++++++--------
lib/default.php | 4 ++++
lib/mediafile.php | 4 ++--
3 files changed, 50 insertions(+), 11 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index 6ba80eb5f6..2115313a81 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -237,7 +237,7 @@ class File extends Managed_DataObject
static function filename(Profile $profile, $origname, $mimetype)
{
- $ext = self::guessMimeExtension($mimetype);
+ $ext = self::guessMimeExtension($mimetype, $origname);
// Normalize and make the original filename more URL friendly.
$origname = basename($origname, ".$ext");
@@ -258,19 +258,54 @@ class File extends Managed_DataObject
return $filename;
}
- static function guessMimeExtension($mimetype)
+ /**
+ * @param $mimetype The mimetype we've discovered for this file.
+ * @param $filename An optional filename which we can use on failure.
+ */
+ static function guessMimeExtension($mimetype, $filename=null)
{
+ $ext = null;
try {
+ // first see if we know the extension for our mimetype
$ext = common_supported_mime_to_ext($mimetype);
- } catch (Exception $e) {
- // We don't support this mimetype, but let's guess the extension
- $matches = array();
- if (!preg_match('/\/([a-z0-9]+)/', mb_strtolower($mimetype), $matches)) {
- throw new Exception('Malformed mimetype: '.$mimetype);
+ // we do, so use it!
+ return $ext;
+ } catch (Exception $e) { // FIXME: Make this exception more specific to "unknown mime=>ext relation"
+ // We don't know the extension for this mimetype, but let's guess.
+
+ // If we are very liberal with uploads ($config['attachments']['supported'] === true)
+ // then we try to do some guessing based on the filename, if it was supplied.
+ if (!is_null($filename) && common_config('attachments', 'supported')===true
+ && preg_match('/^.+\.([A-Za-z0-9]+)$/', $filename, $matches)) {
+ // we matched on a file extension, so let's see if it means something.
+ $ext = mb_strtolower($matches[1]);
+
+ $blacklist = common_config('attachments', 'extblacklist');
+ // If we got an extension from $filename we want to check if it's in a blacklist
+ // so we avoid people uploading .php files etc.
+ if (array_key_exists($ext, $blacklist)) {
+ if (!is_string($blacklist[$ext])) {
+ // we don't have a safe replacement extension
+ throw ClientException(_('Blacklisted file extension.'));
+ }
+ common_debug('Found replaced extension for filename '._ve($filename).': '._ve($ext));
+
+ // return a safe replacement extension ('php' => 'phps' for example)
+ return $blacklist[$ext];
+ }
+ // the attachment extension based on its filename was not blacklisted so it's ok to use it
+ return $ext;
}
- $ext = $matches[1];
}
- return mb_strtolower($ext);
+
+ // If nothing else has given us a result, try to extract it from
+ // the mimetype value (this turns .jpg to .jpeg for example...)
+ $matches = array();
+ if (!preg_match('/\/([a-z0-9]+)/', mb_strtolower($mimetype), $matches)) {
+ throw new Exception('Malformed mimetype: '.$mimetype);
+ }
+ $ext = mb_strtolower($matches[1]);
+ return $ext;
}
/**
diff --git a/lib/default.php b/lib/default.php
index f8ce3bd4fe..b945c24e20 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -266,6 +266,10 @@ $default =
'show_html' => false, // show (filtered) text/html attachments (and oEmbed HTML etc.). Doesn't affect AJAX calls.
'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info
'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages.
+ 'extblacklist' => [
+ 'php' => 'phps',
+ 'exe' => false, // this would deny any uploads to keep the "exe" file extension
+ ],
),
'thumbnail' =>
array('crop' => false, // overridden to true if thumb height === null
diff --git a/lib/mediafile.php b/lib/mediafile.php
index 9fe5432ad5..1e0fb39769 100644
--- a/lib/mediafile.php
+++ b/lib/mediafile.php
@@ -253,15 +253,15 @@ class MediaFile
File::respectsQuota($scoped, $_FILES[$param]['size']);
$mimetype = self::getUploadedMimeType($_FILES[$param]['tmp_name'], $_FILES[$param]['name']);
+ $basename = basename($_FILES[$param]['name']);
switch (common_config('attachments', 'filename_base')) {
case 'upload':
- $basename = basename($_FILES[$param]['name']);
$filename = File::filename($scoped, $basename, $mimetype);
break;
case 'hash':
default:
- $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype);
+ $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype, $basename);
}
$filepath = File::path($filename);
From bac37d17143f9847e82f9e2c58d1646245747d77 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 22:17:44 +0100
Subject: [PATCH 020/415] syntax error
---
classes/File.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/File.php b/classes/File.php
index 2115313a81..171ba9942b 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -286,7 +286,7 @@ class File extends Managed_DataObject
if (array_key_exists($ext, $blacklist)) {
if (!is_string($blacklist[$ext])) {
// we don't have a safe replacement extension
- throw ClientException(_('Blacklisted file extension.'));
+ throw new ClientException(_('Blacklisted file extension.'));
}
common_debug('Found replaced extension for filename '._ve($filename).': '._ve($ext));
From 4d17d9533552ea620b83109c550e250a5c236291 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 22:31:45 +0100
Subject: [PATCH 021/415] Try to get mime data before hashing (cpu intensive)
---
plugins/Oembed/OembedPlugin.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index 44e4ac9318..196b07d75d 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -325,8 +325,10 @@ class OembedPlugin extends Plugin
throw new UnsupportedMediaException(_('Image file had impossible geometry (0 width or height)'));
}
+ $ext = File::guessMimeExtension($info['mime']);
+
// We'll trust sha256 (File::FILEHASH_ALG) not to have collision issues any time soon :)
- $filename = hash(File::FILEHASH_ALG, $imgData) . '.' . common_supported_mime_to_ext($info['mime']);
+ $filename = hash(File::FILEHASH_ALG, $imgData) . ".{$ext}";
$fullpath = File_thumbnail::path($filename);
// Write the file to disk. Throw Exception on failure
if (!file_exists($fullpath) && file_put_contents($fullpath, $imgData) === false) {
From aeb2e282db49831510b1894204718a2a7d2409b7 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 25 Feb 2016 22:32:07 +0100
Subject: [PATCH 022/415] Commented on the mime extension matching regexp
---
classes/File.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index 171ba9942b..5294d82c24 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -264,7 +264,6 @@ class File extends Managed_DataObject
*/
static function guessMimeExtension($mimetype, $filename=null)
{
- $ext = null;
try {
// first see if we know the extension for our mimetype
$ext = common_supported_mime_to_ext($mimetype);
@@ -301,11 +300,11 @@ class File extends Managed_DataObject
// If nothing else has given us a result, try to extract it from
// the mimetype value (this turns .jpg to .jpeg for example...)
$matches = array();
+ // FIXME: try to build a regexp that will get jpeg from image/jpeg as well as json from application/jrd+json
if (!preg_match('/\/([a-z0-9]+)/', mb_strtolower($mimetype), $matches)) {
throw new Exception('Malformed mimetype: '.$mimetype);
}
- $ext = mb_strtolower($matches[1]);
- return $ext;
+ return mb_strtolower($matches[1]);
}
/**
From 2669c5126512ac8721b886ea52144f39f1a52edf Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 00:05:07 +0100
Subject: [PATCH 023/415] Allow sgf files if they're recognized in mime search
They are Go game files used on lamatriz.org. Note that my server
doesn't actually recognize these files and can identify the mime type,
but my browser did for some reason.
---
lib/default.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/default.php b/lib/default.php
index b945c24e20..c78803da97 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -241,6 +241,7 @@ $default =
'application/vnd.oasis.opendocument.text-web' => 'oth',
'application/pdf' => 'pdf',
'application/zip' => 'zip',
+ 'application/x-go-sgf' => 'sgf',
'application/xml' => 'xml',
'image/png' => 'png',
'image/jpeg' => 'jpg',
From 273051039385719448bc37e75aca09e7019502ac Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 00:06:04 +0100
Subject: [PATCH 024/415] User friendlieness in scripts/delete_notice.php
---
scripts/delete_notice.php | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/scripts/delete_notice.php b/scripts/delete_notice.php
index bf10cbb2b2..cd29cffc15 100755
--- a/scripts/delete_notice.php
+++ b/scripts/delete_notice.php
@@ -20,8 +20,8 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-$shortoptions = 'i::n::u::y';
-$longoptions = array('id=', 'nickname=', 'uri=', 'yes');
+$shortoptions = 'i::u::y';
+$longoptions = array('id=', 'uri=', 'yes');
$helptext = <<getMessage()}\n";
exit(1);
}
From 29662eef5e479f8ebcbff1ce3c89e15beb43f7c6 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 00:08:51 +0100
Subject: [PATCH 025/415] Mentioning matches (@this too) now.
---
lib/nickname.php | 10 ++++++++++
lib/util.php | 6 +++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/lib/nickname.php b/lib/nickname.php
index 2dd08efc3f..5a5b515b4d 100644
--- a/lib/nickname.php
+++ b/lib/nickname.php
@@ -76,6 +76,16 @@ class Nickname
*/
const MAX_LEN = 64;
+ /**
+ * Regex with non-capturing group that matches whitespace and some
+ * characters which are allowed right before an @ or ! when mentioning
+ * other users. Like: 'This goes out to:@mmn (@chimo too) (!awwyiss).'
+ *
+ * FIXME: Make this so you can have multiple whitespace but not multiple
+ * parenthesis or something. '(((@n_n@)))' might as well be a smiley.
+ */
+ const BEFORE_MENTIONS = '(?:^|[\s\.\,\:\;\[\(]+)';
+
/**
* Nice simple check of whether the given string is a valid input nickname,
* which can be normalized into an internally canonical form.
diff --git a/lib/util.php b/lib/util.php
index c87b0f1bf6..f029eb429d 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -800,7 +800,7 @@ function common_find_mentions($text, Profile $sender, Notice $parent=null)
// @#tag => mention of all subscriptions tagged 'tag'
- preg_match_all('/(?:^|[\s\.\,\:\;]+)@#([\pL\pN_\-\.]{1,64})/',
+ preg_match_all('/'.Nickname::BEFORE_MENTIONS.'@#([\pL\pN_\-\.]{1,64})/',
$text, $hmatches, PREG_OFFSET_CAPTURE);
foreach ($hmatches[1] as $hmatch) {
$tag = common_canonical_tag($hmatch[0]);
@@ -822,7 +822,7 @@ function common_find_mentions($text, Profile $sender, Notice $parent=null)
'url' => $url);
}
- preg_match_all('/(?:^|[\s\.\,\:\;]+)!(' . Nickname::DISPLAY_FMT . ')/',
+ preg_match_all('/'.Nickname::BEFORE_MENTIONS.'!(' . Nickname::DISPLAY_FMT . ')/',
$text, $hmatches, PREG_OFFSET_CAPTURE);
foreach ($hmatches[1] as $hmatch) {
$nickname = Nickname::normalize($hmatch[0]);
@@ -866,7 +866,7 @@ function common_find_mentions_raw($text)
$atmatches = array();
// the regexp's "(?!\@)" makes sure it doesn't matches the single "@remote" in "@remote@server.com"
- preg_match_all('/(?:^|\s+)@(' . Nickname::DISPLAY_FMT . ')\b(?!\@)/',
+ preg_match_all('/'.Nickname::BEFORE_MENTIONS.'@(' . Nickname::DISPLAY_FMT . ')\b(?!\@)/',
$text,
$atmatches,
PREG_OFFSET_CAPTURE);
From 519e3308ab33048fdf51127560c67e7572e48d49 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 01:04:59 +0100
Subject: [PATCH 026/415] Use mb_strlen to see if something is an empty string
---
classes/Notice.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index c56d68578d..86eec8e3ad 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -849,11 +849,12 @@ class Notice extends Managed_DataObject
$stored->url = $url;
$stored->verb = $act->verb;
- $content = $act->content ?: $act->summary;
- if (is_null($content) && !is_null($actobj)) {
- $content = $actobj->content ?: $actobj->summary;
+ // we use mb_strlen because it _might_ be that the content is just the string "0"...
+ $content = mb_strlen($act->content) ? $act->content : $act->summary;
+ if (mb_strlen($content)===0 && !is_null($actobj)) {
+ $content = mb_strlen($actobj->content) ? $actobj->content : $actobj->summary;
}
- // Strip out any bad HTML
+ // Strip out any bad HTML from $content
$stored->rendered = common_purify($content);
$stored->content = common_strip_html($stored->getRendered(), true, true);
if (trim($stored->content) === '') {
From c58228195b6e187c5370d3929c623db89ac9ee23 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 01:11:20 +0100
Subject: [PATCH 027/415] Make sure the saved Notice has an ID
---
classes/Notice.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 86eec8e3ad..892f2be30e 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -997,7 +997,9 @@ class Notice extends Managed_DataObject
}
}
if (!$stored instanceof Notice) {
- throw new ServerException('StartNoticeSave did not give back a Notice');
+ throw new ServerException('StartNoticeSave did not give back a Notice.');
+ } elseif (empty($stored->id)) {
+ throw new ServerException('Supposedly saved Notice has no ID.');
}
// Only save 'attention' and metadata stuff (URLs, tags...) stuff if
From 1414abfe950adaa324caf68e6f4822657e7df5e8 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 13:34:07 +0100
Subject: [PATCH 028/415] Jean Lucas mentioned PEAR::Net_SMTP was outdated
Net_SMTP updated to 1.7.1 (stable) was released on 2015-09-07
https://pear.php.net/package/Net_SMTP
---
extlib/Net/SMTP.php | 945 +++++++++++++++++++++++---------------------
1 file changed, 504 insertions(+), 441 deletions(-)
diff --git a/extlib/Net/SMTP.php b/extlib/Net/SMTP.php
index ea4b55e8d2..8f4e92b753 100644
--- a/extlib/Net/SMTP.php
+++ b/extlib/Net/SMTP.php
@@ -1,14 +1,14 @@
|
// | Damian Alejandro Fernandez Sosa |
// +----------------------------------------------------------------------+
-//
-// $Id: SMTP.php 293948 2010-01-24 21:46:00Z jon $
require_once 'PEAR.php';
require_once 'Net/Socket.php';
/**
* Provides an implementation of the SMTP protocol using PEAR's
- * Net_Socket:: class.
+ * Net_Socket class.
*
* @package Net_SMTP
* @author Chuck Hagenbuch
* @author Jon Parise
* @author Damian Alejandro Fernandez Sosa
*
- * @example basic.php A basic implementation of the Net_SMTP package.
+ * @example basic.php A basic implementation of the Net_SMTP package.
*/
class Net_SMTP
{
/**
* The server to connect to.
* @var string
- * @access public
*/
- var $host = 'localhost';
+ public $host = 'localhost';
/**
* The port to connect to.
* @var int
- * @access public
*/
- var $port = 25;
+ public $port = 25;
/**
* The value to give when sending EHLO or HELO.
* @var string
- * @access public
*/
- var $localhost = 'localhost';
+ public $localhost = 'localhost';
/**
* List of supported authentication methods, in preferential order.
* @var array
- * @access public
*/
- var $auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN');
+ public $auth_methods = array();
/**
* Use SMTP command pipelining (specified in RFC 2920) if the SMTP
@@ -73,65 +67,69 @@ class Net_SMTP
* SMTP server but return immediately.
*
* @var bool
- * @access public
*/
- var $pipelining = false;
+ public $pipelining = false;
/**
* Number of pipelined commands.
* @var int
- * @access private
*/
- var $_pipelined_commands = 0;
+ protected $pipelined_commands = 0;
/**
* Should debugging output be enabled?
* @var boolean
- * @access private
*/
- var $_debug = false;
+ protected $debug = false;
/**
* Debug output handler.
* @var callback
- * @access private
*/
- var $_debug_handler = null;
+ protected $debug_handler = null;
/**
* The socket resource being used to connect to the SMTP server.
* @var resource
- * @access private
*/
- var $_socket = null;
+ protected $socket = null;
+
+ /**
+ * Array of socket options that will be passed to Net_Socket::connect().
+ * @see stream_context_create()
+ * @var array
+ */
+ protected $socket_options = null;
+
+ /**
+ * The socket I/O timeout value in seconds.
+ * @var int
+ */
+ protected $timeout = 0;
/**
* The most recent server response code.
* @var int
- * @access private
*/
- var $_code = -1;
+ protected $code = -1;
/**
* The most recent server response arguments.
* @var array
- * @access private
*/
- var $_arguments = array();
+ protected $arguments = array();
/**
* Stores the SMTP server's greeting string.
* @var string
- * @access private
*/
- var $_greeting = null;
+ protected $greeting = null;
/**
* Stores detected features of the SMTP server.
* @var array
- * @access private
*/
- var $_esmtp = array();
+ protected $esmtp = array();
/**
* Instantiates a new Net_SMTP object, overriding any defaults
@@ -144,16 +142,18 @@ class Net_SMTP
* $smtp = new Net_SMTP('ssl://mail.host.com', 465);
* $smtp->connect();
*
- * @param string $host The server to connect to.
- * @param integer $port The port to connect to.
- * @param string $localhost The value to give when sending EHLO or HELO.
- * @param boolean $pipeling Use SMTP command pipelining
+ * @param string $host The server to connect to.
+ * @param integer $port The port to connect to.
+ * @param string $localhost The value to give when sending EHLO or HELO.
+ * @param boolean $pipelining Use SMTP command pipelining
+ * @param integer $timeout Socket I/O timeout in seconds.
+ * @param array $socket_options Socket stream_context_create() options.
*
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function Net_SMTP($host = null, $port = null, $localhost = null, $pipelining = false)
- {
+ public function __construct($host = null, $port = null, $localhost = null,
+ $pipelining = false, $timeout = 0, $socket_options = null
+ ) {
if (isset($host)) {
$this->host = $host;
}
@@ -163,49 +163,65 @@ class Net_SMTP
if (isset($localhost)) {
$this->localhost = $localhost;
}
- $this->pipelining = $pipelining;
- $this->_socket = new Net_Socket();
+ $this->pipelining = $pipelining;
+ $this->socket = new Net_Socket();
+ $this->socket_options = $socket_options;
+ $this->timeout = $timeout;
- /* Include the Auth_SASL package. If the package is not
- * available, we disable the authentication methods that
- * depend upon it. */
- if ((@include_once 'Auth/SASL.php') === false) {
- $pos = array_search('DIGEST-MD5', $this->auth_methods);
- unset($this->auth_methods[$pos]);
- $pos = array_search('CRAM-MD5', $this->auth_methods);
- unset($this->auth_methods[$pos]);
+ /* Include the Auth_SASL package. If the package is available, we
+ * enable the authentication methods that depend upon it. */
+ if (@include_once 'Auth/SASL.php') {
+ $this->setAuthMethod('CRAM-MD5', array($this, 'authCramMD5'));
+ $this->setAuthMethod('DIGEST-MD5', array($this, 'authDigestMD5'));
}
+
+ /* These standard authentication methods are always available. */
+ $this->setAuthMethod('LOGIN', array($this, 'authLogin'), false);
+ $this->setAuthMethod('PLAIN', array($this, 'authPlain'), false);
+ }
+
+ /**
+ * Set the socket I/O timeout value in seconds plus microseconds.
+ *
+ * @param integer $seconds Timeout value in seconds.
+ * @param integer $microseconds Additional value in microseconds.
+ *
+ * @since 1.5.0
+ */
+ public function setTimeout($seconds, $microseconds = 0)
+ {
+ return $this->socket->setTimeout($seconds, $microseconds);
}
/**
* Set the value of the debugging flag.
*
- * @param boolean $debug New value for the debugging flag.
+ * @param boolean $debug New value for the debugging flag.
+ * @param callback $handler Debug handler callback
*
- * @access public
- * @since 1.1.0
+ * @since 1.1.0
*/
- function setDebug($debug, $handler = null)
+ public function setDebug($debug, $handler = null)
{
- $this->_debug = $debug;
- $this->_debug_handler = $handler;
+ $this->debug = $debug;
+ $this->debug_handler = $handler;
}
/**
* Write the given debug text to the current debug output handler.
*
- * @param string $message Debug mesage text.
+ * @param string $message Debug mesage text.
*
- * @access private
- * @since 1.3.3
+ * @since 1.3.3
*/
- function _debug($message)
+ protected function debug($message)
{
- if ($this->_debug) {
- if ($this->_debug_handler) {
- call_user_func_array($this->_debug_handler,
- array(&$this, $message));
+ if ($this->debug) {
+ if ($this->debug_handler) {
+ call_user_func_array(
+ $this->debug_handler, array(&$this, $message)
+ );
} else {
echo "DEBUG: $message\n";
}
@@ -215,24 +231,24 @@ class Net_SMTP
/**
* Send the given string of data to the server.
*
- * @param string $data The string of data to send.
+ * @param string $data The string of data to send.
*
- * @return mixed True on success or a PEAR_Error object on failure.
+ * @return mixed The number of bytes that were actually written,
+ * or a PEAR_Error object on failure.
*
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _send($data)
+ protected function send($data)
{
- $this->_debug("Send: $data");
+ $this->debug("Send: $data");
- $error = $this->_socket->write($data);
- if ($error === false || PEAR::isError($error)) {
- $msg = ($error) ? $error->getMessage() : "unknown error";
+ $result = $this->socket->write($data);
+ if (!$result || PEAR::isError($result)) {
+ $msg = $result ? $result->getMessage() : "unknown error";
return PEAR::raiseError("Failed to write to socket: $msg");
}
- return true;
+ return $result;
}
/**
@@ -240,19 +256,18 @@ class Net_SMTP
* arguments. A carriage return / linefeed (CRLF) sequence will
* be appended to each command string before it is sent to the
* SMTP server - an error will be thrown if the command string
- * already contains any newline characters. Use _send() for
+ * already contains any newline characters. Use send() for
* commands that must contain newlines.
*
- * @param string $command The SMTP command to send to the server.
- * @param string $args A string of optional arguments to append
- * to the command.
+ * @param string $command The SMTP command to send to the server.
+ * @param string $args A string of optional arguments to append
+ * to the command.
*
- * @return mixed The result of the _send() call.
+ * @return mixed The result of the send() call.
*
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _put($command, $args = '')
+ protected function put($command, $args = '')
{
if (!empty($args)) {
$command .= ' ' . $args;
@@ -262,57 +277,56 @@ class Net_SMTP
return PEAR::raiseError('Commands cannot contain newlines');
}
- return $this->_send($command . "\r\n");
+ return $this->send($command . "\r\n");
}
/**
* Read a reply from the SMTP server. The reply consists of a response
* code and a response message.
*
- * @param mixed $valid The set of valid response codes. These
- * may be specified as an array of integer
- * values or as a single integer value.
- * @param bool $later Do not parse the response now, but wait
- * until the last command in the pipelined
- * command group
+ * @param mixed $valid The set of valid response codes. These
+ * may be specified as an array of integer
+ * values or as a single integer value.
+ * @param bool $later Do not parse the response now, but wait
+ * until the last command in the pipelined
+ * command group
*
- * @return mixed True if the server returned a valid response code or
- * a PEAR_Error object is an error condition is reached.
+ * @return mixed True if the server returned a valid response code or
+ * a PEAR_Error object is an error condition is reached.
*
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*
- * @see getResponse
+ * @see getResponse
*/
- function _parseResponse($valid, $later = false)
+ protected function parseResponse($valid, $later = false)
{
- $this->_code = -1;
- $this->_arguments = array();
+ $this->code = -1;
+ $this->arguments = array();
if ($later) {
- $this->_pipelined_commands++;
+ $this->pipelined_commands++;
return true;
}
- for ($i = 0; $i <= $this->_pipelined_commands; $i++) {
- while ($line = $this->_socket->readLine()) {
- $this->_debug("Recv: $line");
+ for ($i = 0; $i <= $this->pipelined_commands; $i++) {
+ while ($line = $this->socket->readLine()) {
+ $this->debug("Recv: $line");
- /* If we receive an empty line, the connection has been closed. */
+ /* If we receive an empty line, the connection was closed. */
if (empty($line)) {
$this->disconnect();
- return PEAR::raiseError('Connection was unexpectedly closed');
+ return PEAR::raiseError('Connection was closed');
}
/* Read the code and store the rest in the arguments array. */
$code = substr($line, 0, 3);
- $this->_arguments[] = trim(substr($line, 4));
+ $this->arguments[] = trim(substr($line, 4));
/* Check the syntax of the response code. */
if (is_numeric($code)) {
- $this->_code = (int)$code;
+ $this->code = (int)$code;
} else {
- $this->_code = -1;
+ $this->code = -1;
break;
}
@@ -323,79 +337,115 @@ class Net_SMTP
}
}
- $this->_pipelined_commands = 0;
+ $this->pipelined_commands = 0;
/* Compare the server's response code with the valid code/codes. */
- if (is_int($valid) && ($this->_code === $valid)) {
+ if (is_int($valid) && ($this->code === $valid)) {
return true;
- } elseif (is_array($valid) && in_array($this->_code, $valid, true)) {
+ } elseif (is_array($valid) && in_array($this->code, $valid, true)) {
return true;
}
- return PEAR::raiseError('Invalid response code received from server',
- $this->_code);
+ return PEAR::raiseError('Invalid response code received from server', $this->code);
+ }
+
+ /**
+ * Issue an SMTP command and verify its response.
+ *
+ * @param string $command The SMTP command string or data.
+ * @param mixed $valid The set of valid response codes. These
+ * may be specified as an array of integer
+ * values or as a single integer value.
+ *
+ * @return mixed True on success or a PEAR_Error object on failure.
+ *
+ * @since 1.6.0
+ */
+ public function command($command, $valid)
+ {
+ if (PEAR::isError($error = $this->put($command))) {
+ return $error;
+ }
+ if (PEAR::isError($error = $this->parseResponse($valid))) {
+ return $error;
+ }
+
+ return true;
}
/**
* Return a 2-tuple containing the last response from the SMTP server.
*
- * @return array A two-element array: the first element contains the
- * response code as an integer and the second element
- * contains the response's arguments as a string.
+ * @return array A two-element array: the first element contains the
+ * response code as an integer and the second element
+ * contains the response's arguments as a string.
*
- * @access public
- * @since 1.1.0
+ * @since 1.1.0
*/
- function getResponse()
+ public function getResponse()
{
- return array($this->_code, join("\n", $this->_arguments));
+ return array($this->code, join("\n", $this->arguments));
}
/**
* Return the SMTP server's greeting string.
*
- * @return string A string containing the greeting string, or null if a
- * greeting has not been received.
+ * @return string A string containing the greeting string, or null if
+ * a greeting has not been received.
*
- * @access public
- * @since 1.3.3
+ * @since 1.3.3
*/
- function getGreeting()
+ public function getGreeting()
{
- return $this->_greeting;
+ return $this->greeting;
}
/**
* Attempt to connect to the SMTP server.
*
- * @param int $timeout The timeout value (in seconds) for the
- * socket connection.
- * @param bool $persistent Should a persistent socket connection
- * be used?
+ * @param int $timeout The timeout value (in seconds) for the
+ * socket connection attempt.
+ * @param bool $persistent Should a persistent socket connection
+ * be used?
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function connect($timeout = null, $persistent = false)
+ public function connect($timeout = null, $persistent = false)
{
- $this->_greeting = null;
- $result = $this->_socket->connect($this->host, $this->port,
- $persistent, $timeout);
+ $this->greeting = null;
+
+ $result = $this->socket->connect(
+ $this->host, $this->port, $persistent, $timeout, $this->socket_options
+ );
+
if (PEAR::isError($result)) {
- return PEAR::raiseError('Failed to connect socket: ' .
- $result->getMessage());
+ return PEAR::raiseError(
+ 'Failed to connect socket: ' . $result->getMessage()
+ );
}
- if (PEAR::isError($error = $this->_parseResponse(220))) {
+ /*
+ * Now that we're connected, reset the socket's timeout value for
+ * future I/O operations. This allows us to have different socket
+ * timeout values for the initial connection (our $timeout parameter)
+ * and all other socket operations.
+ */
+ if ($this->timeout > 0) {
+ if (PEAR::isError($error = $this->setTimeout($this->timeout))) {
+ return $error;
+ }
+ }
+
+ if (PEAR::isError($error = $this->parseResponse(220))) {
return $error;
}
/* Extract and store a copy of the server's greeting string. */
- list(, $this->_greeting) = $this->getResponse();
+ list(, $this->greeting) = $this->getResponse();
- if (PEAR::isError($error = $this->_negotiate())) {
+ if (PEAR::isError($error = $this->negotiate())) {
return $error;
}
@@ -407,20 +457,20 @@ class Net_SMTP
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function disconnect()
+ public function disconnect()
{
- if (PEAR::isError($error = $this->_put('QUIT'))) {
+ if (PEAR::isError($error = $this->put('QUIT'))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(221))) {
+ if (PEAR::isError($error = $this->parseResponse(221))) {
return $error;
}
- if (PEAR::isError($error = $this->_socket->disconnect())) {
- return PEAR::raiseError('Failed to disconnect socket: ' .
- $error->getMessage());
+ if (PEAR::isError($error = $this->socket->disconnect())) {
+ return PEAR::raiseError(
+ 'Failed to disconnect socket: ' . $error->getMessage()
+ );
}
return true;
@@ -433,40 +483,34 @@ class Net_SMTP
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _negotiate()
+ protected function negotiate()
{
- if (PEAR::isError($error = $this->_put('EHLO', $this->localhost))) {
+ if (PEAR::isError($error = $this->put('EHLO', $this->localhost))) {
return $error;
}
- if (PEAR::isError($this->_parseResponse(250))) {
- /* If we receive a 503 response, we're already authenticated. */
- if ($this->_code === 503) {
- return true;
- }
-
+ if (PEAR::isError($this->parseResponse(250))) {
/* If the EHLO failed, try the simpler HELO command. */
- if (PEAR::isError($error = $this->_put('HELO', $this->localhost))) {
+ if (PEAR::isError($error = $this->put('HELO', $this->localhost))) {
return $error;
}
- if (PEAR::isError($this->_parseResponse(250))) {
- return PEAR::raiseError('HELO was not accepted: ', $this->_code);
+ if (PEAR::isError($this->parseResponse(250))) {
+ return PEAR::raiseError('HELO was not accepted', $this->code);
}
return true;
}
- foreach ($this->_arguments as $argument) {
- $verb = strtok($argument, ' ');
- $arguments = substr($argument, strlen($verb) + 1,
- strlen($argument) - strlen($verb) - 1);
- $this->_esmtp[$verb] = $arguments;
+ foreach ($this->arguments as $argument) {
+ $verb = strtok($argument, ' ');
+ $len = strlen($verb);
+ $arguments = substr($argument, $len + 1, strlen($argument) - $len - 1);
+ $this->esmtp[$verb] = $arguments;
}
- if (!isset($this->_esmtp['PIPELINING'])) {
+ if (!isset($this->esmtp['PIPELINING'])) {
$this->pipelining = false;
}
@@ -477,17 +521,16 @@ class Net_SMTP
* Returns the name of the best authentication method that the server
* has advertised.
*
- * @return mixed Returns a string containing the name of the best
- * supported authentication method or a PEAR_Error object
- * if a failure condition is encountered.
- * @access private
- * @since 1.1.0
+ * @return mixed Returns a string containing the name of the best
+ * supported authentication method or a PEAR_Error object
+ * if a failure condition is encountered.
+ * @since 1.1.0
*/
- function _getBestAuthMethod()
+ protected function getBestAuthMethod()
{
- $available_methods = explode(' ', $this->_esmtp['AUTH']);
+ $available_methods = explode(' ', $this->esmtp['AUTH']);
- foreach ($this->auth_methods as $method) {
+ foreach ($this->auth_methods as $method => $callback) {
if (in_array($method, $available_methods)) {
return $method;
}
@@ -499,35 +542,47 @@ class Net_SMTP
/**
* Attempt to do SMTP authentication.
*
- * @param string The userid to authenticate as.
- * @param string The password to authenticate with.
- * @param string The requested authentication method. If none is
- * specified, the best supported method will be used.
- * @param bool Flag indicating whether or not TLS should be attempted.
+ * @param string $uid The userid to authenticate as.
+ * @param string $pwd The password to authenticate with.
+ * @param string $method The requested authentication method. If none is
+ * specified, the best supported method will be used.
+ * @param bool $tls Flag indicating whether or not TLS should be attempted.
+ * @param string $authz An optional authorization identifier. If specified, this
+ * identifier will be used as the authorization proxy.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function auth($uid, $pwd , $method = '', $tls = true)
+ public function auth($uid, $pwd , $method = '', $tls = true, $authz = '')
{
/* We can only attempt a TLS connection if one has been requested,
- * we're running PHP 5.1.0 or later, have access to the OpenSSL
- * extension, are connected to an SMTP server which supports the
- * STARTTLS extension, and aren't already connected over a secure
+ * we're running PHP 5.1.0 or later, have access to the OpenSSL
+ * extension, are connected to an SMTP server which supports the
+ * STARTTLS extension, and aren't already connected over a secure
* (SSL) socket connection. */
- if ($tls && version_compare(PHP_VERSION, '5.1.0', '>=') &&
- extension_loaded('openssl') && isset($this->_esmtp['STARTTLS']) &&
- strncasecmp($this->host, 'ssl://', 6) !== 0) {
+ if ($tls && version_compare(PHP_VERSION, '5.1.0', '>=')
+ && extension_loaded('openssl') && isset($this->esmtp['STARTTLS'])
+ && strncasecmp($this->host, 'ssl://', 6) !== 0
+ ) {
/* Start the TLS connection attempt. */
- if (PEAR::isError($result = $this->_put('STARTTLS'))) {
+ if (PEAR::isError($result = $this->put('STARTTLS'))) {
return $result;
}
- if (PEAR::isError($result = $this->_parseResponse(220))) {
+ if (PEAR::isError($result = $this->parseResponse(220))) {
return $result;
}
- if (PEAR::isError($result = $this->_socket->enableCrypto(true, STREAM_CRYPTO_METHOD_TLS_CLIENT))) {
+ if (isset($this->socket_options['ssl']['crypto_method'])) {
+ $crypto_method = $this->socket_options['ssl']['crypto_method'];
+ } else {
+ /* STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT constant does not exist
+ * and STREAM_CRYPTO_METHOD_SSLv23_CLIENT constant is
+ * inconsistent across PHP versions. */
+ $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT
+ | @STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
+ | @STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
+ }
+ if (PEAR::isError($result = $this->socket->enableCrypto(true, $crypto_method))) {
return $result;
} elseif ($result !== true) {
return PEAR::raiseError('STARTTLS failed');
@@ -535,47 +590,41 @@ class Net_SMTP
/* Send EHLO again to recieve the AUTH string from the
* SMTP server. */
- $this->_negotiate();
+ $this->negotiate();
}
- if (empty($this->_esmtp['AUTH'])) {
+ if (empty($this->esmtp['AUTH'])) {
return PEAR::raiseError('SMTP server does not support authentication');
}
/* If no method has been specified, get the name of the best
* supported method advertised by the SMTP server. */
if (empty($method)) {
- if (PEAR::isError($method = $this->_getBestAuthMethod())) {
+ if (PEAR::isError($method = $this->getBestAuthMethod())) {
/* Return the PEAR_Error object from _getBestAuthMethod(). */
return $method;
}
} else {
$method = strtoupper($method);
- if (!in_array($method, $this->auth_methods)) {
+ if (!array_key_exists($method, $this->auth_methods)) {
return PEAR::raiseError("$method is not a supported authentication method");
}
}
- switch ($method) {
- case 'DIGEST-MD5':
- $result = $this->_authDigest_MD5($uid, $pwd);
- break;
+ if (!isset($this->auth_methods[$method])) {
+ return PEAR::raiseError("$method is not a supported authentication method");
+ }
- case 'CRAM-MD5':
- $result = $this->_authCRAM_MD5($uid, $pwd);
- break;
+ if (!is_callable($this->auth_methods[$method], false)) {
+ return PEAR::raiseError("$method authentication method cannot be called");
+ }
- case 'LOGIN':
- $result = $this->_authLogin($uid, $pwd);
- break;
-
- case 'PLAIN':
- $result = $this->_authPlain($uid, $pwd);
- break;
-
- default:
- $result = PEAR::raiseError("$method is not a supported authentication method");
- break;
+ if (is_array($this->auth_methods[$method])) {
+ list($object, $method) = $this->auth_methods[$method];
+ $result = $object->{$method}($uid, $pwd, $authz, $this);
+ } else {
+ $func = $this->auth_methods[$method];
+ $result = $func($uid, $pwd, $authz, $this);
}
/* If an error was encountered, return the PEAR_Error object. */
@@ -586,52 +635,94 @@ class Net_SMTP
return true;
}
+ /**
+ * Add a new authentication method.
+ *
+ * @param string $name The authentication method name (e.g. 'PLAIN')
+ * @param mixed $callback The authentication callback (given as the name of a
+ * function or as an (object, method name) array).
+ * @param bool $prepend Should the new method be prepended to the list of
+ * available methods? This is the default behavior,
+ * giving the new method the highest priority.
+ *
+ * @return mixed True on success or a PEAR_Error object on failure.
+ *
+ * @since 1.6.0
+ */
+ public function setAuthMethod($name, $callback, $prepend = true)
+ {
+ if (!is_string($name)) {
+ return PEAR::raiseError('Method name is not a string');
+ }
+
+ if (!is_string($callback) && !is_array($callback)) {
+ return PEAR::raiseError('Method callback must be string or array');
+ }
+
+ if (is_array($callback)) {
+ if (!is_object($callback[0]) || !is_string($callback[1])) {
+ return PEAR::raiseError('Bad mMethod callback array');
+ }
+ }
+
+ if ($prepend) {
+ $this->auth_methods = array_merge(
+ array($name => $callback), $this->auth_methods
+ );
+ } else {
+ $this->auth_methods[$name] = $callback;
+ }
+
+ return true;
+ }
+
/**
* Authenticates the user using the DIGEST-MD5 method.
*
- * @param string The userid to authenticate as.
- * @param string The password to authenticate with.
+ * @param string $uid The userid to authenticate as.
+ * @param string $pwd The password to authenticate with.
+ * @param string $authz The optional authorization proxy identifier.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _authDigest_MD5($uid, $pwd)
+ protected function authDigestMD5($uid, $pwd, $authz = '')
{
- if (PEAR::isError($error = $this->_put('AUTH', 'DIGEST-MD5'))) {
+ if (PEAR::isError($error = $this->put('AUTH', 'DIGEST-MD5'))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
/* 503: Error: already authenticated */
- if ($this->_code === 503) {
+ if ($this->code === 503) {
return true;
}
return $error;
}
- $challenge = base64_decode($this->_arguments[0]);
- $digest = &Auth_SASL::factory('digestmd5');
- $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge,
- $this->host, "smtp"));
+ $digest = Auth_SASL::factory('digest-md5');
+ $challenge = base64_decode($this->arguments[0]);
+ $auth_str = base64_encode(
+ $digest->getResponse($uid, $pwd, $challenge, $this->host, "smtp", $authz)
+ );
- if (PEAR::isError($error = $this->_put($auth_str))) {
+ if (PEAR::isError($error = $this->put($auth_str))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
return $error;
}
/* We don't use the protocol's third step because SMTP doesn't
* allow subsequent authentication, so we just silently ignore
* it. */
- if (PEAR::isError($error = $this->_put(''))) {
+ if (PEAR::isError($error = $this->put(''))) {
return $error;
}
/* 235: Authentication successful */
- if (PEAR::isError($error = $this->_parseResponse(235))) {
+ if (PEAR::isError($error = $this->parseResponse(235))) {
return $error;
}
}
@@ -639,38 +730,38 @@ class Net_SMTP
/**
* Authenticates the user using the CRAM-MD5 method.
*
- * @param string The userid to authenticate as.
- * @param string The password to authenticate with.
+ * @param string $uid The userid to authenticate as.
+ * @param string $pwd The password to authenticate with.
+ * @param string $authz The optional authorization proxy identifier.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _authCRAM_MD5($uid, $pwd)
+ protected function authCRAMMD5($uid, $pwd, $authz = '')
{
- if (PEAR::isError($error = $this->_put('AUTH', 'CRAM-MD5'))) {
+ if (PEAR::isError($error = $this->put('AUTH', 'CRAM-MD5'))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
/* 503: Error: already authenticated */
- if ($this->_code === 503) {
+ if ($this->code === 503) {
return true;
}
return $error;
}
- $challenge = base64_decode($this->_arguments[0]);
- $cram = &Auth_SASL::factory('crammd5');
- $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));
+ $challenge = base64_decode($this->arguments[0]);
+ $cram = Auth_SASL::factory('cram-md5');
+ $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));
- if (PEAR::isError($error = $this->_put($auth_str))) {
+ if (PEAR::isError($error = $this->put($auth_str))) {
return $error;
}
/* 235: Authentication successful */
- if (PEAR::isError($error = $this->_parseResponse(235))) {
+ if (PEAR::isError($error = $this->parseResponse(235))) {
return $error;
}
}
@@ -678,42 +769,42 @@ class Net_SMTP
/**
* Authenticates the user using the LOGIN method.
*
- * @param string The userid to authenticate as.
- * @param string The password to authenticate with.
+ * @param string $uid The userid to authenticate as.
+ * @param string $pwd The password to authenticate with.
+ * @param string $authz The optional authorization proxy identifier.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _authLogin($uid, $pwd)
+ protected function authLogin($uid, $pwd, $authz = '')
{
- if (PEAR::isError($error = $this->_put('AUTH', 'LOGIN'))) {
+ if (PEAR::isError($error = $this->put('AUTH', 'LOGIN'))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
/* 503: Error: already authenticated */
- if ($this->_code === 503) {
+ if ($this->code === 503) {
return true;
}
return $error;
}
- if (PEAR::isError($error = $this->_put(base64_encode($uid)))) {
+ if (PEAR::isError($error = $this->put(base64_encode($uid)))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
return $error;
}
- if (PEAR::isError($error = $this->_put(base64_encode($pwd)))) {
+ if (PEAR::isError($error = $this->put(base64_encode($pwd)))) {
return $error;
}
/* 235: Authentication successful */
- if (PEAR::isError($error = $this->_parseResponse(235))) {
+ if (PEAR::isError($error = $this->parseResponse(235))) {
return $error;
}
@@ -723,36 +814,36 @@ class Net_SMTP
/**
* Authenticates the user using the PLAIN method.
*
- * @param string The userid to authenticate as.
- * @param string The password to authenticate with.
+ * @param string $uid The userid to authenticate as.
+ * @param string $pwd The password to authenticate with.
+ * @param string $authz The optional authorization proxy identifier.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access private
- * @since 1.1.0
+ * @since 1.1.0
*/
- function _authPlain($uid, $pwd)
+ protected function authPlain($uid, $pwd, $authz = '')
{
- if (PEAR::isError($error = $this->_put('AUTH', 'PLAIN'))) {
+ if (PEAR::isError($error = $this->put('AUTH', 'PLAIN'))) {
return $error;
}
/* 334: Continue authentication request */
- if (PEAR::isError($error = $this->_parseResponse(334))) {
+ if (PEAR::isError($error = $this->parseResponse(334))) {
/* 503: Error: already authenticated */
- if ($this->_code === 503) {
+ if ($this->code === 503) {
return true;
}
return $error;
}
- $auth_str = base64_encode(chr(0) . $uid . chr(0) . $pwd);
+ $auth_str = base64_encode($authz . chr(0) . $uid . chr(0) . $pwd);
- if (PEAR::isError($error = $this->_put($auth_str))) {
+ if (PEAR::isError($error = $this->put($auth_str))) {
return $error;
}
/* 235: Authentication successful */
- if (PEAR::isError($error = $this->_parseResponse(235))) {
+ if (PEAR::isError($error = $this->parseResponse(235))) {
return $error;
}
@@ -762,19 +853,18 @@ class Net_SMTP
/**
* Send the HELO command.
*
- * @param string The domain name to say we are.
+ * @param string $domain The domain name to say we are.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function helo($domain)
+ public function helo($domain)
{
- if (PEAR::isError($error = $this->_put('HELO', $domain))) {
+ if (PEAR::isError($error = $this->put('HELO', $domain))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250))) {
+ if (PEAR::isError($error = $this->parseResponse(250))) {
return $error;
}
@@ -785,55 +875,50 @@ class Net_SMTP
* Return the list of SMTP service extensions advertised by the server.
*
* @return array The list of SMTP service extensions.
- * @access public
* @since 1.3
*/
- function getServiceExtensions()
+ public function getServiceExtensions()
{
- return $this->_esmtp;
+ return $this->esmtp;
}
/**
* Send the MAIL FROM: command.
*
- * @param string $sender The sender (reverse path) to set.
- * @param string $params String containing additional MAIL parameters,
- * such as the NOTIFY flags defined by RFC 1891
- * or the VERP protocol.
+ * @param string $sender The sender (reverse path) to set.
+ * @param string $params String containing additional MAIL parameters,
+ * such as the NOTIFY flags defined by RFC 1891
+ * or the VERP protocol.
*
- * If $params is an array, only the 'verp' option
- * is supported. If 'verp' is true, the XVERP
- * parameter is appended to the MAIL command. If
- * the 'verp' value is a string, the full
- * XVERP=value parameter is appended.
+ * If $params is an array, only the 'verp' option
+ * is supported. If 'verp' is true, the XVERP
+ * parameter is appended to the MAIL command.
+ * If the 'verp' value is a string, the full
+ * XVERP=value parameter is appended.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function mailFrom($sender, $params = null)
+ public function mailFrom($sender, $params = null)
{
$args = "FROM:<$sender>";
/* Support the deprecated array form of $params. */
if (is_array($params) && isset($params['verp'])) {
- /* XVERP */
if ($params['verp'] === true) {
$args .= ' XVERP';
-
- /* XVERP=something */
} elseif (trim($params['verp'])) {
$args .= ' XVERP=' . $params['verp'];
}
- } elseif (is_string($params)) {
+ } elseif (is_string($params) && !empty($params)) {
$args .= ' ' . $params;
}
- if (PEAR::isError($error = $this->_put('MAIL', $args))) {
+ if (PEAR::isError($error = $this->put('MAIL', $args))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
@@ -850,20 +935,19 @@ class Net_SMTP
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function rcptTo($recipient, $params = null)
+ public function rcptTo($recipient, $params = null)
{
$args = "TO:<$recipient>";
if (is_string($params)) {
$args .= ' ' . $params;
}
- if (PEAR::isError($error = $this->_put('RCPT', $args))) {
+ if (PEAR::isError($error = $this->put('RCPT', $args))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(array(250, 251), $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(array(250, 251), $this->pipelining))) {
return $error;
}
@@ -877,83 +961,77 @@ class Net_SMTP
* easier overloading for the cases where it is desirable to
* customize the quoting behavior.
*
- * @param string $data The message text to quote. The string must be passed
+ * @param string &$data The message text to quote. The string must be passed
* by reference, and the text will be modified in place.
*
- * @access public
- * @since 1.2
+ * @since 1.2
*/
- function quotedata(&$data)
+ public function quotedata(&$data)
{
- /* Change Unix (\n) and Mac (\r) linefeeds into
- * Internet-standard CRLF (\r\n) linefeeds. */
- $data = preg_replace(array('/(?_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) {
- /* Start by considering the size of the optional headers string.
- * We also account for the addition 4 character "\r\n\r\n"
- * separator sequence. */
- $size = (is_null($headers)) ? 0 : strlen($headers) + 4;
+ /* Start by considering the size of the optional headers string. We
+ * also account for the addition 4 character "\r\n\r\n" separator
+ * sequence. */
+ $size = (is_null($headers)) ? 0 : strlen($headers) + 4;
- if (is_resource($data)) {
- $stat = fstat($data);
- if ($stat === false) {
- return PEAR::raiseError('Failed to get file size');
- }
- $size += $stat['size'];
- } else {
- $size += strlen($data);
+ if (is_resource($data)) {
+ $stat = fstat($data);
+ if ($stat === false) {
+ return PEAR::raiseError('Failed to get file size');
}
+ $size += $stat['size'];
+ } else {
+ $size += strlen($data);
+ }
- if ($size >= $this->_esmtp['SIZE']) {
- $this->disconnect();
- return PEAR::raiseError('Message size exceeds server limit');
- }
+ /* RFC 1870, section 3, subsection 3 states "a value of zero indicates
+ * that no fixed maximum message size is in force". Furthermore, it
+ * says that if "the parameter is omitted no information is conveyed
+ * about the server's fixed maximum message size". */
+ $limit = (isset($this->esmtp['SIZE'])) ? $this->esmtp['SIZE'] : 0;
+ if ($limit > 0 && $size >= $limit) {
+ $this->disconnect();
+ return PEAR::raiseError('Message size exceeds server limit');
}
/* Initiate the DATA command. */
- if (PEAR::isError($error = $this->_put('DATA'))) {
+ if (PEAR::isError($error = $this->put('DATA'))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(354))) {
+ if (PEAR::isError($error = $this->parseResponse(354))) {
return $error;
}
/* If we have a separate headers string, send it first. */
if (!is_null($headers)) {
$this->quotedata($headers);
- if (PEAR::isError($result = $this->_send($headers . "\r\n\r\n"))) {
+ if (PEAR::isError($result = $this->send($headers . "\r\n\r\n"))) {
return $result;
}
}
@@ -963,28 +1041,72 @@ class Net_SMTP
/* Stream the contents of the file resource out over our socket
* connection, line by line. Each line must be run through the
* quoting routine. */
- while ($line = fgets($data, 1024)) {
+ while (strlen($line = fread($data, 8192)) > 0) {
+ /* If the last character is an newline, we need to grab the
+ * next character to check to see if it is a period. */
+ while (!feof($data)) {
+ $char = fread($data, 1);
+ $line .= $char;
+ if ($char != "\n") {
+ break;
+ }
+ }
$this->quotedata($line);
- if (PEAR::isError($result = $this->_send($line))) {
+ if (PEAR::isError($result = $this->send($line))) {
return $result;
}
}
- /* Finally, send the DATA terminator sequence. */
- if (PEAR::isError($result = $this->_send("\r\n.\r\n"))) {
- return $result;
- }
+ $last = $line;
} else {
- /* Just send the entire quoted string followed by the DATA
- * terminator. */
- $this->quotedata($data);
- if (PEAR::isError($result = $this->_send($data . "\r\n.\r\n"))) {
- return $result;
+ /*
+ * Break up the data by sending one chunk (up to 512k) at a time.
+ * This approach reduces our peak memory usage.
+ */
+ for ($offset = 0; $offset < $size;) {
+ $end = $offset + 512000;
+
+ /*
+ * Ensure we don't read beyond our data size or span multiple
+ * lines. quotedata() can't properly handle character data
+ * that's split across two line break boundaries.
+ */
+ if ($end >= $size) {
+ $end = $size;
+ } else {
+ for (; $end < $size; $end++) {
+ if ($data[$end] != "\n") {
+ break;
+ }
+ }
+ }
+
+ /* Extract our chunk and run it through the quoting routine. */
+ $chunk = substr($data, $offset, $end - $offset);
+ $this->quotedata($chunk);
+
+ /* If we run into a problem along the way, abort. */
+ if (PEAR::isError($result = $this->send($chunk))) {
+ return $result;
+ }
+
+ /* Advance the offset to the end of this chunk. */
+ $offset = $end;
}
+
+ $last = $chunk;
+ }
+
+ /* Don't add another CRLF sequence if it's already in the data */
+ $terminator = (substr($last, -2) == "\r\n" ? '' : "\r\n") . ".\r\n";
+
+ /* Finally, send the DATA terminator sequence. */
+ if (PEAR::isError($result = $this->send($terminator))) {
+ return $result;
}
/* Verify that the data was successfully received by the server. */
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
@@ -994,134 +1116,79 @@ class Net_SMTP
/**
* Send the SEND FROM: command.
*
- * @param string The reverse path to send.
+ * @param string $path The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.2.6
+ * @since 1.2.6
*/
- function sendFrom($path)
+ public function sendFrom($path)
{
- if (PEAR::isError($error = $this->_put('SEND', "FROM:<$path>"))) {
+ if (PEAR::isError($error = $this->put('SEND', "FROM:<$path>"))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
return true;
}
- /**
- * Backwards-compatibility wrapper for sendFrom().
- *
- * @param string The reverse path to send.
- *
- * @return mixed Returns a PEAR_Error with an error message on any
- * kind of failure, or true on success.
- *
- * @access public
- * @since 1.0
- * @deprecated 1.2.6
- */
- function send_from($path)
- {
- return sendFrom($path);
- }
-
/**
* Send the SOML FROM: command.
*
- * @param string The reverse path to send.
+ * @param string $path The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.2.6
+ * @since 1.2.6
*/
- function somlFrom($path)
+ public function somlFrom($path)
{
- if (PEAR::isError($error = $this->_put('SOML', "FROM:<$path>"))) {
+ if (PEAR::isError($error = $this->put('SOML', "FROM:<$path>"))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
return true;
}
- /**
- * Backwards-compatibility wrapper for somlFrom().
- *
- * @param string The reverse path to send.
- *
- * @return mixed Returns a PEAR_Error with an error message on any
- * kind of failure, or true on success.
- *
- * @access public
- * @since 1.0
- * @deprecated 1.2.6
- */
- function soml_from($path)
- {
- return somlFrom($path);
- }
-
/**
* Send the SAML FROM: command.
*
- * @param string The reverse path to send.
+ * @param string $path The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.2.6
+ * @since 1.2.6
*/
- function samlFrom($path)
+ public function samlFrom($path)
{
- if (PEAR::isError($error = $this->_put('SAML', "FROM:<$path>"))) {
+ if (PEAR::isError($error = $this->put('SAML', "FROM:<$path>"))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
return true;
}
- /**
- * Backwards-compatibility wrapper for samlFrom().
- *
- * @param string The reverse path to send.
- *
- * @return mixed Returns a PEAR_Error with an error message on any
- * kind of failure, or true on success.
- *
- * @access public
- * @since 1.0
- * @deprecated 1.2.6
- */
- function saml_from($path)
- {
- return samlFrom($path);
- }
-
/**
* Send the RSET command.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
* @since 1.0
*/
- function rset()
+ public function rset()
{
- if (PEAR::isError($error = $this->_put('RSET'))) {
+ if (PEAR::isError($error = $this->put('RSET'))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) {
+ if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) {
return $error;
}
@@ -1131,20 +1198,19 @@ class Net_SMTP
/**
* Send the VRFY command.
*
- * @param string The string to verify
+ * @param string $string The string to verify
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function vrfy($string)
+ public function vrfy($string)
{
/* Note: 251 is also a valid response code */
- if (PEAR::isError($error = $this->_put('VRFY', $string))) {
+ if (PEAR::isError($error = $this->put('VRFY', $string))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(array(250, 252)))) {
+ if (PEAR::isError($error = $this->parseResponse(array(250, 252)))) {
return $error;
}
@@ -1156,15 +1222,14 @@ class Net_SMTP
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function noop()
+ public function noop()
{
- if (PEAR::isError($error = $this->_put('NOOP'))) {
+ if (PEAR::isError($error = $this->put('NOOP'))) {
return $error;
}
- if (PEAR::isError($error = $this->_parseResponse(250))) {
+ if (PEAR::isError($error = $this->parseResponse(250))) {
return $error;
}
@@ -1175,14 +1240,12 @@ class Net_SMTP
* Backwards-compatibility method. identifySender()'s functionality is
* now handled internally.
*
- * @return boolean This method always return true.
+ * @return boolean This method always return true.
*
- * @access public
- * @since 1.0
+ * @since 1.0
*/
- function identifySender()
+ public function identifySender()
{
return true;
}
-
}
From 826503766e7f41dc5bb74c3932f8bad84f4d0ce3 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 13:35:53 +0100
Subject: [PATCH 029/415] Jean Lucas mentioned that PEAR::Net_Socket was
outdated
Updated Net_Socket to 1.0.14 (stable) was released on 2013-05-24
https://pear.php.net/package/Net_Socket
---
extlib/Net/Socket.php | 304 +++++++++++++++++++++++++++---------------
1 file changed, 199 insertions(+), 105 deletions(-)
diff --git a/extlib/Net/Socket.php b/extlib/Net/Socket.php
index 73bb4dd11f..bf1d1bbcd1 100644
--- a/extlib/Net/Socket.php
+++ b/extlib/Net/Socket.php
@@ -1,39 +1,50 @@
|
-// | Chuck Hagenbuch |
-// +----------------------------------------------------------------------+
-//
-// $Id: Socket.php,v 1.38 2008/02/15 18:24:17 chagenbu Exp $
+/**
+ * Net_Socket
+ *
+ * PHP Version 4
+ *
+ * Copyright (c) 1997-2013 The PHP Group
+ *
+ * This source file is subject to version 2.0 of the PHP license,
+ * that is bundled with this package in the file LICENSE, and is
+ * available at through the world-wide-web at
+ * http://www.php.net/license/2_02.txt.
+ * If you did not receive a copy of the PHP license and are unable to
+ * obtain it through the world-wide-web, please send a note to
+ * license@php.net so we can mail you a copy immediately.
+ *
+ * Authors: Stig Bakken
+ * Chuck Hagenbuch
+ *
+ * @category Net
+ * @package Net_Socket
+ * @author Stig Bakken
+ * @author Chuck Hagenbuch
+ * @copyright 1997-2003 The PHP Group
+ * @license http://www.php.net/license/2_02.txt PHP 2.02
+ * @link http://pear.php.net/packages/Net_Socket
+ */
require_once 'PEAR.php';
-define('NET_SOCKET_READ', 1);
+define('NET_SOCKET_READ', 1);
define('NET_SOCKET_WRITE', 2);
define('NET_SOCKET_ERROR', 4);
/**
* Generalized Socket class.
*
- * @version 1.1
- * @author Stig Bakken
- * @author Chuck Hagenbuch
+ * @category Net
+ * @package Net_Socket
+ * @author Stig Bakken
+ * @author Chuck Hagenbuch
+ * @copyright 1997-2003 The PHP Group
+ * @license http://www.php.net/license/2_02.txt PHP 2.02
+ * @link http://pear.php.net/packages/Net_Socket
*/
-class Net_Socket extends PEAR {
-
+class Net_Socket extends PEAR
+{
/**
* Socket file pointer.
* @var resource $fp
@@ -65,11 +76,11 @@ class Net_Socket extends PEAR {
var $port = 0;
/**
- * Number of seconds to wait on socket connections before assuming
+ * Number of seconds to wait on socket operations before assuming
* there's no more data. Defaults to no timeout.
- * @var integer $timeout
+ * @var integer|float $timeout
*/
- var $timeout = false;
+ var $timeout = null;
/**
* Number of bytes to read at a time in readLine() and
@@ -78,23 +89,30 @@ class Net_Socket extends PEAR {
*/
var $lineLength = 2048;
+ /**
+ * The string to use as a newline terminator. Usually "\r\n" or "\n".
+ * @var string $newline
+ */
+ var $newline = "\r\n";
+
/**
* Connect to the specified port. If called when the socket is
* already connected, it disconnects and connects again.
*
- * @param string $addr IP address or host name.
- * @param integer $port TCP port number.
- * @param boolean $persistent (optional) Whether the connection is
- * persistent (kept open between requests
- * by the web server).
- * @param integer $timeout (optional) How long to wait for data.
- * @param array $options See options for stream_context_create.
+ * @param string $addr IP address or host name (may be with protocol prefix).
+ * @param integer $port TCP port number.
+ * @param boolean $persistent (optional) Whether the connection is
+ * persistent (kept open between requests
+ * by the web server).
+ * @param integer $timeout (optional) Connection socket timeout.
+ * @param array $options See options for stream_context_create.
*
* @access public
*
- * @return boolean | PEAR_Error True on success or a PEAR_Error on failure.
+ * @return boolean|PEAR_Error True on success or a PEAR_Error on failure.
*/
- function connect($addr, $port = 0, $persistent = null, $timeout = null, $options = null)
+ function connect($addr, $port = 0, $persistent = null,
+ $timeout = null, $options = null)
{
if (is_resource($this->fp)) {
@fclose($this->fp);
@@ -103,11 +121,10 @@ class Net_Socket extends PEAR {
if (!$addr) {
return $this->raiseError('$addr cannot be empty');
- } elseif (strspn($addr, '.0123456789') == strlen($addr) ||
- strstr($addr, '/') !== false) {
- $this->addr = $addr;
+ } else if (strspn($addr, ':.0123456789') == strlen($addr)) {
+ $this->addr = strpos($addr, ':') !== false ? '['.$addr.']' : $addr;
} else {
- $this->addr = @gethostbyname($addr);
+ $this->addr = $addr;
}
$this->port = $port % 65536;
@@ -116,40 +133,40 @@ class Net_Socket extends PEAR {
$this->persistent = $persistent;
}
- if ($timeout !== null) {
- $this->timeout = $timeout;
+ $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
+ $errno = 0;
+ $errstr = '';
+
+ $old_track_errors = @ini_set('track_errors', 1);
+
+ if ($timeout <= 0) {
+ $timeout = @ini_get('default_socket_timeout');
}
- $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
- $errno = 0;
- $errstr = '';
- $old_track_errors = @ini_set('track_errors', 1);
if ($options && function_exists('stream_context_create')) {
- if ($this->timeout) {
- $timeout = $this->timeout;
- } else {
- $timeout = 0;
- }
$context = stream_context_create($options);
// Since PHP 5 fsockopen doesn't allow context specification
if (function_exists('stream_socket_client')) {
- $flags = $this->persistent ? STREAM_CLIENT_PERSISTENT : STREAM_CLIENT_CONNECT;
+ $flags = STREAM_CLIENT_CONNECT;
+
+ if ($this->persistent) {
+ $flags = STREAM_CLIENT_PERSISTENT;
+ }
+
$addr = $this->addr . ':' . $this->port;
- $fp = stream_socket_client($addr, $errno, $errstr, $timeout, $flags, $context);
+ $fp = stream_socket_client($addr, $errno, $errstr,
+ $timeout, $flags, $context);
} else {
- $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context);
+ $fp = @$openfunc($this->addr, $this->port, $errno,
+ $errstr, $timeout, $context);
}
} else {
- if ($this->timeout) {
- $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout);
- } else {
- $fp = @$openfunc($this->addr, $this->port, $errno, $errstr);
- }
+ $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout);
}
if (!$fp) {
- if ($errno == 0 && isset($php_errormsg)) {
+ if ($errno == 0 && !strlen($errstr) && isset($php_errormsg)) {
$errstr = $php_errormsg;
}
@ini_set('track_errors', $old_track_errors);
@@ -158,7 +175,7 @@ class Net_Socket extends PEAR {
@ini_set('track_errors', $old_track_errors);
$this->fp = $fp;
-
+ $this->setTimeout();
return $this->setBlocking($this->blocking);
}
@@ -179,6 +196,18 @@ class Net_Socket extends PEAR {
return true;
}
+ /**
+ * Set the newline character/sequence to use.
+ *
+ * @param string $newline Newline character(s)
+ * @return boolean True
+ */
+ function setNewline($newline)
+ {
+ $this->newline = $newline;
+ return true;
+ }
+
/**
* Find out if the socket is in blocking mode.
*
@@ -196,7 +225,8 @@ class Net_Socket extends PEAR {
* if there is no data available, whereas it will block until there
* is data for blocking sockets.
*
- * @param boolean $mode True for blocking sockets, false for nonblocking.
+ * @param boolean $mode True for blocking sockets, false for nonblocking.
+ *
* @access public
* @return mixed true on success or a PEAR_Error instance otherwise
*/
@@ -207,7 +237,7 @@ class Net_Socket extends PEAR {
}
$this->blocking = $mode;
- socket_set_blocking($this->fp, $this->blocking);
+ stream_set_blocking($this->fp, (int)$this->blocking);
return true;
}
@@ -215,25 +245,40 @@ class Net_Socket extends PEAR {
* Sets the timeout value on socket descriptor,
* expressed in the sum of seconds and microseconds
*
- * @param integer $seconds Seconds.
- * @param integer $microseconds Microseconds.
+ * @param integer $seconds Seconds.
+ * @param integer $microseconds Microseconds, optional.
+ *
* @access public
- * @return mixed true on success or a PEAR_Error instance otherwise
+ * @return mixed True on success or false on failure or
+ * a PEAR_Error instance when not connected
*/
- function setTimeout($seconds, $microseconds)
+ function setTimeout($seconds = null, $microseconds = null)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
- return socket_set_timeout($this->fp, $seconds, $microseconds);
+ if ($seconds === null && $microseconds === null) {
+ $seconds = (int) $this->timeout;
+ $microseconds = (int) (($this->timeout - $seconds) * 1000000);
+ } else {
+ $this->timeout = $seconds + $microseconds/1000000;
+ }
+
+ if ($this->timeout > 0) {
+ return stream_set_timeout($this->fp, (int) $seconds, (int) $microseconds);
+ }
+ else {
+ return false;
+ }
}
/**
* Sets the file buffering size on the stream.
* See php's stream_set_write_buffer for more information.
*
- * @param integer $size Write buffer size.
+ * @param integer $size Write buffer size.
+ *
* @access public
* @return mixed on success or an PEAR_Error object otherwise
*/
@@ -262,7 +307,8 @@ class Net_Socket extends PEAR {
*
*
* @access public
- * @return mixed Array containing information about existing socket resource or a PEAR_Error instance otherwise
+ * @return mixed Array containing information about existing socket
+ * resource or a PEAR_Error instance otherwise
*/
function getStatus()
{
@@ -270,23 +316,32 @@ class Net_Socket extends PEAR {
return $this->raiseError('not connected');
}
- return socket_get_status($this->fp);
+ return stream_get_meta_data($this->fp);
}
/**
* Get a specified line of data
*
+ * @param int $size Reading ends when size - 1 bytes have been read,
+ * or a newline or an EOF (whichever comes first).
+ * If no size is specified, it will keep reading from
+ * the stream until it reaches the end of the line.
+ *
* @access public
- * @return $size bytes of data from the socket, or a PEAR_Error if
- * not connected.
+ * @return mixed $size bytes of data from the socket, or a PEAR_Error if
+ * not connected. If an error occurs, FALSE is returned.
*/
- function gets($size)
+ function gets($size = null)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
- return @fgets($this->fp, $size);
+ if (is_null($size)) {
+ return @fgets($this->fp);
+ } else {
+ return @fgets($this->fp, $size);
+ }
}
/**
@@ -295,7 +350,8 @@ class Net_Socket extends PEAR {
* chunk; if you know the size of the data you're getting
* beforehand, this is definitely the way to go.
*
- * @param integer $size The number of bytes to read from the socket.
+ * @param integer $size The number of bytes to read from the socket.
+ *
* @access public
* @return $size bytes of data from the socket, or a PEAR_Error if
* not connected.
@@ -312,14 +368,16 @@ class Net_Socket extends PEAR {
/**
* Write a specified amount of data.
*
- * @param string $data Data to write.
- * @param integer $blocksize Amount of data to write at once.
- * NULL means all at once.
+ * @param string $data Data to write.
+ * @param integer $blocksize Amount of data to write at once.
+ * NULL means all at once.
*
* @access public
- * @return mixed If the socket is not connected, returns an instance of PEAR_Error
- * If the write succeeds, returns the number of bytes written
+ * @return mixed If the socket is not connected, returns an instance of
+ * PEAR_Error.
+ * If the write succeeds, returns the number of bytes written.
* If the write fails, returns false.
+ * If the socket times out, returns an instance of PEAR_Error.
*/
function write($data, $blocksize = null)
{
@@ -328,19 +386,47 @@ class Net_Socket extends PEAR {
}
if (is_null($blocksize) && !OS_WINDOWS) {
- return @fwrite($this->fp, $data);
+ $written = @fwrite($this->fp, $data);
+
+ // Check for timeout or lost connection
+ if (!$written) {
+ $meta_data = $this->getStatus();
+
+ if (!is_array($meta_data)) {
+ return $meta_data; // PEAR_Error
+ }
+
+ if (!empty($meta_data['timed_out'])) {
+ return $this->raiseError('timed out');
+ }
+ }
+
+ return $written;
} else {
if (is_null($blocksize)) {
$blocksize = 1024;
}
- $pos = 0;
+ $pos = 0;
$size = strlen($data);
while ($pos < $size) {
$written = @fwrite($this->fp, substr($data, $pos, $blocksize));
- if ($written === false) {
- return false;
+
+ // Check for timeout or lost connection
+ if (!$written) {
+ $meta_data = $this->getStatus();
+
+ if (!is_array($meta_data)) {
+ return $meta_data; // PEAR_Error
+ }
+
+ if (!empty($meta_data['timed_out'])) {
+ return $this->raiseError('timed out');
+ }
+
+ return $written;
}
+
$pos += $written;
}
@@ -349,10 +435,12 @@ class Net_Socket extends PEAR {
}
/**
- * Write a line of data to the socket, followed by a trailing "\r\n".
+ * Write a line of data to the socket, followed by a trailing newline.
+ *
+ * @param string $data Data to write
*
* @access public
- * @return mixed fputs result, or an error
+ * @return mixed fwrite() result, or PEAR_Error when not connected
*/
function writeLine($data)
{
@@ -360,7 +448,7 @@ class Net_Socket extends PEAR {
return $this->raiseError('not connected');
}
- return fwrite($this->fp, $data . "\r\n");
+ return fwrite($this->fp, $data . $this->newline);
}
/**
@@ -441,7 +529,7 @@ class Net_Socket extends PEAR {
}
$string = '';
- while (($char = @fread($this->fp, 1)) != "\x00") {
+ while (($char = @fread($this->fp, 1)) != "\x00") {
$string .= $char;
}
return $string;
@@ -481,11 +569,13 @@ class Net_Socket extends PEAR {
}
$line = '';
+
$timeout = time() + $this->timeout;
+
while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
$line .= @fgets($this->fp, $this->lineLength);
if (substr($line, -1) == "\n") {
- return rtrim($line, "\r\n");
+ return rtrim($line, $this->newline);
}
}
return $line;
@@ -521,9 +611,9 @@ class Net_Socket extends PEAR {
* Runs the equivalent of the select() system call on the socket
* with a timeout specified by tv_sec and tv_usec.
*
- * @param integer $state Which of read/write/error to check for.
- * @param integer $tv_sec Number of seconds for timeout.
- * @param integer $tv_usec Number of microseconds for timeout.
+ * @param integer $state Which of read/write/error to check for.
+ * @param integer $tv_sec Number of seconds for timeout.
+ * @param integer $tv_usec Number of microseconds for timeout.
*
* @access public
* @return False if select fails, integer describing which of read/write/error
@@ -535,8 +625,8 @@ class Net_Socket extends PEAR {
return $this->raiseError('not connected');
}
- $read = null;
- $write = null;
+ $read = null;
+ $write = null;
$except = null;
if ($state & NET_SOCKET_READ) {
$read[] = $this->fp;
@@ -547,7 +637,8 @@ class Net_Socket extends PEAR {
if ($state & NET_SOCKET_ERROR) {
$except[] = $this->fp;
}
- if (false === ($sr = stream_select($read, $write, $except, $tv_sec, $tv_usec))) {
+ if (false === ($sr = stream_select($read, $write, $except,
+ $tv_sec, $tv_usec))) {
return false;
}
@@ -567,15 +658,17 @@ class Net_Socket extends PEAR {
/**
* Turns encryption on/off on a connected socket.
*
- * @param bool $enabled Set this parameter to true to enable encryption
- * and false to disable encryption.
- * @param integer $type Type of encryption. See
- * http://se.php.net/manual/en/function.stream-socket-enable-crypto.php for values.
+ * @param bool $enabled Set this parameter to true to enable encryption
+ * and false to disable encryption.
+ * @param integer $type Type of encryption. See stream_socket_enable_crypto()
+ * for values.
*
+ * @see http://se.php.net/manual/en/function.stream-socket-enable-crypto.php
* @access public
- * @return false on error, true on success and 0 if there isn't enough data and the
- * user should try again (non-blocking sockets only). A PEAR_Error object
- * is returned if the socket is not connected
+ * @return false on error, true on success and 0 if there isn't enough data
+ * and the user should try again (non-blocking sockets only).
+ * A PEAR_Error object is returned if the socket is not
+ * connected
*/
function enableCrypto($enabled, $type)
{
@@ -585,7 +678,8 @@ class Net_Socket extends PEAR {
}
return @stream_socket_enable_crypto($this->fp, $enabled, $type);
} else {
- return $this->raiseError('Net_Socket::enableCrypto() requires php version >= 5.1.0');
+ $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0';
+ return $this->raiseError($msg);
}
}
From a3c5ef59d6b79d91d8eceaeb2085407386182aed Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 13:41:14 +0100
Subject: [PATCH 030/415] Fix merge #101 by replacing a non-working Yahoo! link
with Wikipedia
The link was meant to describe robots.txt crawl-delay info
---
CONFIGURE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONFIGURE b/CONFIGURE
index 362448a3b6..b1773347d4 100644
--- a/CONFIGURE
+++ b/CONFIGURE
@@ -674,7 +674,7 @@ Web crawlers. See http://www.robotstxt.org/ for more information
on the format of this file.
crawldelay: if non-empty, this value is provided as the Crawl-Delay:
- for the robots.txt file. see https://help.yahoo.com/kb/search
+ for the robots.txt file. see
for more information. Default is zero, no explicit delay.
disallow: Array of (virtual) directories to disallow. Default is 'main',
'search', 'message', 'settings', 'admin'. Ignored when site
From 8356c2495cfae61e3e6bac67cfcf3cba1904364f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 13:52:25 +0100
Subject: [PATCH 031/415] Use mb_* and strict === comparison
---
classes/File.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index c6677c2fd3..4e51be4938 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -109,8 +109,8 @@ class File extends Managed_DataObject
// if the given url is an local attachment url and the id already exists, don't
// save a new file record. This should never happen, but let's make it foolproof
$attachment_path = common_path('attachment/');
- if(strpos($given_url,$attachment_path) == 0) {
- $possible_file_id = substr($given_url,strlen($attachment_path));
+ if (mb_strpos($given_url,$attachment_path) === 0) {
+ $possible_file_id = mb_substr($given_url, mb_strlen($attachment_path));
if(is_numeric($possible_file_id)) {
$file = File::getKV('id',$possible_file_id);
if($file instanceof File) {
From 6a4470912f534992e05412cb53adbeeac3978356 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 14:10:32 +0100
Subject: [PATCH 032/415] Fiddling with merge request #98 to use internal
routing functions
---
classes/File.php | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index 4e51be4938..8d9ecf5195 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -108,13 +108,20 @@ class File extends Managed_DataObject
// if the given url is an local attachment url and the id already exists, don't
// save a new file record. This should never happen, but let's make it foolproof
- $attachment_path = common_path('attachment/');
- if (mb_strpos($given_url,$attachment_path) === 0) {
- $possible_file_id = mb_substr($given_url, mb_strlen($attachment_path));
- if(is_numeric($possible_file_id)) {
- $file = File::getKV('id',$possible_file_id);
- if($file instanceof File) {
+ // FIXME: how about attachments servers?
+ $u = parse_url($given_url);
+ if (isset($u['host']) && $u['host'] === common_config('site', 'server')) {
+ $r = Router::get();
+ $args = $r->map(mb_substr($u['path']));
+ if ($args['action'] === 'attachment') {
+ try {
+ // $args['attachment'] should always be set if action===attachment, given our routing rules
+ $file = File::getByID($args['attachment']);
return $file;
+ } catch (EmptyIdException $e) {
+ // ...but $args['attachment'] can also be 0...
+ } catch (NoResultException $e) {
+ // apparently this link goes to us, but is _not_ an existing attachment (File) ID?
}
}
}
From 1e6520fddd36a56ae501e91928cc6fab0fd41cc6 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 14:13:46 +0100
Subject: [PATCH 033/415] Woops, forgot to skip the / in path
---
classes/File.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/classes/File.php b/classes/File.php
index 8d9ecf5195..ef4b2cfb3c 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -112,7 +112,8 @@ class File extends Managed_DataObject
$u = parse_url($given_url);
if (isset($u['host']) && $u['host'] === common_config('site', 'server')) {
$r = Router::get();
- $args = $r->map(mb_substr($u['path']));
+ // Skip the / in the beginning or $r->map won't match
+ $args = $r->map(mb_substr($u['path'], 1));
if ($args['action'] === 'attachment') {
try {
// $args['attachment'] should always be set if action===attachment, given our routing rules
From 52a3764ae406f63f7177f4cbefaf5eb23375150c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 14:46:26 +0100
Subject: [PATCH 034/415] Resolve relative URLs (assuming URI.Base==notice URL)
The real way to do this would be to get the xml:base property from
the Atom feed but it's probably not there in any posts we see today.
---
classes/Notice.php | 4 ++--
lib/util.php | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 892f2be30e..2bae300115 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -854,8 +854,8 @@ class Notice extends Managed_DataObject
if (mb_strlen($content)===0 && !is_null($actobj)) {
$content = mb_strlen($actobj->content) ? $actobj->content : $actobj->summary;
}
- // Strip out any bad HTML from $content
- $stored->rendered = common_purify($content);
+ // Strip out any bad HTML from $content. URI.Base is used to sort out relative URLs.
+ $stored->rendered = common_purify($content, ['URI.Base' => $stored->url ?: null]);
$stored->content = common_strip_html($stored->getRendered(), true, true);
if (trim($stored->content) === '') {
// TRANS: Error message when the plain text content of a notice has zero length.
diff --git a/lib/util.php b/lib/util.php
index f029eb429d..9f9b3f66d4 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -580,7 +580,7 @@ function common_canonical_email($email)
return $email;
}
-function common_purify($html)
+function common_purify($html, array $args=array())
{
require_once INSTALLDIR.'/extlib/HTMLPurifier/HTMLPurifier.auto.php';
@@ -588,6 +588,10 @@ function common_purify($html)
$cfg->set('Attr.AllowedRel', ['bookmark', 'directory', 'enclosure', 'home', 'license', 'nofollow', 'payment', 'tag']); // http://microformats.org/wiki/rel
$cfg->set('HTML.ForbiddenAttributes', array('style')); // id, on* etc. are already filtered by default
$cfg->set('URI.AllowedSchemes', array_fill_keys(common_url_schemes(), true));
+ if (isset($args['URI.Base'])) {
+ $cfg->set('URI.Base', $args['URI.Base']); // if null this is like unsetting it I presume
+ $cfg->set('URI.MakeAbsolute', !is_null($args['URI.Base'])); // if we have a URI base, convert relative URLs to absolute ones.
+ }
// Remove more elements than what the default filter removes, default in GNU social are remotely
// linked resources such as img, video, audio
From ba51a696d2be4bcc63182bda364719dde104bbee Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 14:53:12 +0100
Subject: [PATCH 035/415] Slightly more correct log message in index.php
---
index.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.php b/index.php
index ecbfb3eb7b..eef894effc 100644
--- a/index.php
+++ b/index.php
@@ -93,9 +93,9 @@ function handleError($error)
return;
}
- $logmsg = "PEAR error: " . $error->getMessage();
+ $logmsg = "Exception thrown: " . _ve($error->getMessage());
if ($error instanceof PEAR_Exception && common_config('site', 'logdebug')) {
- $logmsg .= " : ". $error->toText();
+ $logmsg .= " PEAR: ". $error->toText();
}
// DB queries often end up with a lot of newlines; merge to a single line
// for easier grepability...
From b4dc060d753290eea0fdab53d52dee9e37f93342 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 16:10:03 +0100
Subject: [PATCH 036/415] Don't auto-silence other users by IP by default
---
.../RegisterThrottlePlugin.php | 27 ++++++++++++++-----
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/plugins/RegisterThrottle/RegisterThrottlePlugin.php b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
index d51932ba35..5b999a4370 100644
--- a/plugins/RegisterThrottle/RegisterThrottlePlugin.php
+++ b/plugins/RegisterThrottle/RegisterThrottlePlugin.php
@@ -60,6 +60,14 @@ class RegisterThrottlePlugin extends Plugin
*/
public $silenced = true;
+ /**
+ * Auto-silence all other users from the same registration_ip
+ * as the one being silenced. Caution: Many users may come from
+ * the same IP (even entire countries) without having any sort
+ * of relevant connection for moderation.
+ */
+ public $auto_silence_by_ip = false;
+
/**
* Whether we're enabled; prevents recursion.
*/
@@ -300,15 +308,15 @@ class RegisterThrottlePlugin extends Plugin
return true;
}
- if ($role != Profile_role::SILENCED) {
+ if ($role !== Profile_role::SILENCED) {
return true;
}
- if (!$this->silenced) {
+ if (!$this->auto_silence_by_ip) {
return true;
}
- $ri = Registration_ip::getKV('user_id', $profile->id);
+ $ri = Registration_ip::getKV('user_id', $profile->getID());
if (empty($ri)) {
return true;
@@ -317,13 +325,13 @@ class RegisterThrottlePlugin extends Plugin
$ids = Registration_ip::usersByIP($ri->ipaddress);
foreach ($ids as $id) {
- if ($id == $profile->id) {
+ if ($id == $profile->getID()) {
continue;
}
- $other = Profile::getKV('id', $id);
-
- if (empty($other)) {
+ try {
+ $other = Profile::getByID($id);
+ } catch (NoResultException $e) {
continue;
}
@@ -331,6 +339,11 @@ class RegisterThrottlePlugin extends Plugin
continue;
}
+ // 'enabled' here is used to prevent recursion, since
+ // we'll end up in this function again on ->silence()
+ // though I actually think it doesn't matter since we
+ // do this in onEndGrantRole and that means the above
+ // $other->isSilenced() test should've 'continue'd...
$old = self::$enabled;
self::$enabled = false;
$other->silence();
From 12f1707a74f7a12449979034c737cc9e5146c39b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Fri, 26 Feb 2016 22:37:26 +0100
Subject: [PATCH 037/415] Ostatus_source filled no purpose whatsoever
---
plugins/OStatus/OStatusPlugin.php | 1 -
plugins/OStatus/classes/Ostatus_profile.php | 1 -
plugins/OStatus/classes/Ostatus_source.php | 77 ---------------------
3 files changed, 79 deletions(-)
delete mode 100644 plugins/OStatus/classes/Ostatus_source.php
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 17ce8e4623..292af658ed 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -476,7 +476,6 @@ class OStatusPlugin extends Plugin
function onCheckSchema() {
$schema = Schema::get();
$schema->ensureTable('ostatus_profile', Ostatus_profile::schemaDef());
- $schema->ensureTable('ostatus_source', Ostatus_source::schemaDef());
$schema->ensureTable('feedsub', FeedSub::schemaDef());
$schema->ensureTable('hubsub', HubSub::schemaDef());
$schema->ensureTable('magicsig', Magicsig::schemaDef());
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 8c7be80a60..2b1ab8ddd9 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -539,7 +539,6 @@ class Ostatus_profile extends Managed_DataObject
try {
$stored = Notice::saveActivity($activity, $actor, $options);
- Ostatus_source::saveNew($stored, $this, $method);
} catch (Exception $e) {
common_log(LOG_ERR, "OStatus save of remote message $sourceUri failed: " . $e->getMessage());
throw $e;
diff --git a/plugins/OStatus/classes/Ostatus_source.php b/plugins/OStatus/classes/Ostatus_source.php
deleted file mode 100644
index 88a6a58383..0000000000
--- a/plugins/OStatus/classes/Ostatus_source.php
+++ /dev/null
@@ -1,77 +0,0 @@
-.
- */
-
-if (!defined('STATUSNET')) {
- exit(1);
-}
-
-/**
- * @package OStatusPlugin
- * @maintainer Brion Vibber
- */
-class Ostatus_source extends Managed_DataObject
-{
- public $__table = 'ostatus_source';
-
- public $notice_id; // notice we're referring to
- public $profile_uri; // uri of the ostatus_profile this came through -- may be a group feed
- public $method; // push or salmon
- public $created;
- public $modified;
-
- public static function schemaDef()
- {
- return array(
- 'fields' => array(
- 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'Notice ID relation'),
- 'profile_uri' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'Profile URI'),
- 'method' => array('type' => 'enum("push","salmon")', 'not null' => true, 'description' => 'source method'),
- 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
- 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
- ),
- 'primary key' => array('notice_id'),
- 'foreign keys' => array(
- 'ostatus_source_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
- // not in profile table yet 'ostatus_source_profile_uri_fkey' => array('profile', array('profile_uri' => 'uri')),
- ),
- 'indexes' => array(
- 'ostatus_source_profile_uri_idx' => array('profile_uri'),
- ),
- );
- }
-
- /**
- * Save a remote notice source record; this helps indicate how trusted we are.
- * @param string $method
- */
- public static function saveNew(Notice $notice, Ostatus_profile $oprofile, $method)
- {
- $osource = new Ostatus_source();
- $osource->notice_id = $notice->id;
- $osource->profile_uri = $oprofile->uri;
- $osource->method = $method;
- $osource->created = common_sql_now();
- if ($osource->insert()) {
- return true;
- } else {
- common_log_db_error($osource, 'INSERT', __FILE__);
- return false;
- }
- }
-}
From 9dc4f13579c6cb6c681061ac7350e77bb0c71248 Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber
Date: Fri, 26 Feb 2016 22:06:04 +0000
Subject: [PATCH 038/415] Fix author fallback
Previously if there was no discernable author the nickname "Array"
would end up used. This was a bug, obviously. It is fixed now.
---
plugins/Linkback/lib/util.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/Linkback/lib/util.php b/plugins/Linkback/lib/util.php
index 2f024dd233..cd0476ceef 100644
--- a/plugins/Linkback/lib/util.php
+++ b/plugins/Linkback/lib/util.php
@@ -284,7 +284,7 @@ function linkback_profile($entry, $mf2, $response, $target) {
}
if(!$author) {
- $author = array('name' => array($entry['name']));
+ $author = array('name' => $entry['name']);
}
if(!$author['url']) {
From 6a0007c41012cb9a566415080c1fb5852ade90ae Mon Sep 17 00:00:00 2001
From: hannes
Date: Sat, 27 Feb 2016 01:03:24 +0000
Subject: [PATCH 039/415] moderators can delete others' notices using the api
---
actions/apistatusesdestroy.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php
index 2d32124c42..f681ee8419 100644
--- a/actions/apistatusesdestroy.php
+++ b/actions/apistatusesdestroy.php
@@ -69,6 +69,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
+ $this->profile = $this->auth_user->getProfile();
$this->notice_id = (int)$this->trimmed('id');
if (empty($notice_id)) {
@@ -122,7 +123,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
return;
}
- if ($this->user->id == $this->notice->profile_id) {
+ if ($this->user->id == $this->notice->profile_id || $this->profile->hasRight(Right::DELETEOTHERSNOTICE)) {
if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
$this->notice->deleteAs($this->scoped);
Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
From cd978fa15356429ebc867493f69172cdd23b2f47 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 13:16:52 +0100
Subject: [PATCH 040/415] Edited the list of allowed rel values
---
lib/util.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/util.php b/lib/util.php
index 9f9b3f66d4..c175c6e9ae 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -585,7 +585,15 @@ function common_purify($html, array $args=array())
require_once INSTALLDIR.'/extlib/HTMLPurifier/HTMLPurifier.auto.php';
$cfg = HTMLPurifier_Config::createDefault();
- $cfg->set('Attr.AllowedRel', ['bookmark', 'directory', 'enclosure', 'home', 'license', 'nofollow', 'payment', 'tag']); // http://microformats.org/wiki/rel
+ /**
+ * rel values that should be avoided since they can be used to infer
+ * information about the _current_ page, not the h-entry:
+ *
+ * directory, home, license, payment
+ *
+ * Source: http://microformats.org/wiki/rel
+ */
+ $cfg->set('Attr.AllowedRel', ['bookmark', 'enclosure', 'nofollow', 'tag']);
$cfg->set('HTML.ForbiddenAttributes', array('style')); // id, on* etc. are already filtered by default
$cfg->set('URI.AllowedSchemes', array_fill_keys(common_url_schemes(), true));
if (isset($args['URI.Base'])) {
From 747c91210ff31d8ff42bb01d6c9f0fb5becc9085 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 13:30:47 +0100
Subject: [PATCH 041/415] HTMLPurifier cache settings, put stuff in subdir of
get_sys_temp_dir()
---
lib/default.php | 8 ++++++--
lib/util.php | 3 +++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/default.php b/lib/default.php
index c78803da97..0fa8ce1678 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -296,11 +296,15 @@ $default =
array('handle' => false, // whether to handle sessions ourselves
'debug' => false, // debugging output for sessions
'gc_limit' => 1000), // max sessions to expire at a time
- 'htmlfilter' => array( // purify HTML through HTMLPurifier
+ 'htmlfilter' => [ // remove tags from user/remotely generated HTML if they are === true
'img' => true,
'video' => true,
'audio' => true,
- ),
+ ],
+ 'htmlpurifier' => [ // configurable options for HTMLPurifier
+ 'Cache.DefinitionImpl' => 'Serializer',
+ 'Cache.SerializerPath' => implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), 'gnusocial']),
+ ],
'notice' =>
array('contentlimit' => null,
'allowprivate' => false, // whether to allow users to "check the padlock" to publish notices available for their subscribers.
diff --git a/lib/util.php b/lib/util.php
index c175c6e9ae..5aeda6d750 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -600,6 +600,9 @@ function common_purify($html, array $args=array())
$cfg->set('URI.Base', $args['URI.Base']); // if null this is like unsetting it I presume
$cfg->set('URI.MakeAbsolute', !is_null($args['URI.Base'])); // if we have a URI base, convert relative URLs to absolute ones.
}
+ foreach (common_config('htmlpurifier') as $key=>$val) {
+ $cfg->set($key, $val);
+ }
// Remove more elements than what the default filter removes, default in GNU social are remotely
// linked resources such as img, video, audio
From 6c43e9c2e0934a9da2cb7947024ca7e3702c3f91 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 13:31:21 +0100
Subject: [PATCH 042/415] Verify loaded config function, must be completed
further.
---
lib/gnusocial.php | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/lib/gnusocial.php b/lib/gnusocial.php
index 277c41e7c8..2ad688a790 100644
--- a/lib/gnusocial.php
+++ b/lib/gnusocial.php
@@ -141,6 +141,8 @@ class GNUsocial
// Load settings from database; note we need autoload for this
Config::loadSettings();
+ self::verifyLoadedConfig();
+
self::initPlugins();
}
@@ -418,6 +420,23 @@ class GNUsocial
}
}
+ /**
+ * Verify that the loaded config is good. Not complete, but will
+ * throw exceptions on common configuration problems I hope.
+ *
+ * Might make changes to the filesystem, to created dirs, but will
+ * not make database changes.
+ */
+ static function verifyLoadedConfig()
+ {
+ if (common_config('htmlpurifier', 'Cache.DefinitionImpl') === 'Serializer'
+ && !is_dir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
+ if (!mkdir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
+ throw new ServerException('Could not create HTMLPurifier cache dir: '._ve(common_config('htmlpurifier', 'Cache.SerializerPath')));
+ }
+ }
+ }
+
/**
* Are we running from the web with HTTPS?
*
From 446c930823136f1df5d0d86f135548a1aed3357c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 19:23:13 +0100
Subject: [PATCH 043/415] Change to more recent code style in
ApiStatusesDestroyAction
---
actions/apistatusesdestroy.php | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php
index f681ee8419..2c4edbcfa4 100644
--- a/actions/apistatusesdestroy.php
+++ b/actions/apistatusesdestroy.php
@@ -68,8 +68,6 @@ class ApiStatusesDestroyAction extends ApiAuthAction
{
parent::prepare($args);
- $this->user = $this->auth_user;
- $this->profile = $this->auth_user->getProfile();
$this->notice_id = (int)$this->trimmed('id');
if (empty($notice_id)) {
@@ -123,10 +121,10 @@ class ApiStatusesDestroyAction extends ApiAuthAction
return;
}
- if ($this->user->id == $this->notice->profile_id || $this->profile->hasRight(Right::DELETEOTHERSNOTICE)) {
- if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
+ if ($this->scoped->sameAs($this->notice->getProfile()) || $this->scoped->hasRight(Right::DELETEOTHERSNOTICE)) {
+ if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) {
$this->notice->deleteAs($this->scoped);
- Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
+ Event::handle('EndDeleteOwnNotice', array($this->auth_user, $this->notice));
}
$this->showNotice();
} else {
From 2696e13b196456c898306845fcfea465a99d3050 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 19:34:48 +0100
Subject: [PATCH 044/415] Refactoring ApiStatusesDestroyAction
---
actions/apistatusesdestroy.php | 96 ++++++++++------------------------
1 file changed, 27 insertions(+), 69 deletions(-)
diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php
index 2c4edbcfa4..0bad3da5df 100644
--- a/actions/apistatusesdestroy.php
+++ b/actions/apistatusesdestroy.php
@@ -34,9 +34,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Deletes one of the authenticating user's statuses (notices).
@@ -55,86 +53,46 @@ if (!defined('STATUSNET')) {
*/
class ApiStatusesDestroyAction extends ApiAuthAction
{
- var $status = null;
-
- /**
- * Take arguments for running
- *
- * @param array $args $_REQUEST args
- *
- * @return boolean success flag
- */
- function prepare($args)
+ protected function prepare(array $args=array())
{
parent::prepare($args);
- $this->notice_id = (int)$this->trimmed('id');
-
- if (empty($notice_id)) {
- $this->notice_id = (int)$this->arg('id');
+ if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
+ // TRANS: Client error displayed trying to delete a status not using POST or DELETE.
+ // TRANS: POST and DELETE should not be translated.
+ throw new ClientException(_('This method requires a POST or DELETE.'));
}
- $this->notice = Notice::getKV((int)$this->notice_id);
+ // FIXME: Return with a Not Acceptable status code?
+ if (!in_array($this->format, array('xml', 'json'))) {
+ // TRANS: Client error displayed when coming across a non-supported API method.
+ throw new ClientException(_('API method not found.'), 404);
+ }
+
+ try {
+ $this->notice = Notice::getByID($this->trimmed('id'));
+ } catch (NoResultException $e) {
+ // TRANS: Client error displayed trying to delete a status with an invalid ID.
+ throw new ClientException(_('No status found with that ID.'), 404);
+ }
return true;
}
- /**
- * Handle the request
- *
- * Delete the notice and all related replies
- *
- * @param array $args $_REQUEST data (unused)
- *
- * @return void
- */
- function handle($args)
+ protected function handle()
{
- parent::handle($args);
+ parent::handle();
- if (!in_array($this->format, array('xml', 'json'))) {
- $this->clientError(
- // TRANS: Client error displayed when coming across a non-supported API method.
- _('API method not found.'),
- 404
- );
- return;
+ if (!$this->scoped->sameAs($this->notice->getProfile()) && !$this->scoped->hasRight(Right::DELETEOTHERSNOTICE)) {
+ // TRANS: Client error displayed trying to delete a status of another user.
+ throw new AuthorizationException(_('You may not delete another user\'s status.'));
}
- if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
- $this->clientError(
- // TRANS: Client error displayed trying to delete a status not using POST or DELETE.
- // TRANS: POST and DELETE should not be translated.
- _('This method requires a POST or DELETE.'),
- 400,
- $this->format
- );
- return;
- }
-
- if (empty($this->notice)) {
- $this->clientError(
- // TRANS: Client error displayed trying to delete a status with an invalid ID.
- _('No status found with that ID.'),
- 404, $this->format
- );
- return;
- }
-
- if ($this->scoped->sameAs($this->notice->getProfile()) || $this->scoped->hasRight(Right::DELETEOTHERSNOTICE)) {
- if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) {
- $this->notice->deleteAs($this->scoped);
- Event::handle('EndDeleteOwnNotice', array($this->auth_user, $this->notice));
- }
- $this->showNotice();
- } else {
- $this->clientError(
- // TRANS: Client error displayed trying to delete a status of another user.
- _('You may not delete another user\'s status.'),
- 403,
- $this->format
- );
+ if (Event::handle('StartDeleteOwnNotice', array($this->scoped->getUser(), $this->notice))) {
+ $this->notice->deleteAs($this->scoped);
+ Event::handle('EndDeleteOwnNotice', array($this->scoped->getUser(), $this->notice));
}
+ $this->showNotice();
}
/**
From b8643f73b77e811ba32e46153608d2cb2cdee5a8 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 19:40:16 +0100
Subject: [PATCH 045/415] No need to set $threads = 0 on the line before it's
set ;)
---
scripts/queuedaemon.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/scripts/queuedaemon.php b/scripts/queuedaemon.php
index efc1e04e9e..8fb0f8e0ae 100755
--- a/scripts/queuedaemon.php
+++ b/scripts/queuedaemon.php
@@ -168,7 +168,6 @@ if (have_option('t')) {
} else if (have_option('--threads')) {
$threads = intval(get_option_value('--threads'));
} else {
- $threads = 0;
//If there is no argument for number of threads
//Try reading a config option for the number
$threads = common_config('queue','threads');
From da34491c59e1b92b75b9aa381a1e281b66333b48 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 28 Feb 2016 20:50:45 +0100
Subject: [PATCH 046/415] Woops, undefined $type there.
---
actions/showstream.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/actions/showstream.php b/actions/showstream.php
index 33ec49df99..dbe74197dc 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -161,7 +161,7 @@ class ShowstreamAction extends NoticestreamAction
// Publish all the rel="me" in the HTTP headers on our main profile page
if (get_class($this) == 'ShowstreamAction') {
foreach ($this->target->getRelMes() as $relMe) {
- header('Link: <'.htmlspecialchars($relMe['href']).'>'.$type.'; rel="me"', false);
+ header('Link: <'.htmlspecialchars($relMe['href']).'>; rel="me"', false);
}
}
}
From 7862b853bf05908f342afd175c13bad300bd5c10 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 13:10:18 +0100
Subject: [PATCH 047/415] Make javascript XHR timeout a variable.
SN.V.xhrTimeout = [time in milliseconds];
---
js/util.js | 3 ++-
lib/action.php | 8 +++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/js/util.js b/js/util.js
index 29650b1a4d..15bff959ee 100644
--- a/js/util.js
+++ b/js/util.js
@@ -57,6 +57,7 @@ var SN = { // StatusNet
},
V: { // Variables
+ // These get set on runtime via inline scripting, so don't put anything here.
},
/**
@@ -358,7 +359,7 @@ var SN = { // StatusNet
form.ajaxForm({
dataType: 'xml',
- timeout: '60000',
+ timeout: SN.V.xhrTimeout,
beforeSend: function (formData) {
if (form.find('.notice_data-text:first').val() == '') {
form.addClass(SN.C.S.Warning);
diff --git a/lib/action.php b/lib/action.php
index 4e629c2bc3..513666a656 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -492,10 +492,12 @@ class Action extends HTMLOutputter // lawsuit
if (Event::handle('StartScriptVariables', array($this, &$vars))) {
$vars['urlNewNotice'] = common_local_url('newnotice');
+ $vars['xhrTimeout'] = ini_get('max_execution_time')*1000; // milliseconds
+ Event::handle('EndScriptVariables', array($this, &$vars));
}
- if (!empty($vars)) {
- $this->inlineScript('SN.V = ' . json_encode($vars));
- }
+
+ $this->inlineScript('SN.V = ' . json_encode($vars) . ';');
+
return $vars;
}
From 63c087a25500ee5d8faa6bbb5d3f72660d4cdbe5 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 14:51:47 +0100
Subject: [PATCH 048/415] Consistent behaviour for ScopingNoticeStream $scoped
We don't guess the current profile anymore if the value of the profile === -1
Also sets $this->scoped for all ScopingNoticeStream inheritors, which just
like in an Action can be null if we're not scoped in any way (logged in).
---
actions/allrss.php | 2 +-
actions/noticesearch.php | 3 +-
actions/showgroup.php | 24 +++---------
classes/File.php | 4 +-
classes/Notice.php | 9 +++--
classes/Notice_tag.php | 4 +-
classes/Profile.php | 4 +-
classes/Profile_list.php | 4 +-
classes/Reply.php | 4 +-
classes/User.php | 9 +++--
classes/User_group.php | 4 +-
lib/conversationnoticestream.php | 8 +---
lib/filenoticestream.php | 13 ++-----
lib/groupnoticestream.php | 17 ++-------
lib/inboxnoticestream.php | 3 --
lib/inboxtagcloudsection.php | 10 ++---
lib/peopletagnoticestream.php | 13 ++-----
lib/profilenoticestream.php | 38 +++++++++----------
lib/publicnoticestream.php | 4 +-
lib/replynoticestream.php | 7 +---
lib/scopingnoticestream.php | 18 +++------
lib/searchnoticestream.php | 16 ++------
lib/taggedprofilenoticestream.php | 13 ++-----
lib/tagnoticestream.php | 8 ++--
lib/threadinggroupnoticestream.php | 4 +-
plugins/ActivitySpam/actions/spam.php | 8 ++--
plugins/ActivitySpam/lib/spamnoticestream.php | 15 ++------
.../Bookmark/lib/bookmarksnoticestream.php | 11 ++----
.../lib/useremailsummaryhandler.php | 12 +++---
plugins/Event/lib/eventsnoticestream.php | 2 +
plugins/Favorite/actions/favorited.php | 2 +-
plugins/Favorite/actions/showfavorites.php | 3 +-
plugins/Favorite/classes/Fave.php | 10 ++++-
plugins/Favorite/lib/favenoticestream.php | 18 ++++-----
plugins/Favorite/lib/popularnoticestream.php | 10 ++---
plugins/Mapstraction/actions/allmap.php | 4 +-
.../Share/lib/repeatedbymenoticestream.php | 27 +++++--------
plugins/Share/lib/repeatsofmenoticestream.php | 25 +++++-------
38 files changed, 151 insertions(+), 239 deletions(-)
diff --git a/actions/allrss.php b/actions/allrss.php
index 4b6df25048..d7f11bb1eb 100644
--- a/actions/allrss.php
+++ b/actions/allrss.php
@@ -46,7 +46,7 @@ class AllrssAction extends TargetedRss10Action
{
protected function getNotices()
{
- $stream = new InboxNoticeStream($this->target);
+ $stream = new InboxNoticeStream($this->target, $this->scoped);
return $stream->getNotices(0, $this->limit)->fetchAll();
}
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index fd8fdf68e5..d7cdeaacc6 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -65,8 +65,7 @@ class NoticesearchAction extends SearchAction
if (!empty($this->q)) {
- $profile = Profile::current();
- $stream = new SearchNoticeStream($this->q, $profile);
+ $stream = new SearchNoticeStream($this->q, $this->scoped);
$page = $this->trimmed('page');
if (empty($page)) {
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 46d0a227f5..8770e6cc8b 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -28,12 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
-
-require_once INSTALLDIR.'/lib/noticelist.php';
-require_once INSTALLDIR.'/lib/feedlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Group main page
@@ -48,7 +43,6 @@ class ShowgroupAction extends GroupAction
{
/** page we're viewing. */
var $page = null;
- var $userProfile = null;
var $notice = null;
/**
@@ -97,14 +91,10 @@ class ShowgroupAction extends GroupAction
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
- $this->userProfile = Profile::current();
-
- $user = common_current_user();
-
- if (!empty($user) && $user->streamModeOnly()) {
- $stream = new GroupNoticeStream($this->group, $this->userProfile);
+ if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
+ $stream = new GroupNoticeStream($this->group, $this->scoped);
} else {
- $stream = new ThreadingGroupNoticeStream($this->group, $this->userProfile);
+ $stream = new ThreadingGroupNoticeStream($this->group, $this->scoped);
}
$this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
@@ -146,12 +136,10 @@ class ShowgroupAction extends GroupAction
*/
function showGroupNotices()
{
- $user = common_current_user();
-
- if (!empty($user) && $user->streamModeOnly()) {
+ if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
$nl = new PrimaryNoticeList($this->notice, $this, array('show_n'=>NOTICES_PER_PAGE));
} else {
- $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
+ $nl = new ThreadedNoticeList($this->notice, $this, $this->scoped);
}
$cnt = $nl->show();
diff --git a/classes/File.php b/classes/File.php
index ef4b2cfb3c..d6dd78cbef 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -579,7 +579,9 @@ class File extends Managed_DataObject
function stream($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
{
- $stream = new FileNoticeStream($this);
+ // FIXME: Try to get the Profile::current() here in some other way to avoid mixing
+ // the current session user with possibly background/queue processing.
+ $stream = new FileNoticeStream($this, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
diff --git a/classes/Notice.php b/classes/Notice.php
index 2bae300115..6f406472c7 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1280,9 +1280,9 @@ class Notice extends Managed_DataObject
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
- static function conversationStream($id, $offset=0, $limit=20, $since_id=null, $max_id=null)
+ static function conversationStream($id, $offset=0, $limit=20, $since_id=null, $max_id=null, Profile $scoped=null)
{
- $stream = new ConversationNoticeStream($id);
+ $stream = new ConversationNoticeStream($id, $scoped);
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
@@ -1300,8 +1300,9 @@ class Notice extends Managed_DataObject
return false;
}
- $stream = new ConversationNoticeStream($this->conversation);
- $notice = $stream->getNotices(/*offset*/ 1, /*limit*/ 1);
+ //FIXME: Get the Profile::current() stuff some other way
+ // to avoid confusion between queue processing and session.
+ $notice = self::conversationStream($this->conversation, 1, 1, null, null, Profile::current());
// if our "offset 1, limit 1" query got a result, return true else false
return $notice->N > 0;
diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php
index b864de8009..9d6bec6d2f 100644
--- a/classes/Notice_tag.php
+++ b/classes/Notice_tag.php
@@ -55,7 +55,9 @@ class Notice_tag extends Managed_DataObject
static function getStream($tag, $offset=0, $limit=20, $sinceId=0, $maxId=0)
{
- $stream = new TagNoticeStream($tag);
+ // FIXME: Get the Profile::current value some other way
+ // to avoid confusino between queue processing and session.
+ $stream = new TagNoticeStream($tag, Profile::current());
return $stream;
}
diff --git a/classes/Profile.php b/classes/Profile.php
index a5e0d092dc..36e91c3ad0 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -266,7 +266,9 @@ class Profile extends Managed_DataObject
function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
{
- $stream = new TaggedProfileNoticeStream($this, $tag);
+ //FIXME: Get Profile::current() some other way to avoid possible
+ // confusion between current session profile and background processing.
+ $stream = new TaggedProfileNoticeStream($this, $tag, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
diff --git a/classes/Profile_list.php b/classes/Profile_list.php
index 000e10b41f..b60f4afffd 100644
--- a/classes/Profile_list.php
+++ b/classes/Profile_list.php
@@ -171,7 +171,9 @@ class Profile_list extends Managed_DataObject
function getNotices($offset, $limit, $since_id=null, $max_id=null)
{
- $stream = new PeopletagNoticeStream($this);
+ // FIXME: Use something else than Profile::current() to avoid
+ // possible confusion between session user and queue processing.
+ $stream = new PeopletagNoticeStream($this, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
diff --git a/classes/Reply.php b/classes/Reply.php
index d3405e6581..018937ba6c 100644
--- a/classes/Reply.php
+++ b/classes/Reply.php
@@ -57,7 +57,9 @@ class Reply extends Managed_DataObject
static function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
{
- $stream = new ReplyNoticeStream($user_id);
+ // FIXME: Use some other method to get Profile::current() in order
+ // to avoid confusion between background processing and session user.
+ $stream = new ReplyNoticeStream($user_id, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
}
diff --git a/classes/User.php b/classes/User.php
index 40e1a1b644..12cc170f86 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -701,15 +701,18 @@ class User extends Managed_DataObject
function repeatedByMe($offset=0, $limit=20, $since_id=null, $max_id=null)
{
- $stream = new RepeatedByMeNoticeStream($this);
+ // FIXME: Use another way to get Profile::current() since we
+ // want to avoid confusion between session user and queue processing.
+ $stream = new RepeatedByMeNoticeStream($this->getProfile(), Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
function repeatsOfMe($offset=0, $limit=20, $since_id=null, $max_id=null)
{
- $stream = new RepeatsOfMeNoticeStream($this);
-
+ // FIXME: Use another way to get Profile::current() since we
+ // want to avoid confusion between session user and queue processing.
+ $stream = new RepeatsOfMeNoticeStream($this->getProfile(), Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
diff --git a/classes/User_group.php b/classes/User_group.php
index ecec1ee663..8f736de6d0 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -153,7 +153,9 @@ class User_group extends Managed_DataObject
function getNotices($offset, $limit, $since_id=null, $max_id=null)
{
- $stream = new GroupNoticeStream($this);
+ // FIXME: Get the Profile::current() some other way, to avoid
+ // possible confusion between current session and queue process.
+ $stream = new GroupNoticeStream($this, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
diff --git a/lib/conversationnoticestream.php b/lib/conversationnoticestream.php
index 21b2d7f0be..bcb16c2d4b 100644
--- a/lib/conversationnoticestream.php
+++ b/lib/conversationnoticestream.php
@@ -42,14 +42,10 @@ if (!defined('GNUSOCIAL')) { exit(1); }
*/
class ConversationNoticeStream extends ScopingNoticeStream
{
- function __construct($id, $profile = -1)
+ function __construct($id, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
-
parent::__construct(new RawConversationNoticeStream($id),
- $profile);
+ $scoped);
}
}
diff --git a/lib/filenoticestream.php b/lib/filenoticestream.php
index f7bca1ed68..49b93732fb 100644
--- a/lib/filenoticestream.php
+++ b/lib/filenoticestream.php
@@ -28,22 +28,15 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
class FileNoticeStream extends ScopingNoticeStream
{
- function __construct($file, $profile = -1)
+ function __construct($file, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawFileNoticeStream($file),
'file:notice-ids:'.$file->id),
- $profile);
+ $scoped);
}
}
diff --git a/lib/groupnoticestream.php b/lib/groupnoticestream.php
index 723f064cb3..2d6e7b37cb 100644
--- a/lib/groupnoticestream.php
+++ b/lib/groupnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices for a group
@@ -47,19 +43,14 @@ if (!defined('STATUSNET')) {
class GroupNoticeStream extends ScopingNoticeStream
{
var $group;
- var $userProfile;
- function __construct($group, $profile = -1)
+ function __construct($group, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
$this->group = $group;
- $this->userProfile = $profile;
parent::__construct(new CachingNoticeStream(new RawGroupNoticeStream($group),
'user_group:notice_ids:' . $group->id),
- $profile);
+ $scoped);
}
function getNoticeIds($offset, $limit, $since_id, $max_id)
@@ -83,7 +74,7 @@ class GroupNoticeStream extends ScopingNoticeStream
function impossibleStream()
{
if ($this->group->force_scope &&
- (empty($this->userProfile) || !$this->userProfile->isMember($this->group))) {
+ (!$this->scoped instanceof Profile || $this->scoped->isMember($this->group))) {
return true;
}
diff --git a/lib/inboxnoticestream.php b/lib/inboxnoticestream.php
index ccf0f460c9..2b19461c57 100644
--- a/lib/inboxnoticestream.php
+++ b/lib/inboxnoticestream.php
@@ -54,9 +54,6 @@ class InboxNoticeStream extends ScopingNoticeStream
*/
function __construct(Profile $target, Profile $scoped=null)
{
- if ($scoped === null) {
- $scoped = Profile::current();
- }
// FIXME: we don't use CachingNoticeStream - but maybe we should?
parent::__construct(new CachingNoticeStream(new RawInboxNoticeStream($target), 'profileall'), $scoped);
}
diff --git a/lib/inboxtagcloudsection.php b/lib/inboxtagcloudsection.php
index d19f76366d..4268ee4854 100644
--- a/lib/inboxtagcloudsection.php
+++ b/lib/inboxtagcloudsection.php
@@ -27,9 +27,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Personal tag cloud section
@@ -60,9 +58,9 @@ class InboxTagCloudSection extends TagCloudSection
function getTags()
{
- $profile = Profile::current();
-
- $stream = new InboxNoticeStream($this->target, $profile);
+ // FIXME: Get the Profile::current() value some other way
+ // to avoid confusion between background stuff and session.
+ $stream = new InboxNoticeStream($this->target, Profile::current());
$ids = $stream->getNoticeIds(0, self::MAX_NOTICES, null, null);
diff --git a/lib/peopletagnoticestream.php b/lib/peopletagnoticestream.php
index 4422261ae9..cc453bf1f8 100644
--- a/lib/peopletagnoticestream.php
+++ b/lib/peopletagnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices for a list
@@ -47,14 +43,11 @@ if (!defined('STATUSNET')) {
*/
class PeopletagNoticeStream extends ScopingNoticeStream
{
- function __construct($plist, $profile = -1)
+ function __construct($plist, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawPeopletagNoticeStream($plist),
'profile_list:notice_ids:' . $plist->id),
- $profile);
+ $scoped);
}
}
diff --git a/lib/profilenoticestream.php b/lib/profilenoticestream.php
index 7ff4163fcb..bfe49efea5 100644
--- a/lib/profilenoticestream.php
+++ b/lib/profilenoticestream.php
@@ -43,19 +43,14 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class ProfileNoticeStream extends ScopingNoticeStream
{
- var $streamProfile;
- var $userProfile;
+ protected $target;
- function __construct($profile, $userProfile = -1)
+ function __construct(Profile $target, Profile $scoped=null)
{
- if (is_int($userProfile) && $userProfile == -1) {
- $userProfile = Profile::current();
- }
- $this->streamProfile = $profile;
- $this->userProfile = $userProfile;
- parent::__construct(new CachingNoticeStream(new RawProfileNoticeStream($profile),
- 'profile:notice_ids:' . $profile->id),
- $userProfile);
+ $this->target = $target;
+ parent::__construct(new CachingNoticeStream(new RawProfileNoticeStream($target),
+ 'profile:notice_ids:' . $target->getID()),
+ $scoped);
}
function getNoticeIds($offset, $limit, $since_id=null, $max_id=null)
@@ -70,7 +65,7 @@ class ProfileNoticeStream extends ScopingNoticeStream
function getNotices($offset, $limit, $since_id=null, $max_id=null)
{
if ($this->impossibleStream()) {
- throw new PrivateStreamException($this->streamProfile, $this->userProfile);
+ throw new PrivateStreamException($this->target, $this->scoped);
} else {
return parent::getNotices($offset, $limit, $since_id, $max_id);
}
@@ -78,7 +73,7 @@ class ProfileNoticeStream extends ScopingNoticeStream
function impossibleStream()
{
- if (!$this->streamProfile->readableBy($this->userProfile)) {
+ if (!$this->target->readableBy($this->scoped)) {
// cannot read because it's a private stream and either noone's logged in or they are not subscribers
return true;
}
@@ -86,8 +81,13 @@ class ProfileNoticeStream extends ScopingNoticeStream
// If it's a spammy stream, and no user or not a moderator
if (common_config('notice', 'hidespam')) {
- if ($this->streamProfile->hasRole(Profile_role::SILENCED) &&
- (empty($this->userProfile) || (($this->userProfile->id !== $this->streamProfile->id) && !$this->userProfile->hasRight(Right::REVIEWSPAM)))) {
+ // if this is a silenced user
+ if ($this->target->hasRole(Profile_role::SILENCED)
+ // and we are either not logged in
+ && (!$this->scoped instanceof Profile
+ // or if we are, we are not logged in as the target, and we don't have right to review spam
+ || (!$this->scoped->sameAs($this->target) && !$this->scoped->hasRight(Right::REVIEWSPAM))
+ )) {
return true;
}
}
@@ -109,20 +109,20 @@ class ProfileNoticeStream extends ScopingNoticeStream
class RawProfileNoticeStream extends NoticeStream
{
- protected $profile;
+ protected $target;
protected $selectVerbs = array(); // select all verbs
- function __construct($profile)
+ function __construct(Profile $target)
{
parent::__construct();
- $this->profile = $profile;
+ $this->target = $target;
}
function getNoticeIds($offset, $limit, $since_id, $max_id)
{
$notice = new Notice();
- $notice->profile_id = $this->profile->id;
+ $notice->profile_id = $this->target->getID();
$notice->selectAdd();
$notice->selectAdd('id');
diff --git a/lib/publicnoticestream.php b/lib/publicnoticestream.php
index 4a16cbd235..1dd59059fd 100644
--- a/lib/publicnoticestream.php
+++ b/lib/publicnoticestream.php
@@ -43,11 +43,11 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class PublicNoticeStream extends ScopingNoticeStream
{
- function __construct($profile=null)
+ function __construct(Profile $scoped=null)
{
parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(),
'public'),
- $profile);
+ $scoped);
}
}
diff --git a/lib/replynoticestream.php b/lib/replynoticestream.php
index 9eb188d54d..d6b2882193 100644
--- a/lib/replynoticestream.php
+++ b/lib/replynoticestream.php
@@ -43,14 +43,11 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class ReplyNoticeStream extends ScopingNoticeStream
{
- function __construct($userId, $profile=-1)
+ function __construct($userId, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawReplyNoticeStream($userId),
'reply:stream:' . $userId),
- $profile);
+ $scoped);
}
}
diff --git a/lib/scopingnoticestream.php b/lib/scopingnoticestream.php
index c1651d5a30..84af75948d 100644
--- a/lib/scopingnoticestream.php
+++ b/lib/scopingnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Class comment
@@ -49,16 +45,12 @@ class ScopingNoticeStream extends FilteringNoticeStream
{
protected $profile;
- function __construct($upstream, $profile = -1)
+ function __construct(NoticeStream $upstream, Profile $scoped=null)
{
parent::__construct($upstream);
- // Invalid but not null
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
-
- $this->profile = $profile;
+ $this->profile = $scoped; // legacy
+ $this->scoped = $scoped;
}
/**
@@ -71,7 +63,7 @@ class ScopingNoticeStream extends FilteringNoticeStream
function filter($notice)
{
- return $notice->inScope($this->profile);
+ return $notice->inScope($this->scoped);
}
function prefill($notices)
diff --git a/lib/searchnoticestream.php b/lib/searchnoticestream.php
index 6593a4c860..9c31a709c6 100644
--- a/lib/searchnoticestream.php
+++ b/lib/searchnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notice search results
@@ -47,13 +43,9 @@ if (!defined('STATUSNET')) {
class SearchNoticeStream extends ScopingNoticeStream
{
- function __construct($q, $profile = -1)
+ function __construct($q, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
-
- parent::__construct(new RawSearchNoticeStream($q), $profile);
+ parent::__construct(new RawSearchNoticeStream($q), $scoped);
}
}
@@ -89,4 +81,4 @@ class RawSearchNoticeStream extends NoticeStream
return $ids;
}
-}
\ No newline at end of file
+}
diff --git a/lib/taggedprofilenoticestream.php b/lib/taggedprofilenoticestream.php
index eec20cd8c6..f6fb476ff1 100644
--- a/lib/taggedprofilenoticestream.php
+++ b/lib/taggedprofilenoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices with a given profile and tag
@@ -47,14 +43,11 @@ if (!defined('STATUSNET')) {
class TaggedProfileNoticeStream extends ScopingNoticeStream
{
- function __construct($profile, $tag, $userProfile=-1)
+ function __construct($profile, $tag, Profile $scoped=null)
{
- if (is_int($userProfile) && $userProfile == -1) {
- $userProfile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawTaggedProfileNoticeStream($profile, $tag),
'profile:notice_ids_tagged:'.$profile->id.':'.Cache::keyize($tag)),
- $userProfile);
+ $scoped);
}
}
diff --git a/lib/tagnoticestream.php b/lib/tagnoticestream.php
index 28f5d0e824..5a99a1aa68 100644
--- a/lib/tagnoticestream.php
+++ b/lib/tagnoticestream.php
@@ -43,13 +43,11 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class TagNoticeStream extends ScopingNoticeStream
{
- function __construct($tag, $profile = -1)
+ function __construct($tag, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawTagNoticeStream($tag),
- 'notice_tag:notice_ids:' . Cache::keyize($tag)));
+ 'notice_tag:notice_ids:' . Cache::keyize($tag)),
+ $scoped);
}
}
diff --git a/lib/threadinggroupnoticestream.php b/lib/threadinggroupnoticestream.php
index b026ee4714..bc42a6247a 100644
--- a/lib/threadinggroupnoticestream.php
+++ b/lib/threadinggroupnoticestream.php
@@ -4,8 +4,8 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class ThreadingGroupNoticeStream extends ThreadingNoticeStream
{
- function __construct($group, $profile)
+ function __construct($group, Profile $scoped=null)
{
- parent::__construct(new GroupNoticeStream($group, $profile));
+ parent::__construct(new GroupNoticeStream($group, $scoped));
}
}
diff --git a/plugins/ActivitySpam/actions/spam.php b/plugins/ActivitySpam/actions/spam.php
index a66b73a829..00a1e0b8a1 100644
--- a/plugins/ActivitySpam/actions/spam.php
+++ b/plugins/ActivitySpam/actions/spam.php
@@ -74,19 +74,17 @@ class SpamAction extends Action
// User must be logged in.
- $user = common_current_user();
-
- if (empty($user)) {
+ if (!$this->scoped instanceof Profile) {
throw new ClientException(_("You must be logged in to review."), 403);
}
// User must have the right to review spam
- if (!$user->hasRight(ActivitySpamPlugin::REVIEWSPAM)) {
+ if (!$this->scoped->hasRight(ActivitySpamPlugin::REVIEWSPAM)) {
throw new ClientException(_('You cannot review spam on this site.'), 403);
}
- $stream = new SpamNoticeStream($user->getProfile());
+ $stream = new SpamNoticeStream($this->scoped);
$this->notices = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
NOTICES_PER_PAGE + 1);
diff --git a/plugins/ActivitySpam/lib/spamnoticestream.php b/plugins/ActivitySpam/lib/spamnoticestream.php
index ffb8d08025..d19814509c 100644
--- a/plugins/ActivitySpam/lib/spamnoticestream.php
+++ b/plugins/ActivitySpam/lib/spamnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Spam notice stream
@@ -47,13 +43,10 @@ if (!defined('STATUSNET')) {
class SpamNoticeStream extends ScopingNoticeStream
{
- function __construct($tag, $profile = -1)
+ function __construct(Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- parent::__construct(new CachingNoticeStream(new RawSpamNoticeStream(),
- 'spam_score:notice_ids'));
+ parent::__construct(new CachingNoticeStream(new RawSpamNoticeStream(), 'spam_score:notice_ids'),
+ $scoped);
}
}
diff --git a/plugins/Bookmark/lib/bookmarksnoticestream.php b/plugins/Bookmark/lib/bookmarksnoticestream.php
index a3ac0359d7..f5d384c2e5 100644
--- a/plugins/Bookmark/lib/bookmarksnoticestream.php
+++ b/plugins/Bookmark/lib/bookmarksnoticestream.php
@@ -1,5 +1,7 @@
getProfile();
-
- if (empty($profile)) {
+ try {
+ $profile = $user->getProfile();
+ } catch (UserNoProfileException $e) {
common_log(LOG_WARNING, sprintf('Not sending email summary for user %s; no profile.', $user_id));
return true;
}
// An InboxNoticeStream for a certain user, scoped to its own view
- $stream = new InboxNoticeStream($profile);
+ $stream = new InboxNoticeStream($profile, $profile);
$notice = $stream->getNotices(0, self::MAX_NOTICES, $since_id);
diff --git a/plugins/Event/lib/eventsnoticestream.php b/plugins/Event/lib/eventsnoticestream.php
index c0d91060be..3dd1a81bd1 100644
--- a/plugins/Event/lib/eventsnoticestream.php
+++ b/plugins/Event/lib/eventsnoticestream.php
@@ -1,5 +1,7 @@
scoped);
$notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE+1);
$nl = new NoticeList($notice, $this);
diff --git a/plugins/Favorite/actions/showfavorites.php b/plugins/Favorite/actions/showfavorites.php
index cba29063c2..ea1169957c 100644
--- a/plugins/Favorite/actions/showfavorites.php
+++ b/plugins/Favorite/actions/showfavorites.php
@@ -57,8 +57,7 @@ class ShowfavoritesAction extends ShowstreamAction
public function getStream()
{
- $own = $this->scoped instanceof Profile ? $this->scoped->sameAs($this->getTarget()) : false;
- return new FaveNoticeStream($this->getTarget()->getID(), $own);
+ return new FaveNoticeStream($this->getTarget(), $this->scoped);
}
function getFeeds()
diff --git a/plugins/Favorite/classes/Fave.php b/plugins/Favorite/classes/Fave.php
index 826d34a36c..864a0fc37b 100644
--- a/plugins/Favorite/classes/Fave.php
+++ b/plugins/Favorite/classes/Fave.php
@@ -152,16 +152,22 @@ class Fave extends Managed_DataObject
return $result;
}
+ // FIXME: Instead of $own, send the scoped Profile so we can pass it along directly to FaveNoticeStream
+ // and preferrably we should get a Profile instead of $user_id
static function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $own=false, $since_id=0, $max_id=0)
{
- $stream = new FaveNoticeStream($user_id, $own);
+ $target = Profile::getByID($user_id);
+ $stream = new FaveNoticeStream($target, ($own ? $target : null));
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}
+ // FIXME: Instead of $own, send the scoped Profile so we can pass it along directly to FaveNoticeStream
+ // and preferrably we should get a Profile instead of $user_id
function idStream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $own=false, $since_id=0, $max_id=0)
{
- $stream = new FaveNoticeStream($user_id, $own);
+ $target = Profile::getByID($user_id);
+ $stream = new FaveNoticeStream($target, ($own ? $target : null));
return $stream->getNoticeIds($offset, $limit, $since_id, $max_id);
}
diff --git a/plugins/Favorite/lib/favenoticestream.php b/plugins/Favorite/lib/favenoticestream.php
index d10272ac91..10a3ec83bd 100644
--- a/plugins/Favorite/lib/favenoticestream.php
+++ b/plugins/Favorite/lib/favenoticestream.php
@@ -42,19 +42,15 @@ if (!defined('GNUSOCIAL')) { exit(1); }
*/
class FaveNoticeStream extends ScopingNoticeStream
{
- function __construct($user_id, $own, $profile = -1)
+ function __construct(Profile $target, Profile $scoped=null)
{
- $stream = new RawFaveNoticeStream($user_id, $own);
- if ($own) {
+ $stream = new RawFaveNoticeStream($target, $scoped);
+ if ($target->sameAs($scoped)) {
$key = 'fave:ids_by_user_own:'.$user_id;
} else {
$key = 'fave:ids_by_user:'.$user_id;
}
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- parent::__construct(new CachingNoticeStream($stream, $key),
- $profile);
+ parent::__construct(new CachingNoticeStream($stream, $key), $scoped);
}
}
@@ -75,12 +71,12 @@ class RawFaveNoticeStream extends NoticeStream
protected $selectVerbs = array();
- function __construct($user_id, $own)
+ function __construct(Profile $target, Profile $scoped=null)
{
parent::__construct();
- $this->user_id = $user_id;
- $this->own = $own;
+ $this->user_id = $target->getID();
+ $this->own = $target->sameAs($scoped);
}
/**
diff --git a/plugins/Favorite/lib/popularnoticestream.php b/plugins/Favorite/lib/popularnoticestream.php
index eeba541238..6ef564d32f 100644
--- a/plugins/Favorite/lib/popularnoticestream.php
+++ b/plugins/Favorite/lib/popularnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices sorted by popularity
@@ -47,12 +43,12 @@ if (!defined('STATUSNET')) {
class PopularNoticeStream extends ScopingNoticeStream
{
- function __construct($profile=null)
+ function __construct(Profile $scoped=null)
{
parent::__construct(new CachingNoticeStream(new RawPopularNoticeStream(),
'popular',
false),
- $profile);
+ $scoped);
}
}
diff --git a/plugins/Mapstraction/actions/allmap.php b/plugins/Mapstraction/actions/allmap.php
index 21bdf62eaa..77e722e3ef 100644
--- a/plugins/Mapstraction/actions/allmap.php
+++ b/plugins/Mapstraction/actions/allmap.php
@@ -27,9 +27,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Show a map of user's notices
diff --git a/plugins/Share/lib/repeatedbymenoticestream.php b/plugins/Share/lib/repeatedbymenoticestream.php
index 4e3e34162b..ecbbefb1cc 100644
--- a/plugins/Share/lib/repeatedbymenoticestream.php
+++ b/plugins/Share/lib/repeatedbymenoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices repeated by me
@@ -47,14 +43,11 @@ if (!defined('STATUSNET')) {
class RepeatedByMeNoticeStream extends ScopingNoticeStream
{
- function __construct($user, $profile = -1)
+ function __construct(Profile $target, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- parent::__construct(new CachingNoticeStream(new RawRepeatedByMeNoticeStream($user),
- 'user:repeated_by_me:'.$user->id),
- $profile);
+ parent::__construct(new CachingNoticeStream(new RawRepeatedByMeNoticeStream($target),
+ 'user:repeated_by_me:'.$target->getID()),
+ $scoped);
}
}
@@ -71,11 +64,11 @@ class RepeatedByMeNoticeStream extends ScopingNoticeStream
class RawRepeatedByMeNoticeStream extends NoticeStream
{
- protected $user;
+ protected $target;
- function __construct($user)
+ function __construct(Profile $target)
{
- $this->user = $user;
+ $this->target = $target;
}
function getNoticeIds($offset, $limit, $since_id, $max_id)
@@ -85,7 +78,7 @@ class RawRepeatedByMeNoticeStream extends NoticeStream
$notice->selectAdd(); // clears it
$notice->selectAdd('id');
- $notice->profile_id = $this->user->id;
+ $notice->profile_id = $this->target->getID();
$notice->whereAdd('repeat_of IS NOT NULL');
$notice->orderBy('created DESC, id DESC');
@@ -110,4 +103,4 @@ class RawRepeatedByMeNoticeStream extends NoticeStream
return $ids;
}
-}
\ No newline at end of file
+}
diff --git a/plugins/Share/lib/repeatsofmenoticestream.php b/plugins/Share/lib/repeatsofmenoticestream.php
index ec80d84314..672e3dd973 100644
--- a/plugins/Share/lib/repeatsofmenoticestream.php
+++ b/plugins/Share/lib/repeatsofmenoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Stream of notices that are repeats of mine
@@ -47,14 +43,11 @@ if (!defined('STATUSNET')) {
class RepeatsOfMeNoticeStream extends ScopingNoticeStream
{
- function __construct($user, $profile=-1)
+ function __construct(Profile $target, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- parent::__construct(new CachingNoticeStream(new RawRepeatsOfMeNoticeStream($user),
- 'user:repeats_of_me:'.$user->id),
- $profile);
+ parent::__construct(new CachingNoticeStream(new RawRepeatsOfMeNoticeStream($target),
+ 'user:repeats_of_me:'.$target->getID()),
+ $scoped);
}
}
@@ -70,11 +63,11 @@ class RepeatsOfMeNoticeStream extends ScopingNoticeStream
*/
class RawRepeatsOfMeNoticeStream extends NoticeStream
{
- protected $user;
+ protected $target;
- function __construct($user)
+ function __construct(Profile $target)
{
- $this->user = $user;
+ $this->target = $target;
}
function getNoticeIds($offset, $limit, $since_id, $max_id)
@@ -82,7 +75,7 @@ class RawRepeatsOfMeNoticeStream extends NoticeStream
$qry =
'SELECT DISTINCT original.id AS id ' .
'FROM notice original JOIN notice rept ON original.id = rept.repeat_of ' .
- 'WHERE original.profile_id = ' . $this->user->id . ' ';
+ 'WHERE original.profile_id = ' . $this->target->getID() . ' ';
$since = Notice::whereSinceId($since_id, 'original.id', 'original.created');
if ($since) {
From a112e7f9a4dde566668a409a74faf723e66e5210 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 15:00:52 +0100
Subject: [PATCH 049/415] Use another method of detecting unspecified
defaultImage size
---
classes/Avatar.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 62885f402b..516abafe25 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -207,8 +207,11 @@ class Avatar extends Managed_DataObject
}
}
- static function defaultImage($size=AVATAR_PROFILE_SIZE)
+ static function defaultImage($size=null)
{
+ if (is_null($size)) {
+ $size = AVATAR_PROFILE_SIZE;
+ }
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
From e41809af890694082305779891f02334d58e686a Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 16:30:00 +0100
Subject: [PATCH 050/415] Nothing interesting was made in this commit.
---
classes/Attention.php | 3 ++-
classes/Notice.php | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/classes/Attention.php b/classes/Attention.php
index 5299a095ae..d048187db2 100644
--- a/classes/Attention.php
+++ b/classes/Attention.php
@@ -53,7 +53,7 @@ class Attention extends Managed_DataObject
{
try {
$att = Attention::getByKeys(['notice_id'=>$notice->getID(), 'profile_id'=>$target->getID()]);
- throw new AlreadyFulfilledException('Attention already exists with reason: '.var_export($att->reason,true));
+ throw new AlreadyFulfilledException('Attention already exists with reason: '._ve($att->reason));
} catch (NoResultException $e) {
$att = new Attention();
@@ -67,6 +67,7 @@ class Attention extends Managed_DataObject
throw new Exception('Failed Attention::saveNew for notice id=='.$notice->getID().' target id=='.$target->getID().', reason=="'.$reason.'"');
}
}
+ self::blow('attention:stream:%d', $target->getID());
return $att;
}
}
diff --git a/classes/Notice.php b/classes/Notice.php
index 6f406472c7..9bf2204747 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1647,8 +1647,6 @@ class Notice extends Managed_DataObject
}
$att = Attention::saveNew($this, $target, $reason);
-
- self::blow('reply:stream:%d', $target->getID());
return true;
}
From e3431a2c91d3d4e9d9263b43cbfbdc15fb84f54d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 18:20:50 +0100
Subject: [PATCH 051/415] Iterate through input=file attachments (not multi
yet)
---
js/util.js | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/js/util.js b/js/util.js
index 15bff959ee..b645e8b029 100644
--- a/js/util.js
+++ b/js/util.js
@@ -848,27 +848,29 @@ var SN = { // StatusNet
NDA.change(function (event) {
form.find('.attach-status').remove();
- var filename = $(this).val();
- if (!filename) {
- // No file -- we've been tricked!
- return false;
- }
-
- var attachStatus = $('
×
');
- attachStatus.find('code').text(filename);
- attachStatus.find('button').click(function () {
- attachStatus.remove();
- NDA.val('');
-
- return false;
- });
- form.append(attachStatus);
-
if (typeof this.files === "object") {
+ var attachStatus = $('');
+ form.append(attachStatus);
// Some newer browsers will let us fetch the files for preview.
for (i = 0; i < this.files.length; i++) {
SN.U.PreviewAttach(form, this.files[i]);
}
+ } else {
+ var filename = $(this).val();
+ if (!filename) {
+ // No file -- we've been tricked!
+ return false;
+ }
+
+ var attachStatus = $('
×
');
+ attachStatus.find('code').text(filename);
+ attachStatus.find('button').click(function () {
+ attachStatus.remove();
+ NDA.val('');
+
+ return false;
+ });
+ form.append(attachStatus);
}
});
},
@@ -964,12 +966,15 @@ var SN = { // StatusNet
if (preview) {
blobAsDataURL(file, function (url) {
+ var fileentry = $(' ');
+ fileentry.append($('' + file.name + '
'));
var img = $(' ')
.attr('title', tooltip)
.attr('alt', tooltip)
.attr('src', url)
.attr('style', 'height: 120px');
- form.find('.attach-status').append(img);
+ fileentry.append(img);
+ form.find('.attach-status').append(fileentry);
});
} else {
var img = $('
').text(tooltip);
From 47f408ca7ce84bca62387b0fa099ec5813d5d5f4 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 23:36:47 +0100
Subject: [PATCH 052/415] Strict typing for mail_notify_attn
---
classes/Notice.php | 2 +-
lib/mail.php | 30 ++++++++++++++++--------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 9bf2204747..fcc544e2ea 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1834,7 +1834,7 @@ class Notice extends Managed_DataObject
foreach ($recipientIds as $recipientId) {
try {
$user = User::getByID($recipientId);
- mail_notify_attn($user, $this);
+ mail_notify_attn($user->getProfile(), $this);
} catch (NoResultException $e) {
// No such user
}
diff --git a/lib/mail.php b/lib/mail.php
index da22eb6715..383e2670cf 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -668,20 +668,19 @@ function mail_notify_message($message, $from=null, $to=null)
/**
* Notify a user that they have received an "attn:" message AKA "@-reply"
*
- * @param User $user The user who recevied the notice
+ * @param Profile $rcpt The Profile who recevied the notice, should be a local user
* @param Notice $notice The notice that was sent
*
* @return void
*/
-function mail_notify_attn($user, $notice)
+function mail_notify_attn(Profile $rcpt, Notice $notice)
{
- if (!$user->receivesEmailNotifications()) {
+ if (!$rcpt->isLocal()) {
return;
}
$sender = $notice->getProfile();
-
- if ($sender->id == $user->id) {
+ if ($rcpt->sameAs($sender)) {
return;
}
@@ -691,17 +690,20 @@ function mail_notify_attn($user, $notice)
}
// If the author has blocked the author, don't spam them with a notification.
- if ($user->hasBlocked($sender)) {
+ if ($rcpt->hasBlocked($sender)) {
return;
}
- $bestname = $sender->getBestName();
+ $user = $rcpt->getUser();
+ if (!$user->receivesEmailNotifications()) {
+ return;
+ }
common_switch_locale($user->language);
if ($notice->hasConversation()) {
$conversationUrl = common_local_url('conversation',
- array('id' => $notice->conversation)).'#notice-'.$notice->id;
+ array('id' => $notice->conversation)).'#notice-'.$notice->getID();
// TRANS: Line in @-reply notification e-mail. %s is conversation URL.
$conversationEmailText = sprintf(_("The full conversation can be read here:\n\n".
"\t%s"), $conversationUrl) . "\n\n";
@@ -711,7 +713,7 @@ function mail_notify_attn($user, $notice)
// TRANS: E-mail subject for notice notification.
// TRANS: %1$s is the sending user's long name, %2$s is the adding user's nickname.
- $subject = sprintf(_('%1$s (@%2$s) sent a notice to your attention'), $bestname, $sender->nickname);
+ $subject = sprintf(_('%1$s (@%2$s) sent a notice to your attention'), $sender->getBestName(), $sender->getNickname());
// TRANS: Body of @-reply notification e-mail.
// TRANS: %1$s is the sending user's name, $2$s is the StatusNet sitename,
@@ -731,15 +733,15 @@ function mail_notify_attn($user, $notice)
$sender->getFancyName(),//%1
common_config('site', 'name'),//%2
common_local_url('shownotice',
- array('notice' => $notice->id)),//%3
- $notice->content,//%4
+ array('notice' => $notice->getID())),//%3
+ $notice->getContent(),//%4
$conversationEmailText,//%5
common_local_url('newnotice',
- array('replyto' => $sender->nickname, 'inreplyto' => $notice->id)),//%6
+ array('replyto' => $sender->getNickname(), 'inreplyto' => $notice->getID())),//%6
common_local_url('replies',
- array('nickname' => $user->nickname))) . //%7
+ array('nickname' => $rcpt->getNickname()))) . //%7
mail_footer_block();
- $headers = _mail_prepare_headers('mention', $user->nickname, $sender->nickname);
+ $headers = _mail_prepare_headers('mention', $rcpt->getNickname(), $sender->getNickname());
common_switch_locale();
mail_to_user($user, $subject, $body, $headers);
From ddd60e7142dc0175d3cbaba5fa54430857d64e00 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 23:37:38 +0100
Subject: [PATCH 053/415] Make Profile->getFancyName() return including the
acct URI
---
classes/Profile.php | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 36e91c3ad0..4fa20d7cd4 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -225,11 +225,11 @@ class Profile extends Managed_DataObject
*/
function getFancyName()
{
- if ($this->fullname) {
- // TRANS: Full name of a profile or group (%1$s) followed by nickname (%2$s) in parentheses.
- return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->fullname, $this->nickname);
+ if ($this->getFullname()) {
+ // TRANS: Full name of a profile or group (%1$s) followed by acct URI (%2$s) in parentheses without acct:.
+ return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->getFullname(), $this->getAcctUri());
} else {
- return $this->nickname;
+ return $this->getAcctUri(false);
}
}
@@ -1575,7 +1575,7 @@ class Profile extends Managed_DataObject
*
* @return string $uri
*/
- public function getAcctUri()
+ public function getAcctUri($scheme=true)
{
$acct = null;
@@ -1586,11 +1586,15 @@ class Profile extends Managed_DataObject
if ($acct === null) {
throw new ProfileNoAcctUriException($this);
}
+ if (parse_url($acct, PHP_URL_SCHEME) !== 'acct') {
+ throw new ServerException('Acct URI does not have acct: scheme');
+ }
- return $acct;
+ // if we don't return the scheme, just remove the 'acct:' in the beginning
+ return $scheme ? $acct : mb_substr($acct, 5);
}
- function hasBlocked($other)
+ function hasBlocked(Profile $other)
{
$block = Profile_block::exists($this, $other);
return !empty($block);
From 4abb3f19bfa76a9434d1e44e7b4ebbd6e5e65192 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 23:48:32 +0100
Subject: [PATCH 054/415] Make Profile->getFancyUrl() somewhat better on
fallback
It tries to get a referential identifier apart from the fullname trying
with acct: URI, profile URL and lastly URI.
---
classes/Profile.php | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 4fa20d7cd4..2bcd1858fe 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -218,18 +218,30 @@ class Profile extends Managed_DataObject
}
/**
- * Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone
- * if no fullname is provided.
+ * Gets the full name (if filled) with acct URI, URL, or URI as a
+ * parenthetical (in that order, for each not found). If no full
+ * name is found only the second part is returned, without ()s.
*
* @return string
*/
function getFancyName()
{
- if ($this->getFullname()) {
- // TRANS: Full name of a profile or group (%1$s) followed by acct URI (%2$s) in parentheses without acct:.
- return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->getFullname(), $this->getAcctUri());
+ $uri = null;
+ try {
+ $uri = $this->getAcctUri();
+ } catch (ProfileNoAcctUriException $e) {
+ try {
+ $uri = $this->getUrl();
+ } catch (InvalidUrlException $e) {
+ $uri = $this->getUri();
+ }
+ }
+
+ if (mb_strlen($this->getFullname()) > 0) {
+ // TRANS: Full name of a profile or group (%1$s) followed by some URI (%2$s) in parentheses.
+ return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->getFullname(), $uri);
} else {
- return $this->getAcctUri(false);
+ return $uri;
}
}
From 99fbb181c1ab318d690f13dad81f6bc8190a89c7 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 1 Mar 2016 23:53:36 +0100
Subject: [PATCH 055/415] Translation changes, use FancyName in email subject
---
classes/Profile.php | 2 +-
lib/mail.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 2bcd1858fe..0e655faa63 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -238,7 +238,7 @@ class Profile extends Managed_DataObject
}
if (mb_strlen($this->getFullname()) > 0) {
- // TRANS: Full name of a profile or group (%1$s) followed by some URI (%2$s) in parentheses.
+ // TRANS: The "fancy name": Full name of a profile or group (%1$s) followed by some URI (%2$s) in parentheses.
return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->getFullname(), $uri);
} else {
return $uri;
diff --git a/lib/mail.php b/lib/mail.php
index 383e2670cf..42a756ac5d 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -712,8 +712,8 @@ function mail_notify_attn(Profile $rcpt, Notice $notice)
}
// TRANS: E-mail subject for notice notification.
- // TRANS: %1$s is the sending user's long name, %2$s is the adding user's nickname.
- $subject = sprintf(_('%1$s (@%2$s) sent a notice to your attention'), $sender->getBestName(), $sender->getNickname());
+ // TRANS: %1$s is the "fancy name" for a profile.
+ $subject = sprintf(_('%1$s sent a notice to your attention'), $sender->getFancyName());
// TRANS: Body of @-reply notification e-mail.
// TRANS: %1$s is the sending user's name, $2$s is the StatusNet sitename,
From 7ec69e42152debe05c2e8e7bc3f7fac862477c36 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 00:04:31 +0100
Subject: [PATCH 056/415] User->hasBlocked typing
---
classes/User.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/User.php b/classes/User.php
index 12cc170f86..909cadb6eb 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -190,7 +190,7 @@ class User extends Managed_DataObject
return Sms_carrier::getKV('id', $this->carrier);
}
- function hasBlocked($other)
+ function hasBlocked(Profile $other)
{
return $this->getProfile()->hasBlocked($other);
}
From 9a899902931b158eea9a23427623a809100d2016 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 00:13:28 +0100
Subject: [PATCH 057/415] Some changes since getFancyName() is longer with full
acct: URI
---
plugins/ActivityModeration/classes/Deleted_notice.php | 4 +++-
plugins/OStatus/OStatusPlugin.php | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/ActivityModeration/classes/Deleted_notice.php b/plugins/ActivityModeration/classes/Deleted_notice.php
index 4ffc0c895f..05414caab2 100644
--- a/plugins/ActivityModeration/classes/Deleted_notice.php
+++ b/plugins/ActivityModeration/classes/Deleted_notice.php
@@ -151,9 +151,11 @@ class Deleted_notice extends Managed_DataObject
$actobj->title = ActivityUtils::verbToTitle($actobj->verb);
$actor = $this->getActor();
+ // TRANS: Notice HTML content of a deleted notice. %1$s is the
+ // TRANS: actor's URL, %2$s its "fancy name" and %3$s the notice URI.
$actobj->content = sprintf(_m('%2$s deleted notice {{%3$s}}.'),
htmlspecialchars($actor->getUrl()),
- htmlspecialchars($actor->getBestName()),
+ htmlspecialchars($actor->getFancyName()),
htmlspecialchars($this->getUri())
);
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 292af658ed..d702703c81 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -312,7 +312,7 @@ class OStatusPlugin extends Plugin
assert($profile instanceof Profile);
$text = !empty($profile->nickname) && mb_strlen($profile->nickname) < mb_strlen($target)
- ? $profile->getNickname() // TODO: we could do getFancyName() or getFullname() here
+ ? $profile->getNickname() // TODO: we could do getBestName() or getFullname() here
: $target;
$url = $profile->getUri();
if (!common_valid_http_url($url)) {
From 79d68a52d086d9855bcc7c299f6ce68411c5788e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 10:49:33 +0100
Subject: [PATCH 058/415] No 'acct:' in FancyName please.
---
classes/Profile.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 0e655faa63..3ac2effe3c 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -228,7 +228,7 @@ class Profile extends Managed_DataObject
{
$uri = null;
try {
- $uri = $this->getAcctUri();
+ $uri = $this->getAcctUri(false);
} catch (ProfileNoAcctUriException $e) {
try {
$uri = $this->getUrl();
From b4271a3533bdf12329f27dd75452c1ef2a6ee3d1 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 11:40:43 +0100
Subject: [PATCH 059/415] Stricted typing + protected on
FilteringNoticeStream->filter
---
lib/filteringnoticestream.php | 4 ++--
lib/scopingnoticestream.php | 2 +-
lib/threadingnoticestream.php | 8 ++------
plugins/Event/lib/eventsnoticestream.php | 2 +-
4 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/lib/filteringnoticestream.php b/lib/filteringnoticestream.php
index b4ec6687bb..979305ad39 100644
--- a/lib/filteringnoticestream.php
+++ b/lib/filteringnoticestream.php
@@ -49,12 +49,12 @@ abstract class FilteringNoticeStream extends NoticeStream
{
protected $upstream;
- function __construct($upstream)
+ function __construct(NoticeStream $upstream)
{
$this->upstream = $upstream;
}
- abstract function filter($notice);
+ abstract protected function filter(Notice $notice);
function getNoticeIds($offset, $limit, $since_id, $max_id)
{
diff --git a/lib/scopingnoticestream.php b/lib/scopingnoticestream.php
index 84af75948d..854903d33d 100644
--- a/lib/scopingnoticestream.php
+++ b/lib/scopingnoticestream.php
@@ -61,7 +61,7 @@ class ScopingNoticeStream extends FilteringNoticeStream
* @return boolean whether to include the notice
*/
- function filter($notice)
+ protected function filter(Notice $notice)
{
return $notice->inScope($this->scoped);
}
diff --git a/lib/threadingnoticestream.php b/lib/threadingnoticestream.php
index 167a9584a6..de113b2a41 100644
--- a/lib/threadingnoticestream.php
+++ b/lib/threadingnoticestream.php
@@ -28,11 +28,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* This notice stream filters notices by whether their conversation
@@ -58,7 +54,7 @@ class ThreadingNoticeStream extends FilteringNoticeStream
return parent::getNotices($offset, $limit, $sinceId, $maxId);
}
- function filter($notice)
+ protected function filter(Notice $notice)
{
if (!array_key_exists($notice->conversation, $this->seen)) {
$this->seen[$notice->conversation] = true;
diff --git a/plugins/Event/lib/eventsnoticestream.php b/plugins/Event/lib/eventsnoticestream.php
index 3dd1a81bd1..b9e40430e7 100644
--- a/plugins/Event/lib/eventsnoticestream.php
+++ b/plugins/Event/lib/eventsnoticestream.php
@@ -64,7 +64,7 @@ class EventsNoticeStream extends ScopingNoticeStream
parent::__construct(new CachingNoticeStream($stream, $key), $scoped);
}
- function filter($notice)
+ protected function filter(Notice $notice)
{
if (!parent::filter($notice)) {
// if not in our scope, return false
From a3b21189068eb980ce27c1a45bcb88734ba11cc4 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 11:50:50 +0100
Subject: [PATCH 060/415] Make the public streams ModeratedNoticeStream (hide
sandboxed users etc.)
Which streams should be put under ModeratedNoticeStream is probably open
to debate. But at least the public ones should hide the posts from users
that are sandboxed.
---
lib/moderatednoticestream.php | 39 +++++++++++++++++++++++++++++++
lib/networkpublicnoticestream.php | 2 +-
lib/publicnoticestream.php | 2 +-
3 files changed, 41 insertions(+), 2 deletions(-)
create mode 100644 lib/moderatednoticestream.php
diff --git a/lib/moderatednoticestream.php b/lib/moderatednoticestream.php
new file mode 100644
index 0000000000..3c778d8a2c
--- /dev/null
+++ b/lib/moderatednoticestream.php
@@ -0,0 +1,39 @@
+scoped from ScopingNoticeStream as the Profile
+ * this stream is meant for. Can be null in case we're not logged in.
+ *
+ * @category Stream
+ * @package GNUsocial
+ * @author Mikael Nordfeldth
+ * @copyright 2016 Free Software Foundation, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link https://gnu.io/social
+ */
+
+class ModeratedNoticeStream extends ScopingNoticeStream
+{
+ protected function filter(Notice $notice)
+ {
+ if (!parent::filter($notice)) {
+ return false;
+ }
+
+ // If the notice author is sandboxed
+ if ($notice->getProfile()->isSandboxed()) {
+ // and we're either not logged in OR we aren't some kind of privileged user that can see spam etc.
+ if (!$this->scoped instanceof Profile || !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/lib/networkpublicnoticestream.php b/lib/networkpublicnoticestream.php
index bd4da5d075..c722bd8c14 100644
--- a/lib/networkpublicnoticestream.php
+++ b/lib/networkpublicnoticestream.php
@@ -2,7 +2,7 @@
if (!defined('GNUSOCIAL')) { exit(1); }
-class NetworkPublicNoticeStream extends ScopingNoticeStream
+class NetworkPublicNoticeStream extends ModeratedNoticeStream
{
function __construct(Profile $scoped=null)
{
diff --git a/lib/publicnoticestream.php b/lib/publicnoticestream.php
index 1dd59059fd..2638292714 100644
--- a/lib/publicnoticestream.php
+++ b/lib/publicnoticestream.php
@@ -41,7 +41,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
* @link http://status.net/
*/
-class PublicNoticeStream extends ScopingNoticeStream
+class PublicNoticeStream extends ModeratedNoticeStream
{
function __construct(Profile $scoped=null)
{
From 9534969c050054cac3a9a19311cbef23d84fda54 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 12:18:16 +0100
Subject: [PATCH 061/415] Don't set is_local=LOCAL_NONPUBLIC on sandboxed user
notices
Let's decide whether they are nonpublic by testing them when the notice
is shown instead.
---
classes/Notice.php | 17 +++++++----------
lib/filteringnoticestream.php | 3 +++
lib/moderatednoticestream.php | 7 +++++--
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index fcc544e2ea..f8bdbcd340 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -508,11 +508,7 @@ class Notice extends Managed_DataObject
$notice->profile_id = $profile_id;
$autosource = common_config('public', 'autosource');
-
- // Sandboxed are non-false, but not 1, either
-
- if (!$profile->hasRight(Right::PUBLICNOTICE) ||
- ($source && $autosource && in_array($source, $autosource))) {
+ if ($source && $autosource && in_array($source, $autosource)) {
$notice->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$notice->is_local = $is_local;
@@ -822,12 +818,13 @@ class Notice extends Managed_DataObject
}
}
- $autosource = common_config('public', 'autosource');
+ // NOTE: Sandboxed users previously got all the notices _during_
+ // sandbox period set to to is_local=Notice::LOCAL_NONPUBLIC here.
+ // Since then we have started just filtering _when_ it gets shown
+ // instead of creating a mixed jumble of differently scoped notices.
- // Sandboxed are non-false, but not 1, either
- if (!$actor->hasRight(Right::PUBLICNOTICE) ||
- ($source && $autosource && in_array($source, $autosource))) {
- // FIXME: ...what about remote nonpublic? Hmmm. That is, if we sandbox remote profiles...
+ $autosource = common_config('public', 'autosource');
+ if ($source && $autosource && in_array($source, $autosource)) {
$stored->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$stored->is_local = intval($is_local);
diff --git a/lib/filteringnoticestream.php b/lib/filteringnoticestream.php
index 979305ad39..c1edfc6387 100644
--- a/lib/filteringnoticestream.php
+++ b/lib/filteringnoticestream.php
@@ -54,6 +54,9 @@ abstract class FilteringNoticeStream extends NoticeStream
$this->upstream = $upstream;
}
+ /**
+ * @return boolean true if we allow it, false if we deny it
+ */
abstract protected function filter(Notice $notice);
function getNoticeIds($offset, $limit, $since_id, $max_id)
diff --git a/lib/moderatednoticestream.php b/lib/moderatednoticestream.php
index 3c778d8a2c..f984256acc 100644
--- a/lib/moderatednoticestream.php
+++ b/lib/moderatednoticestream.php
@@ -28,8 +28,11 @@ class ModeratedNoticeStream extends ScopingNoticeStream
// If the notice author is sandboxed
if ($notice->getProfile()->isSandboxed()) {
- // and we're either not logged in OR we aren't some kind of privileged user that can see spam etc.
- if (!$this->scoped instanceof Profile || !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ if (!$this->scoped instanceof Profile) {
+ // Non-logged in users don't get to see posts by sandboxed users
+ return false;
+ } elseif (!$notice->getProfile()->sameAs($this->scoped) && !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ // And if we are logged in, deny if scoped user is neither the author nor has the right to review spam
return false;
}
}
From d6598e790c837ef9c827c3b2c2c81bbdab27838c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 12:33:06 +0100
Subject: [PATCH 062/415] Introduce a ConfigException
---
classes/Notice.php | 6 ++----
lib/configexception.php | 22 ++++++++++++++++++++++
lib/gnusocial.php | 6 +++++-
3 files changed, 29 insertions(+), 5 deletions(-)
create mode 100644 lib/configexception.php
diff --git a/classes/Notice.php b/classes/Notice.php
index f8bdbcd340..7484897679 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -507,8 +507,7 @@ class Notice extends Managed_DataObject
$notice = new Notice();
$notice->profile_id = $profile_id;
- $autosource = common_config('public', 'autosource');
- if ($source && $autosource && in_array($source, $autosource)) {
+ if ($source && in_array($source, common_config('public', 'autosource'))) {
$notice->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$notice->is_local = $is_local;
@@ -823,8 +822,7 @@ class Notice extends Managed_DataObject
// Since then we have started just filtering _when_ it gets shown
// instead of creating a mixed jumble of differently scoped notices.
- $autosource = common_config('public', 'autosource');
- if ($source && $autosource && in_array($source, $autosource)) {
+ if ($source && in_array($source, common_config('public', 'autosource'))) {
$stored->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$stored->is_local = intval($is_local);
diff --git a/lib/configexception.php b/lib/configexception.php
new file mode 100644
index 0000000000..5036a43533
--- /dev/null
+++ b/lib/configexception.php
@@ -0,0 +1,22 @@
+
+ * @license https://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link https://gnu.io/social
+ */
+
+class ConfigException extends ServerException
+{
+ public function __construct($message=null) {
+ parent::__construct($message, 500);
+ }
+}
diff --git a/lib/gnusocial.php b/lib/gnusocial.php
index 2ad688a790..aecebe2556 100644
--- a/lib/gnusocial.php
+++ b/lib/gnusocial.php
@@ -432,9 +432,13 @@ class GNUsocial
if (common_config('htmlpurifier', 'Cache.DefinitionImpl') === 'Serializer'
&& !is_dir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
if (!mkdir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
- throw new ServerException('Could not create HTMLPurifier cache dir: '._ve(common_config('htmlpurifier', 'Cache.SerializerPath')));
+ throw new ConfigException('Could not create HTMLPurifier cache dir: '._ve(common_config('htmlpurifier', 'Cache.SerializerPath')));
}
}
+
+ if (!is_array(common_config('public', 'autosource'))) {
+ throw new ConfigException('Configuration option public/autosource is not an array.');
+ }
}
/**
From 53772ba3058add38f8aef603aa0b433f7a81734a Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 12:41:56 +0100
Subject: [PATCH 063/415] Some rights one does not have if either sandboxed or
silenced
---
classes/Profile.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 3ac2effe3c..3dbd883dd8 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -1325,7 +1325,7 @@ class Profile extends Managed_DataObject
case Right::EMAILONREPLY:
case Right::EMAILONSUBSCRIBE:
case Right::EMAILONFAVE:
- $result = !$this->isSandboxed();
+ $result = !$this->isSandboxed() && !$this->isSilenced();
break;
case Right::WEBLOGIN:
$result = !$this->isSilenced();
From e4e0a39dad5e4ea72e462368673371f5161abffa Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 12:42:09 +0100
Subject: [PATCH 064/415] Only OStatus distribute if profile hasRight to
PUBLICNOTICE
---
plugins/OStatus/OStatusPlugin.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index d702703c81..583ad8ef13 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -129,7 +129,7 @@ class OStatusPlugin extends Plugin
*/
function onStartEnqueueNotice($notice, &$transports)
{
- if ($notice->inScope(null)) {
+ if ($notice->inScope(null) && $notice->getProfile()->hasRight(Right::PUBLICNOTICE)) {
// put our transport first, in case there's any conflict (like OMB)
array_unshift($transports, 'ostatus');
$this->log(LOG_INFO, "Notice {$notice->id} queued for OStatus processing");
From 6529fdd28d348a40106e7071b193b487f6e8949e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 13:10:02 +0100
Subject: [PATCH 065/415] Proper Microformats2 h-entry p-name + u-uid markup
---
lib/noticelistitem.php | 4 ++--
theme/base/css/display.css | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php
index 4c4bde34a1..ad5962d751 100644
--- a/lib/noticelistitem.php
+++ b/lib/noticelistitem.php
@@ -179,8 +179,8 @@ class NoticeListItem extends Widget
function showNoticeTitle()
{
if (Event::handle('StartShowNoticeTitle', array($this))) {
- $this->element('a', array('href' => $this->notice->getUrl(true),
- 'class' => 'notice-title'),
+ $this->element('a', array('href' => $this->notice->getUri(),
+ 'class' => 'p-name u-uid'),
$this->notice->getTitle());
Event::handle('EndShowNoticeTitle', array($this));
}
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 295916d78e..73c95c277a 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -1013,7 +1013,7 @@ content: ":";
clear:both;
}
-.notice-title {
+.notice-headers > .u-uid {
display:none;
}
From dc1ceca86ea5310bc04df21f94db68015d3b9d59 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 13:29:54 +0100
Subject: [PATCH 066/415] Some more Microformats2 data for notices and
rendering
---
lib/noticelistitem.php | 10 ++++++++--
lib/util.php | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php
index ad5962d751..a0dcf6f30c 100644
--- a/lib/noticelistitem.php
+++ b/lib/noticelistitem.php
@@ -301,9 +301,15 @@ class NoticeListItem extends Widget
foreach ($attentions as $attn) {
$class = $attn->isGroup() ? 'group' : 'account';
- $this->pa[] = array('href' => $attn->profileurl,
+ $profileurl = $attn->getUri();
+ if (common_valid_http_url($profileurl)) {
+ $class .= ' u-uid';
+ } else {
+ $profileurl = $attn->getUrl();
+ }
+ $this->pa[] = array('href' => $profileurl,
'title' => $attn->getNickname(),
- 'class' => "addressee {$class}",
+ 'class' => "addressee {$class} p-name u-url",
'text' => $attn->getStreamName());
}
diff --git a/lib/util.php b/lib/util.php
index 5aeda6d750..05e3e732bd 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -692,7 +692,7 @@ function common_linkify_mention(array $mention)
$xs = new XMLStringer(false);
$attrs = array('href' => $mention['url'],
- 'class' => 'h-card '.$mention['type']);
+ 'class' => 'h-card u-url p-nickname '.$mention['type']);
if (!empty($mention['title'])) {
$attrs['title'] = $mention['title'];
From 97d8e4571f69479ea31ae57aa1df1e8e888d5594 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 14:35:08 +0100
Subject: [PATCH 067/415] Fix a regression in 1f76c1e4 that stopped sending
email confirmation on registration
---
classes/User.php | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/classes/User.php b/classes/User.php
index 909cadb6eb..26225916f1 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -343,7 +343,8 @@ class User extends Managed_DataObject
$invite->convert($user);
}
- if (!empty($email) && !$user->email) {
+ if (!empty($email) && empty($user->email)) {
+ // The actual email will be sent further down, after the database COMMIT
$confirm = new Confirm_address();
$confirm->code = common_confirmation_code(128);
@@ -353,7 +354,7 @@ class User extends Managed_DataObject
$result = $confirm->insert();
- if (!$result) {
+ if ($result===false) {
common_log_db_error($confirm, 'INSERT', __FILE__);
$profile->query('ROLLBACK');
// TRANS: Email confirmation data could not be inserted for some reason.
@@ -381,11 +382,12 @@ class User extends Managed_DataObject
$profile->query('COMMIT');
- if (!empty($email) && !empty($user->email)) {
+ if (!empty($email) && empty($user->email)) {
try {
- mail_confirm_address($user, $confirm->code, $profile->nickname, $email);
+ require_once(INSTALLDIR . '/lib/mail.php');
+ mail_confirm_address($user, $confirm->code, $profile->getNickname(), $email);
} catch (EmailException $e) {
- common_log(LOG_ERR, "Could not send user registration email for user id=={$user->id}: {$e->getMessage()}");
+ common_log(LOG_ERR, "Could not send user registration email for user id=={$profile->getID()}: {$e->getMessage()}");
if (!$accept_email_fail) {
throw $e;
}
@@ -407,7 +409,7 @@ class User extends Managed_DataObject
// TRANS: %1$s is the sitename, $2$s is the registering user's nickname.
sprintf(_('Welcome to %1$s, @%2$s!'),
common_config('site', 'name'),
- $user->nickname),
+ $profile->getNickname()),
'system');
}
}
@@ -415,7 +417,7 @@ class User extends Managed_DataObject
Event::handle('EndUserRegister', array($profile));
}
- if (!$user instanceof User) {
+ if (!$user instanceof User || empty($user->id)) {
throw new ServerException('User could not be registered. Probably an event hook that failed.');
}
@@ -433,13 +435,14 @@ class User extends Managed_DataObject
if ($invites->find()) {
while ($invites->fetch()) {
try {
- $other = Profile::getKV('id', $invites->user_id);
- if (!($other instanceof Profile)) { // remove when getKV throws exceptions
- continue;
- }
+ $other = Profile::getByID($invites->user_id);
Subscription::start($other, $this->getProfile());
+ } catch (NoResultException $e) {
+ // profile did not exist
+ } catch (AlreadyFulfilledException $e) {
+ // already subscribed to this profile
} catch (Exception $e) {
- continue;
+ common_log(LOG_ERR, 'On-invitation-completion subscription failed when subscribing '._ve($invites->user_id).' to '.$this->getProfile()->getID().': '._ve($e->getMessage()));
}
}
}
@@ -876,6 +879,8 @@ class User extends Managed_DataObject
static function recoverPassword($nore)
{
+ require_once(INSTALLDIR . '/lib/mail.php');
+
// $confirm_email will be used as a fallback if our user doesn't have a confirmed email
$confirm_email = null;
From 175b7e8541f747b5f38aec2c55be6cee3138fb72 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 15:31:48 +0100
Subject: [PATCH 068/415] Refactor some ConfirmaddressAction stuff
---
actions/confirmaddress.php | 78 +++++++++++++++++--------------------
actions/emailsettings.php | 8 +---
actions/imsettings.php | 8 +---
actions/recoverpassword.php | 8 +---
actions/smssettings.php | 8 +---
classes/Confirm_address.php | 13 +++++++
6 files changed, 52 insertions(+), 71 deletions(-)
diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php
index 806851001e..9ac6848d7a 100644
--- a/actions/confirmaddress.php
+++ b/actions/confirmaddress.php
@@ -27,9 +27,7 @@
* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Confirm an address
@@ -44,25 +42,14 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-class ConfirmaddressAction extends Action
+class ConfirmaddressAction extends ManagedAction
{
/** type of confirmation. */
- var $address;
+ protected $address;
- /**
- * Accept a confirmation code
- *
- * Checks the code and confirms the address in the
- * user record
- *
- * @param args $args $_REQUEST array
- *
- * @return void
- */
- function handle($args)
+ protected function doPreparation()
{
- parent::handle($args);
if (!common_logged_in()) {
common_set_returnto($this->selfUrl());
common_redirect(common_local_url('login'));
@@ -70,32 +57,45 @@ class ConfirmaddressAction extends Action
$code = $this->trimmed('code');
if (!$code) {
// TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action.
- $this->clientError(_('No confirmation code.'));
+ throw new ClientException(_('No confirmation code.'));
}
$confirm = Confirm_address::getKV('code', $code);
- if (!$confirm) {
+ if (!$confirm instanceof Confirm_address) {
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
- $this->clientError(_('Confirmation code not found.'));
+ throw new ClientException(_('Confirmation code not found.'), 404);
}
- $cur = common_current_user();
- if ($cur->id != $confirm->user_id) {
+
+ try {
+ $profile = Profile::getByID($confirm->user_id);
+ } catch (NoResultException $e) {
+ common_log(LOG_INFO, 'Tried to confirm the email for a deleted profile: '._ve(['id'=>$confirm->user_id, 'email'=>$confirm->address]));
+ $confirm->delete();
+ throw $e;
+ }
+ if (!$profile->sameAs($this->scoped)) {
// TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action.
- $this->clientError(_('That confirmation code is not for you!'));
+ throw new AuthorizationException(_('That confirmation code is not for you!'));
}
+
$type = $confirm->address_type;
$transports = array();
Event::handle('GetImTransports', array(&$transports));
if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($transports))) {
// TRANS: Server error for an unknown address type, which can be 'email', 'sms', or the name of an IM network (such as 'xmpp' or 'aim')
- $this->serverError(sprintf(_('Unrecognized address type %s'), $type));
+ throw new ServerException(sprintf(_('Unrecognized address type %s'), $type));
}
$this->address = $confirm->address;
+
+ $cur = $this->scoped->getUser();
+
$cur->query('BEGIN');
- if (in_array($type, array('email', 'sms')))
- {
+ if (in_array($type, array('email', 'sms'))) {
+ common_debug("Confirming {$type} address for user {$this->scoped->getID()}");
if ($cur->$type == $confirm->address) {
+ // Already verified, so delete the confirm_address entry
+ $confirm->delete();
// TRANS: Client error for an already confirmed email/jabber/sms address.
- $this->clientError(_('That address has already been confirmed.'));
+ throw new AlreadyFulfilledException(_('That address has already been confirmed.'));
}
$orig_user = clone($cur);
@@ -122,16 +122,18 @@ class ConfirmaddressAction extends Action
$user_im_prefs->user_id = $cur->id;
if ($user_im_prefs->find() && $user_im_prefs->fetch()) {
if($user_im_prefs->screenname == $confirm->address){
+ // Already verified, so delete the confirm_address entry
+ $confirm->delete();
// TRANS: Client error for an already confirmed IM address.
- $this->clientError(_('That address has already been confirmed.'));
+ throw new AlreadyFulfilledException(_('That address has already been confirmed.'));
}
$user_im_prefs->screenname = $confirm->address;
$result = $user_im_prefs->update();
- if (!$result) {
+ if ($result === false) {
common_log_db_error($user_im_prefs, 'UPDATE', __FILE__);
// TRANS: Server error displayed when updating IM preferences fails.
- $this->serverError(_('Could not update user IM preferences.'));
+ throw new ServerException(_('Could not update user IM preferences.'));
}
}else{
$user_im_prefs = new User_im_prefs();
@@ -140,26 +142,18 @@ class ConfirmaddressAction extends Action
$user_im_prefs->user_id = $cur->id;
$result = $user_im_prefs->insert();
- if (!$result) {
+ if ($result === false) {
common_log_db_error($user_im_prefs, 'INSERT', __FILE__);
// TRANS: Server error displayed when adding IM preferences fails.
- $this->serverError(_('Could not insert user IM preferences.'));
+ throw new ServerException(_('Could not insert user IM preferences.'));
}
}
}
- $result = $confirm->delete();
-
- if (!$result) {
- common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error displayed when an address confirmation code deletion from the
- // TRANS: database fails in the contact address confirmation action.
- $this->serverError(_('Could not delete address confirmation.'));
- }
+ $confirm->delete();
$cur->query('COMMIT');
- $this->showPage();
}
/**
@@ -180,8 +174,6 @@ class ConfirmaddressAction extends Action
*/
function showContent()
{
- $cur = common_current_user();
-
$this->element('p', null,
// TRANS: Success message for the contact address confirmation action.
// TRANS: %s can be 'email', 'jabber', or 'sms'.
diff --git a/actions/emailsettings.php b/actions/emailsettings.php
index c02f1cdfad..7384b3630d 100644
--- a/actions/emailsettings.php
+++ b/actions/emailsettings.php
@@ -401,13 +401,7 @@ class EmailsettingsAction extends SettingsAction
throw new AlreadyFulfilledException(_('No pending confirmation to cancel.'));
}
- $result = $confirm->delete();
-
- if ($result === false) {
- common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error thrown on database error canceling e-mail address confirmation.
- throw new ServerException(_('Could not delete email confirmation.'));
- }
+ $confirm->delete();
// TRANS: Message given after successfully canceling e-mail address confirmation.
return _('Email confirmation cancelled.');
diff --git a/actions/imsettings.php b/actions/imsettings.php
index 40bea10e68..80f7f78770 100644
--- a/actions/imsettings.php
+++ b/actions/imsettings.php
@@ -359,13 +359,7 @@ class ImsettingsAction extends SettingsAction
throw new AlreadyFulfilledException(_('No pending confirmation to cancel.'));
}
- $result = $confirm->delete();
-
- if ($result === false) {
- common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error thrown on database error canceling IM address confirmation.
- throw new ServerException(_('Could not delete confirmation.'));
- }
+ $confirm->delete();
// TRANS: Message given after successfully canceling IM address confirmation.
return _('IM confirmation cancelled.');
diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php
index a3a5b8e5bc..d19ed4693c 100644
--- a/actions/recoverpassword.php
+++ b/actions/recoverpassword.php
@@ -79,13 +79,7 @@ class RecoverpasswordAction extends Action
// Burn this code
- $result = $confirm->delete();
-
- if (!$result) {
- common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error displayed removing a password recovery code from the database.
- $this->serverError(_('Error with confirmation code.'));
- }
+ $confirm->delete();
// These should be reaped, but for now we just check mod time
// Note: it's still deleted; let's avoid a second attempt!
diff --git a/actions/smssettings.php b/actions/smssettings.php
index ca6a7d04ef..c002474ce2 100644
--- a/actions/smssettings.php
+++ b/actions/smssettings.php
@@ -368,13 +368,7 @@ class SmssettingsAction extends SettingsAction
throw new AlreadyFulfilledException(_('No pending confirmation to cancel.'));
}
- $result = $confirm->delete();
-
- if ($result === false) {
- common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error thrown on database error canceling SMS phone number confirmation.
- throw new ServerException(_('Could not delete SMS confirmation.'));
- }
+ $confirm->delete();
// TRANS: Message given after successfully canceling SMS phone number confirmation.
return _('SMS confirmation cancelled.');
diff --git a/classes/Confirm_address.php b/classes/Confirm_address.php
index 97e1a75dab..9bb56cef9c 100644
--- a/classes/Confirm_address.php
+++ b/classes/Confirm_address.php
@@ -66,4 +66,17 @@ class Confirm_address extends Managed_DataObject
return $ca;
}
+
+ public function delete($useWhere=false)
+ {
+ $result = parent::delete($useWhere);
+
+ if ($result === false) {
+ common_log_db_error($confirm, 'DELETE', __FILE__);
+ // TRANS: Server error displayed when an address confirmation code deletion from the
+ // TRANS: database fails in the contact address confirmation action.
+ throw new ServerException(_('Could not delete address confirmation.'));
+ }
+ return $result;
+ }
}
From a262c16f062837f1b863ee7b09e4edda530eb7d1 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 15:37:47 +0100
Subject: [PATCH 069/415] Catch exception on delete of Confirm_address in a
plugin
---
plugins/EmailRegistration/actions/emailregister.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/EmailRegistration/actions/emailregister.php b/plugins/EmailRegistration/actions/emailregister.php
index 7fa2aa22cf..d10b65c387 100644
--- a/plugins/EmailRegistration/actions/emailregister.php
+++ b/plugins/EmailRegistration/actions/emailregister.php
@@ -321,7 +321,11 @@ class EmailregisterAction extends Action
common_init_language();
if (!empty($this->confirmation)) {
- $this->confirmation->delete();
+ try {
+ $this->confirmation->delete();
+ } catch (ServerException $e) {
+ common_log(LOG_ERR, $e->getMessage());
+ }
}
Event::handle('EndRegistrationTry', array($this));
From feb97cfc2288169fbf8f1f47393c9735c017eeb6 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 2 Mar 2016 15:48:18 +0100
Subject: [PATCH 070/415] Resend confirm_address stuff, please read its NOTE
first
---
scripts/resend_confirm_address.php | 91 ++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100755 scripts/resend_confirm_address.php
diff --git a/scripts/resend_confirm_address.php b/scripts/resend_confirm_address.php
new file mode 100755
index 0000000000..1d7cb55ca5
--- /dev/null
+++ b/scripts/resend_confirm_address.php
@@ -0,0 +1,91 @@
+#!/usr/bin/env php
+address_type = 'email';
+ if (!$ca->find()) {
+ print "confirm_address table contains no lingering email addresses\n";
+ exit(0);
+ }
+} else {
+ print "You must provide an email (or --all).\n";
+ exit(1);
+}
+
+if (!have_option('y', 'yes')) {
+ print "About to resend confirm_address email to {$ca->N} recipients. Are you sure? [y/N] ";
+ $response = fgets(STDIN);
+ if (strtolower(trim($response)) != 'y') {
+ print "Aborting.\n";
+ exit(0);
+ }
+}
+
+function mailConfirmAddress(Confirm_address $ca)
+{
+ try {
+ $user = User::getByID($ca->user_id);
+ if ($user->email === $ca->address) {
+ throw new AlreadyFulfilledException('User already has identical confirmed email address.');
+ }
+ } catch (AlreadyFulfilledException $e) {
+ print "\n User already had verified email: "._ve($ca->address);
+ $ca->delete();
+ } catch (Exception $e) {
+ print "\n Failed to get user with ID "._ve($user_id).', deleting confirm_address entry: '._ve($e->getMessage());
+ $ca->delete();
+ return;
+ }
+ mail_confirm_address($user, $ca->code, $user->getNickname(), $ca->address);
+}
+
+require_once(INSTALLDIR . '/lib/mail.php');
+
+if (!$all) {
+ mailConfirmAddress($ca);
+} else {
+ while ($ca->fetch()) {
+ mailConfirmAddress($ca);
+ }
+}
+
+print "\nDONE.\n";
From 43754c7f17937fd40582e401af0ccd4a2015b3ce Mon Sep 17 00:00:00 2001
From: Saul St John
Date: Wed, 2 Mar 2016 15:41:17 +0000
Subject: [PATCH 071/415] add blacklist to StoreRemoteMedia plugin
---
.../StoreRemoteMediaPlugin.php | 42 ++++++++++++++-----
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/plugins/StoreRemoteMedia/StoreRemoteMediaPlugin.php b/plugins/StoreRemoteMedia/StoreRemoteMediaPlugin.php
index a08ae92572..f38ca4713e 100644
--- a/plugins/StoreRemoteMedia/StoreRemoteMediaPlugin.php
+++ b/plugins/StoreRemoteMedia/StoreRemoteMediaPlugin.php
@@ -15,6 +15,9 @@ class StoreRemoteMediaPlugin extends Plugin
public $append_whitelist = array(); // fill this array as domain_whitelist to add more trusted sources
public $check_whitelist = false; // security/abuse precaution
+ public $domain_blacklist = array();
+ public $check_blacklist = false;
+
protected $imgData = array();
// these should be declared protected everywhere
@@ -74,7 +77,10 @@ class StoreRemoteMediaPlugin extends Plugin
return true;
}
- $this->checkWhitelist($file->getUrl());
+ if (!$this->checkWhiteList($file->getUrl()) ||
+ !$this->checkBlackList($file->getUrl())) {
+ return true;
+ }
// First we download the file to memory and test whether it's actually an image file
common_debug(sprintf('Downloading remote file id==%u with URL: %s', $file->getID(), _ve($file->getUrl())));
@@ -124,23 +130,39 @@ class StoreRemoteMediaPlugin extends Plugin
}
/**
- * @return boolean false on no check made, provider name on success
- * @throws ServerException if check is made but fails
+ * @return boolean true if given url passes blacklist check
*/
- protected function checkWhitelist($url)
+ protected function checkBlackList($url)
{
- if (!$this->check_whitelist) {
- return false; // indicates "no check made"
+ if (!$this->check_blacklist) {
+ return true;
}
-
$host = parse_url($url, PHP_URL_HOST);
- foreach ($this->domain_whitelist as $regex => $provider) {
+ foreach ($this->domain_blacklist as $regex => $provider) {
if (preg_match("/$regex/", $host)) {
- return $provider; // we trust this source, return provider name
+ return false;
}
}
- throw new ServerException(sprintf(_('Domain not in remote source whitelist: %s'), $host));
+ return true;
+ }
+
+ /***
+ * @return boolean true if given url passes whitelist check
+ */
+ protected function checkWhiteList($url)
+ {
+ if (!$this->check_whitelist) {
+ return true;
+ }
+ $host = parse_url($url, PHP_URL_HOST);
+ foreach ($this->domain_whitelist as $regex => $provider) {
+ if (preg_match("/$regex/", $host)) {
+ return true;
+ }
+ }
+
+ return false;
}
public function onPluginVersion(array &$versions)
From 30e70c4697ab3b987426a8ca2017107cd3d6fb3f Mon Sep 17 00:00:00 2001
From: Saul St John
Date: Wed, 2 Mar 2016 16:05:40 +0000
Subject: [PATCH 072/415] update readme
---
plugins/StoreRemoteMedia/README | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/plugins/StoreRemoteMedia/README b/plugins/StoreRemoteMedia/README
index a6bd91f605..2de4ce4541 100644
--- a/plugins/StoreRemoteMedia/README
+++ b/plugins/StoreRemoteMedia/README
@@ -7,9 +7,19 @@ to the bottom of your config.php
Settings
========
+domain_blacklist: Array of regular expressions. Always escape your dots and end your strings.
+check_blacklist: Whether to check the domain_blacklist.
+
domain_whitelist: Array of regular expressions. Always escape your dots and end your strings.
check_whitelist: Whether to check the domain_whitelist.
+When check_whitelist is set, only images from URLs matching a regex in the
+domain_whitelist array are accepted for local storage. When check_blacklist
+is set, images from URLs matching any regex in the domain_blacklist are
+denied local storage. When both lists are checked, only images from URLs
+that match a regex in the domain_whitelist and that match no regexen in the
+domain_blacklist are accepted for local storage.
+
Example
=======
addPlugin('StoreRemoteMedia', array(
@@ -17,6 +27,6 @@ addPlugin('StoreRemoteMedia', array(
'^i\d*\.ytimg\.com$' => 'YouTube',
'^i\d*\.vimeocdn\.com$' => 'Vimeo'
),
- 'check_whitelist' => true
+ 'check_whitelist' => true,
));
From 7d4658643d70d19d2df2f5ce21ef353e56fb4ea9 Mon Sep 17 00:00:00 2001
From: hannes
Date: Fri, 4 Mar 2016 16:53:57 -0500
Subject: [PATCH 073/415] the repeated notice can be from a sandboxed user too
---
lib/moderatednoticestream.php | 40 +++++++++++++++++++++++++++--------
1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/lib/moderatednoticestream.php b/lib/moderatednoticestream.php
index f984256acc..b0d6601cb9 100644
--- a/lib/moderatednoticestream.php
+++ b/lib/moderatednoticestream.php
@@ -25,18 +25,40 @@ class ModeratedNoticeStream extends ScopingNoticeStream
if (!parent::filter($notice)) {
return false;
}
-
- // If the notice author is sandboxed
- if ($notice->getProfile()->isSandboxed()) {
- if (!$this->scoped instanceof Profile) {
- // Non-logged in users don't get to see posts by sandboxed users
- return false;
- } elseif (!$notice->getProfile()->sameAs($this->scoped) && !$this->scoped->hasRight(Right::REVIEWSPAM)) {
- // And if we are logged in, deny if scoped user is neither the author nor has the right to review spam
+
+ if(self::include_or_not($notice) === false) {
+ return false;
+ }
+
+ // If this is a repeat the repeated notice is moderated
+ if($notice->isRepeat()) {
+ try {
+ $repeated_notice = Notice::getById($notice->repeat_of);
+ } catch (Exception $e) {
+ // if we can't get the repeated notice by id, something is seriously wrong with it, so don't include it
return false;
}
- }
+
+ if(self::include_or_not($repeated_notice) === false) {
+ return false;
+ }
+ }
return true;
}
+
+ protected function include_or_not(Notice $notice)
+ {
+ $profile = $notice->getProfile();
+
+ if ($profile->isSandboxed()) {
+ if (!$this->scoped instanceof Profile) {
+ // Non-logged in users don't get to see posts by sandboxed users
+ return false;
+ } elseif (!$profile->sameAs($this->scoped) && !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ // And if we are logged in, deny if scoped user is neither the author nor has the right to review spam
+ return false;
+ }
+ }
+ }
}
From 952f68fed55aae6908fe1c85f1e96809d381af55 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 00:59:39 +0100
Subject: [PATCH 074/415] File upload logging for dummies
---
lib/filenotfoundexception.php | 1 +
lib/mediafile.php | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/filenotfoundexception.php b/lib/filenotfoundexception.php
index d3610249db..70dd2d0b5d 100644
--- a/lib/filenotfoundexception.php
+++ b/lib/filenotfoundexception.php
@@ -36,6 +36,7 @@ class FileNotFoundException extends ServerException
public function __construct($path)
{
$this->path = $path;
+ common_debug('File not found exception for: '._ve($this->path));
parent::__construct(_('File not found in filesystem.'), 404);
}
}
diff --git a/lib/mediafile.php b/lib/mediafile.php
index 1e0fb39769..7534dc53cb 100644
--- a/lib/mediafile.php
+++ b/lib/mediafile.php
@@ -306,10 +306,10 @@ class MediaFile
$result = copy($stream['uri'], $filepath) && chmod($filepath, 0664);
if (!$result) {
+ common_log(LOG_ERR, 'File could not be moved (or chmodded) from '._ve($stream['uri']) . ' to ' . _ve($filepath));
// TRANS: Client exception thrown when a file upload operation fails because the file could
// TRANS: not be moved from the temporary folder to the permanent file location.
- throw new ClientException(_('File could not be moved to destination directory.' .
- $stream['uri'] . ' ' . $filepath));
+ throw new ClientException(_('File could not be moved to destination directory.' ));
}
}
From bf34f730dd6490308b1df591ee6338a5e4975d5e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 01:03:48 +0100
Subject: [PATCH 075/415] Use $this->scoped in AvatarsettingsAction
---
actions/avatarsettings.php | 32 ++++++--------------------------
1 file changed, 6 insertions(+), 26 deletions(-)
diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php
index 4b618eb9be..f77339ad70 100644
--- a/actions/avatarsettings.php
+++ b/actions/avatarsettings.php
@@ -92,16 +92,6 @@ class AvatarsettingsAction extends SettingsAction
function showUploadForm()
{
- $user = common_current_user();
-
- $profile = $user->getProfile();
-
- if (!$profile) {
- common_log_db_error($user, 'SELECT', __FILE__);
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- }
-
$this->elementStart('form', array('enctype' => 'multipart/form-data',
'method' => 'post',
'id' => 'form_settings_avatar',
@@ -116,7 +106,7 @@ class AvatarsettingsAction extends SettingsAction
if (Event::handle('StartAvatarFormData', array($this))) {
$this->elementStart('ul', 'form_data');
try {
- $original = Avatar::getUploaded($profile);
+ $original = Avatar::getUploaded($this->scoped);
$this->elementStart('li', array('id' => 'avatar_original',
'class' => 'avatar_view'));
@@ -126,7 +116,7 @@ class AvatarsettingsAction extends SettingsAction
$this->element('img', array('src' => $original->displayUrl(),
'width' => $original->width,
'height' => $original->height,
- 'alt' => $user->nickname));
+ 'alt' => $this->scoped->getNickname()));
$this->elementEnd('div');
$this->elementEnd('li');
} catch (NoAvatarException $e) {
@@ -134,7 +124,7 @@ class AvatarsettingsAction extends SettingsAction
}
try {
- $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
+ $avatar = $this->scoped->getAvatar(AVATAR_PROFILE_SIZE);
$this->elementStart('li', array('id' => 'avatar_preview',
'class' => 'avatar_view'));
// TRANS: Header on avatar upload page for thumbnail of to be used rendition of uploaded avatar (h2).
@@ -143,7 +133,7 @@ class AvatarsettingsAction extends SettingsAction
$this->element('img', array('src' => $avatar->displayUrl(),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
- 'alt' => $user->nickname));
+ 'alt' => $this->scoped->getNickname()));
$this->elementEnd('div');
if (!empty($avatar->filename)) {
// TRANS: Button on avatar upload page to delete current avatar.
@@ -180,16 +170,6 @@ class AvatarsettingsAction extends SettingsAction
function showCropForm()
{
- $user = common_current_user();
-
- $profile = $user->getProfile();
-
- if (!$profile) {
- common_log_db_error($user, 'SELECT', __FILE__);
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- }
-
$this->elementStart('form', array('method' => 'post',
'id' => 'form_settings_avatar',
'class' => 'form_settings',
@@ -211,7 +191,7 @@ class AvatarsettingsAction extends SettingsAction
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
'height' => $this->filedata['height'],
- 'alt' => $user->nickname));
+ 'alt' => $this->scoped->getNickname()));
$this->elementEnd('div');
$this->elementEnd('li');
@@ -224,7 +204,7 @@ class AvatarsettingsAction extends SettingsAction
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
- 'alt' => $user->nickname));
+ 'alt' => $this->scoped->getNickname()));
$this->elementEnd('div');
foreach (array('avatar_crop_x', 'avatar_crop_y',
From 57d57b8d8f270d586f15d7bd45557362905c1ae3 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 01:26:34 +0100
Subject: [PATCH 076/415] Handle reuploads via filehandle better if original is
missing
---
lib/mediafile.php | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/lib/mediafile.php b/lib/mediafile.php
index 7534dc53cb..dc7000f384 100644
--- a/lib/mediafile.php
+++ b/lib/mediafile.php
@@ -286,8 +286,31 @@ class MediaFile
try {
$file = File::getByHash($filehash);
// Already have it, so let's reuse the locally stored File
- $filename = $file->filename;
+ // by using getPath we also check whether the file exists
+ // and throw a FileNotFoundException with the path if it doesn't.
+ $filename = basename($file->getPath());
$mimetype = $file->mimetype;
+ } catch (FileNotFoundException $e) {
+ // This happens if the file we have uploaded has disappeared
+ // from the local filesystem for some reason. Since we got the
+ // File object from a sha256 check in fromFilehandle, it's safe
+ // to just copy the uploaded data to disk!
+
+ fseek($fh, 0); // just to be sure, go to the beginning
+ // dump the contents of our filehandle to the path from our exception
+ // and report error if it failed.
+ if (false === file_put_contents($e->path, fread($fh, filesize($stream['uri'])))) {
+ // TRANS: Client exception thrown when a file upload operation fails because the file could
+ // TRANS: not be moved from the temporary folder to the permanent file location.
+ throw new ClientException(_('File could not be moved to destination directory.'));
+ }
+ if (!chmod($e->path, 0664)) {
+ common_log(LOG_ERR, 'Could not chmod uploaded file: '._ve($e->path));
+ }
+
+ $filename = basename($file->getPath());
+ $mimetype = $file->mimetype;
+
} catch (NoResultException $e) {
File::respectsQuota($scoped, filesize($stream['uri']));
From 204a8f1fccc3ba6da26c61e2ec095a742eef05f1 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 02:54:13 +0100
Subject: [PATCH 077/415] PEAR Mail package updated to 1.3.0
1.3.0 (stable) was released on 2016-01-31
Source: https://pear.php.net/package/Mail
---
extlib/Mail.php | 31 +++++++--------
extlib/Mail/RFC822.php | 84 ++++++++++++++--------------------------
extlib/Mail/mail.php | 12 +++---
extlib/Mail/mock.php | 19 ++++-----
extlib/Mail/null.php | 9 ++---
extlib/Mail/sendmail.php | 10 ++---
extlib/Mail/smtp.php | 43 ++++++++++----------
extlib/Mail/smtpmx.php | 10 ++---
8 files changed, 89 insertions(+), 129 deletions(-)
diff --git a/extlib/Mail.php b/extlib/Mail.php
index 75132ac2a6..e7cff2f642 100644
--- a/extlib/Mail.php
+++ b/extlib/Mail.php
@@ -1,8 +1,8 @@
* @copyright 1997-2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
@@ -50,8 +50,7 @@ require_once 'PEAR.php';
* mailers under the PEAR hierarchy, and provides supporting functions
* useful in multiple mailer backends.
*
- * @access public
- * @version $Revision: 294747 $
+ * @version $Revision$
* @package Mail
*/
class Mail
@@ -60,7 +59,7 @@ class Mail
* Line terminator used for separating header lines.
* @var string
*/
- var $sep = "\r\n";
+ public $sep = "\r\n";
/**
* Provides an interface for generating Mail:: objects of various
@@ -68,10 +67,10 @@ class Mail
*
* @param string $driver The kind of Mail:: object to instantiate.
* @param array $params The parameters to pass to the Mail:: object.
+ *
* @return object Mail a instance of the driver class or if fails a PEAR Error
- * @access public
*/
- function &factory($driver, $params = array())
+ public static function factory($driver, $params = array())
{
$driver = strtolower($driver);
@include_once 'Mail/' . $driver . '.php';
@@ -108,10 +107,9 @@ class Mail
* containing a descriptive error message on
* failure.
*
- * @access public
* @deprecated use Mail_mail::send instead
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
if (!is_array($headers)) {
return PEAR::raiseError('$headers must be an array');
@@ -147,10 +145,8 @@ class Mail
* filter is to prevent mail injection attacks.
*
* @param array $headers The associative array of headers to sanitize.
- *
- * @access private
*/
- function _sanitizeHeaders(&$headers)
+ protected function _sanitizeHeaders(&$headers)
{
foreach ($headers as $key => $value) {
$headers[$key] =
@@ -173,9 +169,8 @@ class Mail
* otherwise returns an array containing two
* elements: Any From: address found in the headers,
* and the plain text version of the headers.
- * @access private
*/
- function prepareHeaders($headers)
+ protected function prepareHeaders($headers)
{
$lines = array();
$from = null;
@@ -235,9 +230,8 @@ class Mail
*
* @return mixed An array of forward paths (bare addresses) or a PEAR_Error
* object if the address list could not be parsed.
- * @access private
*/
- function parseRecipients($recipients)
+ protected function parseRecipients($recipients)
{
include_once 'Mail/RFC822.php';
@@ -250,7 +244,8 @@ class Mail
// Parse recipients, leaving out all personal info. This is
// for smtp recipients, etc. All relevant personal information
// should already be in the headers.
- $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
+ $Mail_RFC822 = new Mail_RFC822();
+ $addresses = $Mail_RFC822->parseAddressList($recipients, 'localhost', false);
// If parseAddressList() returned a PEAR_Error object, just return it.
if (is_a($addresses, 'PEAR_Error')) {
diff --git a/extlib/Mail/RFC822.php b/extlib/Mail/RFC822.php
index 58d36465cb..d010a20e8d 100644
--- a/extlib/Mail/RFC822.php
+++ b/extlib/Mail/RFC822.php
@@ -2,7 +2,7 @@
/**
* RFC 822 Email address list validation Utility
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE:
*
@@ -40,7 +40,7 @@
* @author Chuck Hagenbuch
* @author Chuck Hagenbuch
- * @version $Revision: 294749 $
+ * @version $Revision$
* @license BSD
* @package Mail
*/
@@ -141,7 +141,6 @@ class Mail_RFC822 {
* Sets up the object. The address must either be set here or when
* calling parseAddressList(). One or the other.
*
- * @access public
* @param string $address The address(es) to validate.
* @param string $default_domain Default domain/host etc. If not supplied, will be set to localhost.
* @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
@@ -149,7 +148,7 @@ class Mail_RFC822 {
*
* @return object Mail_RFC822 A new Mail_RFC822 object.
*/
- function Mail_RFC822($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
+ public function __construct($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
{
if (isset($address)) $this->address = $address;
if (isset($default_domain)) $this->default_domain = $default_domain;
@@ -162,7 +161,6 @@ class Mail_RFC822 {
* Starts the whole process. The address must either be set here
* or when creating the object. One or the other.
*
- * @access public
* @param string $address The address(es) to validate.
* @param string $default_domain Default domain/host etc.
* @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
@@ -170,7 +168,7 @@ class Mail_RFC822 {
*
* @return array A structured array of addresses.
*/
- function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
+ public function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
{
if (!isset($this) || !isset($this->mailRFC822)) {
$obj = new Mail_RFC822($address, $default_domain, $nest_groups, $validate, $limit);
@@ -222,11 +220,10 @@ class Mail_RFC822 {
/**
* Splits an address into separate addresses.
*
- * @access private
* @param string $address The addresses to split.
* @return boolean Success or failure.
*/
- function _splitAddresses($address)
+ protected function _splitAddresses($address)
{
if (!empty($this->limit) && count($this->addresses) == $this->limit) {
return '';
@@ -298,11 +295,10 @@ class Mail_RFC822 {
/**
* Checks for a group at the start of the string.
*
- * @access private
* @param string $address The address to check.
* @return boolean Whether or not there is a group at the start of the string.
*/
- function _isGroup($address)
+ protected function _isGroup($address)
{
// First comma not in quotes, angles or escaped:
$parts = explode(',', $address);
@@ -322,12 +318,11 @@ class Mail_RFC822 {
/**
* A common function that will check an exploded string.
*
- * @access private
* @param array $parts The exloded string.
* @param string $char The char that was exploded on.
* @return mixed False if the string contains unclosed quotes/brackets, or the string on success.
*/
- function _splitCheck($parts, $char)
+ protected function _splitCheck($parts, $char)
{
$string = $parts[0];
@@ -355,12 +350,11 @@ class Mail_RFC822 {
/**
* Checks if a string has unclosed quotes or not.
*
- * @access private
* @param string $string The string to check.
* @return boolean True if there are unclosed quotes inside the string,
* false otherwise.
*/
- function _hasUnclosedQuotes($string)
+ protected function _hasUnclosedQuotes($string)
{
$string = trim($string);
$iMax = strlen($string);
@@ -392,12 +386,11 @@ class Mail_RFC822 {
* Checks if a string has an unclosed brackets or not. IMPORTANT:
* This function handles both angle brackets and square brackets;
*
- * @access private
* @param string $string The string to check.
* @param string $chars The characters to check for.
* @return boolean True if there are unclosed brackets inside the string, false otherwise.
*/
- function _hasUnclosedBrackets($string, $chars)
+ protected function _hasUnclosedBrackets($string, $chars)
{
$num_angle_start = substr_count($string, $chars[0]);
$num_angle_end = substr_count($string, $chars[1]);
@@ -416,13 +409,12 @@ class Mail_RFC822 {
/**
* Sub function that is used only by hasUnclosedBrackets().
*
- * @access private
* @param string $string The string to check.
* @param integer &$num The number of occurences.
* @param string $char The character to count.
* @return integer The number of occurences of $char in $string, adjusted for backslashes.
*/
- function _hasUnclosedBracketsSub($string, &$num, $char)
+ protected function _hasUnclosedBracketsSub($string, &$num, $char)
{
$parts = explode($char, $string);
for ($i = 0; $i < count($parts); $i++){
@@ -438,11 +430,10 @@ class Mail_RFC822 {
/**
* Function to begin checking the address.
*
- * @access private
* @param string $address The address to validate.
* @return mixed False on failure, or a structured array of address information on success.
*/
- function _validateAddress($address)
+ protected function _validateAddress($address)
{
$is_group = false;
$addresses = array();
@@ -483,14 +474,6 @@ class Mail_RFC822 {
$addresses[] = $address['address'];
}
- // Check that $addresses is set, if address like this:
- // Groupname:;
- // Then errors were appearing.
- if (!count($addresses)){
- $this->error = 'Empty group.';
- return false;
- }
-
// Trim the whitespace from all of the address strings.
array_map('trim', $addresses);
@@ -531,11 +514,10 @@ class Mail_RFC822 {
/**
* Function to validate a phrase.
*
- * @access private
* @param string $phrase The phrase to check.
* @return boolean Success or failure.
*/
- function _validatePhrase($phrase)
+ protected function _validatePhrase($phrase)
{
// Splits on one or more Tab or space.
$parts = preg_split('/[ \\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY);
@@ -572,11 +554,10 @@ class Mail_RFC822 {
* can split a list of addresses up before encoding personal names
* (umlauts, etc.), for example.
*
- * @access private
* @param string $atom The string to check.
* @return boolean Success or failure.
*/
- function _validateAtom($atom)
+ protected function _validateAtom($atom)
{
if (!$this->validate) {
// Validation has been turned off; assume the atom is okay.
@@ -605,11 +586,10 @@ class Mail_RFC822 {
* Function to validate quoted string, which is:
* quoted-string = <"> *(qtext/quoted-pair) <">
*
- * @access private
* @param string $qstring The string to check
* @return boolean Success or failure.
*/
- function _validateQuotedString($qstring)
+ protected function _validateQuotedString($qstring)
{
// Leading and trailing "
$qstring = substr($qstring, 1, -1);
@@ -623,11 +603,10 @@ class Mail_RFC822 {
* mailbox = addr-spec ; simple address
* / phrase route-addr ; name and route-addr
*
- * @access public
* @param string &$mailbox The string to check.
* @return boolean Success or failure.
*/
- function validateMailbox(&$mailbox)
+ public function validateMailbox(&$mailbox)
{
// A couple of defaults.
$phrase = '';
@@ -712,11 +691,10 @@ class Mail_RFC822 {
* Angle brackets have already been removed at the point of
* getting to this function.
*
- * @access private
* @param string $route_addr The string to check.
* @return mixed False on failure, or an array containing validated address/route information on success.
*/
- function _validateRouteAddr($route_addr)
+ protected function _validateRouteAddr($route_addr)
{
// Check for colon.
if (strpos($route_addr, ':') !== false) {
@@ -762,11 +740,10 @@ class Mail_RFC822 {
* Function to validate a route, which is:
* route = 1#("@" domain) ":"
*
- * @access private
* @param string $route The string to check.
* @return mixed False on failure, or the validated $route on success.
*/
- function _validateRoute($route)
+ protected function _validateRoute($route)
{
// Split on comma.
$domains = explode(',', trim($route));
@@ -785,11 +762,10 @@ class Mail_RFC822 {
*
* domain = sub-domain *("." sub-domain)
*
- * @access private
* @param string $domain The string to check.
* @return mixed False on failure, or the validated domain on success.
*/
- function _validateDomain($domain)
+ protected function _validateDomain($domain)
{
// Note the different use of $subdomains and $sub_domains
$subdomains = explode('.', $domain);
@@ -813,11 +789,10 @@ class Mail_RFC822 {
* Function to validate a subdomain:
* subdomain = domain-ref / domain-literal
*
- * @access private
* @param string $subdomain The string to check.
* @return boolean Success or failure.
*/
- function _validateSubdomain($subdomain)
+ protected function _validateSubdomain($subdomain)
{
if (preg_match('|^\[(.*)]$|', $subdomain, $arr)){
if (!$this->_validateDliteral($arr[1])) return false;
@@ -833,11 +808,10 @@ class Mail_RFC822 {
* Function to validate a domain literal:
* domain-literal = "[" *(dtext / quoted-pair) "]"
*
- * @access private
* @param string $dliteral The string to check.
* @return boolean Success or failure.
*/
- function _validateDliteral($dliteral)
+ protected function _validateDliteral($dliteral)
{
return !preg_match('/(.)[][\x0D\\\\]/', $dliteral, $matches) && $matches[1] != '\\';
}
@@ -847,11 +821,10 @@ class Mail_RFC822 {
*
* addr-spec = local-part "@" domain
*
- * @access private
* @param string $addr_spec The string to check.
* @return mixed False on failure, or the validated addr-spec on success.
*/
- function _validateAddrSpec($addr_spec)
+ protected function _validateAddrSpec($addr_spec)
{
$addr_spec = trim($addr_spec);
@@ -878,17 +851,16 @@ class Mail_RFC822 {
* Function to validate the local part of an address:
* local-part = word *("." word)
*
- * @access private
* @param string $local_part
* @return mixed False on failure, or the validated local part on success.
*/
- function _validateLocalPart($local_part)
+ protected function _validateLocalPart($local_part)
{
$parts = explode('.', $local_part);
$words = array();
// Split the local_part into words.
- while (count($parts) > 0){
+ while (count($parts) > 0) {
$words[] = $this->_splitCheck($parts, '.');
for ($i = 0; $i < $this->index + 1; $i++) {
array_shift($parts);
@@ -897,6 +869,10 @@ class Mail_RFC822 {
// Validate each word.
foreach ($words as $word) {
+ // word cannot be empty (#17317)
+ if ($word === '') {
+ return false;
+ }
// If this word contains an unquoted space, it is invalid. (6.2.4)
if (strpos($word, ' ') && $word[0] !== '"')
{
@@ -920,7 +896,7 @@ class Mail_RFC822 {
* @param string $data Addresses to count
* @return int Approximate count
*/
- function approximateCount($data)
+ public function approximateCount($data)
{
return count(preg_split('/(?
* @copyright 2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: mail.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
/**
* internal PHP-mail() implementation of the PEAR Mail:: interface.
* @package Mail
- * @version $Revision: 294747 $
+ * @version $Revision$
*/
class Mail_mail extends Mail {
@@ -64,7 +64,7 @@ class Mail_mail extends Mail {
*
* @param array $params Extra arguments for the mail() function.
*/
- function Mail_mail($params = null)
+ public function __construct($params = null)
{
// The other mail implementations accept parameters as arrays.
// In the interest of being consistent, explode an array into
@@ -109,10 +109,8 @@ class Mail_mail extends Mail {
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
- *
- * @access public
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
if (!is_array($headers)) {
return PEAR::raiseError('$headers must be an array');
diff --git a/extlib/Mail/mock.php b/extlib/Mail/mock.php
index 61570ba408..e3e290bdc0 100644
--- a/extlib/Mail/mock.php
+++ b/extlib/Mail/mock.php
@@ -2,7 +2,7 @@
/**
* Mock implementation
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE:
*
@@ -39,7 +39,7 @@
* @author Chuck Hagenbuch
* @copyright 2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: mock.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
@@ -47,7 +47,7 @@
* Mock implementation of the PEAR Mail:: interface for testing.
* @access public
* @package Mail
- * @version $Revision: 294747 $
+ * @version $Revision$
*/
class Mail_mock extends Mail {
@@ -55,23 +55,22 @@ class Mail_mock extends Mail {
* Array of messages that have been sent with the mock.
*
* @var array
- * @access public
*/
- var $sentMessages = array();
+ public $sentMessages = array();
/**
* Callback before sending mail.
*
* @var callback
*/
- var $_preSendCallback;
+ protected $_preSendCallback;
/**
* Callback after sending mai.
*
* @var callback
*/
- var $_postSendCallback;
+ protected $_postSendCallback;
/**
* Constructor.
@@ -82,9 +81,8 @@ class Mail_mock extends Mail {
* postSendCallback Called after an email would have been sent.
*
* @param array Hash containing any parameters.
- * @access public
*/
- function Mail_mock($params)
+ public function __construct($params)
{
if (isset($params['preSendCallback']) &&
is_callable($params['preSendCallback'])) {
@@ -120,9 +118,8 @@ class Mail_mock extends Mail {
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
- * @access public
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
if ($this->_preSendCallback) {
call_user_func_array($this->_preSendCallback,
diff --git a/extlib/Mail/null.php b/extlib/Mail/null.php
index f8d58272ee..7896a42995 100644
--- a/extlib/Mail/null.php
+++ b/extlib/Mail/null.php
@@ -2,7 +2,7 @@
/**
* Null implementation of the PEAR Mail interface
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE:
*
@@ -39,7 +39,7 @@
* @author Phil Kernick
* @copyright 2010 Phil Kernick
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: null.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
@@ -47,7 +47,7 @@
* Null implementation of the PEAR Mail:: interface.
* @access public
* @package Mail
- * @version $Revision: 294747 $
+ * @version $Revision$
*/
class Mail_null extends Mail {
@@ -74,9 +74,8 @@ class Mail_null extends Mail {
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
- * @access public
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
return true;
}
diff --git a/extlib/Mail/sendmail.php b/extlib/Mail/sendmail.php
index b056575e99..f8866bdf3d 100644
--- a/extlib/Mail/sendmail.php
+++ b/extlib/Mail/sendmail.php
@@ -1,7 +1,7 @@
sendmail_path = $params['sendmail_path'];
@@ -100,9 +99,8 @@ class Mail_sendmail extends Mail {
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
- * @access public
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
if (!is_array($headers)) {
return PEAR::raiseError('$headers must be an array');
diff --git a/extlib/Mail/smtp.php b/extlib/Mail/smtp.php
index 52ea602086..d446b1bcda 100644
--- a/extlib/Mail/smtp.php
+++ b/extlib/Mail/smtp.php
@@ -2,7 +2,7 @@
/**
* SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE:
*
@@ -40,7 +40,7 @@
* @author Chuck Hagenbuch
* @copyright 2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: smtp.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
@@ -69,7 +69,7 @@ define('PEAR_MAIL_SMTP_ERROR_DATA', 10006);
* SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
* @access public
* @package Mail
- * @version $Revision: 294747 $
+ * @version $Revision$
*/
class Mail_smtp extends Mail {
@@ -162,6 +162,8 @@ class Mail_smtp extends Mail {
* @var bool
*/
var $pipelining;
+
+ var $socket_options = array();
/**
* Constructor.
@@ -186,9 +188,8 @@ class Mail_smtp extends Mail {
*
* @param array Hash containing any parameters different from the
* defaults.
- * @access public
*/
- function Mail_smtp($params)
+ public function __construct($params)
{
if (isset($params['host'])) $this->host = $params['host'];
if (isset($params['port'])) $this->port = $params['port'];
@@ -200,20 +201,18 @@ class Mail_smtp extends Mail {
if (isset($params['debug'])) $this->debug = (bool)$params['debug'];
if (isset($params['persist'])) $this->persist = (bool)$params['persist'];
if (isset($params['pipelining'])) $this->pipelining = (bool)$params['pipelining'];
-
+ if (isset($params['socket_options'])) $this->socket_options = $params['socket_options'];
// Deprecated options
if (isset($params['verp'])) {
$this->addServiceExtensionParameter('XVERP', is_bool($params['verp']) ? null : $params['verp']);
}
-
- register_shutdown_function(array(&$this, '_Mail_smtp'));
}
/**
* Destructor implementation to ensure that we disconnect from any
* potentially-alive persistent SMTP connections.
*/
- function _Mail_smtp()
+ public function __destruct()
{
$this->disconnect();
}
@@ -240,12 +239,11 @@ class Mail_smtp extends Mail {
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
- * @access public
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
/* If we don't already have an SMTP object, create one. */
- $result = &$this->getSMTPObject();
+ $result = $this->getSMTPObject();
if (PEAR::isError($result)) {
return $result;
}
@@ -304,7 +302,7 @@ class Mail_smtp extends Mail {
}
/* Send the message's headers and the body as SMTP data. */
- $res = $this->_smtp->data($textHeaders . "\r\n\r\n" . $body);
+ $res = $this->_smtp->data($body, $textHeaders);
list(,$args) = $this->_smtp->getResponse();
if (preg_match("/Ok: queued as (.*)/", $args, $queued)) {
@@ -337,18 +335,20 @@ class Mail_smtp extends Mail {
* failure.
*
* @since 1.2.0
- * @access public
*/
- function &getSMTPObject()
+ public function getSMTPObject()
{
if (is_object($this->_smtp) !== false) {
return $this->_smtp;
}
include_once 'Net/SMTP.php';
- $this->_smtp = &new Net_SMTP($this->host,
+ $this->_smtp = new Net_SMTP($this->host,
$this->port,
- $this->localhost);
+ $this->localhost,
+ $this->pipelining,
+ 0,
+ $this->socket_options);
/* If we still don't have an SMTP object at this point, fail. */
if (is_object($this->_smtp) === false) {
@@ -393,9 +393,8 @@ class Mail_smtp extends Mail {
* @param string Any value the keyword needs.
*
* @since 1.2.0
- * @access public
*/
- function addServiceExtensionParameter($keyword, $value = null)
+ public function addServiceExtensionParameter($keyword, $value = null)
{
$this->_extparams[$keyword] = $value;
}
@@ -406,9 +405,8 @@ class Mail_smtp extends Mail {
* @return boolean True if the SMTP connection no longer exists.
*
* @since 1.1.9
- * @access public
*/
- function disconnect()
+ public function disconnect()
{
/* If we have an SMTP object, disconnect and destroy it. */
if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
@@ -428,9 +426,8 @@ class Mail_smtp extends Mail {
* @return string A string describing the current SMTP error.
*
* @since 1.1.7
- * @access private
*/
- function _error($text, &$error)
+ protected function _error($text, $error)
{
/* Split the SMTP response into a code and a response string. */
list($code, $response) = $this->_smtp->getResponse();
diff --git a/extlib/Mail/smtpmx.php b/extlib/Mail/smtpmx.php
index f0b6940868..6eb8bec2ec 100644
--- a/extlib/Mail/smtpmx.php
+++ b/extlib/Mail/smtpmx.php
@@ -1,4 +1,4 @@
-
* @copyright 2010 gERD Schaufelberger
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: smtpmx.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
@@ -56,7 +56,7 @@ require_once 'Net/SMTP.php';
* @access public
* @author gERD Schaufelberger
* @package Mail
- * @version $Revision: 294747 $
+ * @version $Revision$
*/
class Mail_smtpmx extends Mail {
@@ -386,7 +386,7 @@ class Mail_smtpmx extends Mail {
}
// Send data
- $res = $this->_smtp->data("$textHeaders\r\n$body");
+ $res = $this->_smtp->data($body, $textHeaders);
if (is_a($res, 'PEAR_Error')) {
$info = array('rcpt' => $rcpt);
return $this->_raiseError('failed_send_data', $info);
From 1db02d7f367f47703d53f0d730a49f397305961e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 11:59:46 +0100
Subject: [PATCH 078/415] filename_base option isn't optimal
For different "download filenames" we should use some other method.
---
lib/default.php | 1 -
lib/mediafile.php | 44 ++++++++++++++------------------------------
2 files changed, 14 insertions(+), 31 deletions(-)
diff --git a/lib/default.php b/lib/default.php
index 0fa8ce1678..d8b291b344 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -263,7 +263,6 @@ $default =
'user_quota' => 50000000,
'monthly_quota' => 15000000,
'uploads' => true,
- 'filename_base' => 'hash', // for new files, choose one: 'upload', 'hash'
'show_html' => false, // show (filtered) text/html attachments (and oEmbed HTML etc.). Doesn't affect AJAX calls.
'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info
'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages.
diff --git a/lib/mediafile.php b/lib/mediafile.php
index dc7000f384..be97b1cc17 100644
--- a/lib/mediafile.php
+++ b/lib/mediafile.php
@@ -42,10 +42,8 @@ class MediaFile
var $short_fileurl = null;
var $mimetype = null;
- function __construct(Profile $scoped, $filename = null, $mimetype = null, $filehash = null)
+ function __construct($filename = null, $mimetype = null, $filehash = null)
{
- $this->scoped = $scoped;
-
$this->filename = $filename;
$this->mimetype = $mimetype;
$this->filehash = $filehash;
@@ -189,10 +187,6 @@ class MediaFile
static function fromUpload($param='media', Profile $scoped=null)
{
- if (is_null($scoped)) {
- $scoped = Profile::current();
- }
-
// The existence of the "error" element means PHP has processed it properly even if it was ok.
if (!isset($_FILES[$param]) || !isset($_FILES[$param]['error'])) {
throw new NoUploadedMediaException($param);
@@ -248,21 +242,16 @@ class MediaFile
} catch (NoResultException $e) {
// We have to save the upload as a new local file. This is the normal course of action.
- // Throws exception if additional size does not respect quota
- // This test is only needed, of course, if we're uploading something new.
- File::respectsQuota($scoped, $_FILES[$param]['size']);
+ if ($scoped instanceof Profile) {
+ // Throws exception if additional size does not respect quota
+ // This test is only needed, of course, if we're uploading something new.
+ File::respectsQuota($scoped, $_FILES[$param]['size']);
+ }
$mimetype = self::getUploadedMimeType($_FILES[$param]['tmp_name'], $_FILES[$param]['name']);
$basename = basename($_FILES[$param]['name']);
- switch (common_config('attachments', 'filename_base')) {
- case 'upload':
- $filename = File::filename($scoped, $basename, $mimetype);
- break;
- case 'hash':
- default:
- $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype, $basename);
- }
+ $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype, $basename);
$filepath = File::path($filename);
$result = move_uploaded_file($_FILES[$param]['tmp_name'], $filepath);
@@ -274,10 +263,10 @@ class MediaFile
}
}
- return new MediaFile($scoped, $filename, $mimetype, $filehash);
+ return new MediaFile($filename, $mimetype, $filehash);
}
- static function fromFilehandle($fh, Profile $scoped) {
+ static function fromFilehandle($fh, Profile $scoped=null) {
$stream = stream_get_meta_data($fh);
// So far we're only handling filehandles originating from tmpfile(),
// so we can always do hash_file on $stream['uri'] as far as I can tell!
@@ -312,18 +301,13 @@ class MediaFile
$mimetype = $file->mimetype;
} catch (NoResultException $e) {
- File::respectsQuota($scoped, filesize($stream['uri']));
+ if ($scoped instanceof Profile) {
+ File::respectsQuota($scoped, filesize($stream['uri']));
+ }
$mimetype = self::getUploadedMimeType($stream['uri']);
- switch (common_config('attachments', 'filename_base')) {
- case 'upload':
- $filename = File::filename($scoped, "email", $mimetype);
- break;
- case 'hash':
- default:
- $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype);
- }
+ $filename = strtolower($filehash) . '.' . File::guessMimeExtension($mimetype);
$filepath = File::path($filename);
$result = copy($stream['uri'], $filepath) && chmod($filepath, 0664);
@@ -336,7 +320,7 @@ class MediaFile
}
}
- return new MediaFile($scoped, $filename, $mimetype, $filehash);
+ return new MediaFile($filename, $mimetype, $filehash);
}
/**
From 7ca0ff9a19d1d87dadc836659aa1c02e6e7c375c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 12:05:12 +0100
Subject: [PATCH 079/415] MediaFile::fromUpload handles missing local file
better
---
lib/mediafile.php | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lib/mediafile.php b/lib/mediafile.php
index be97b1cc17..54d00b4acf 100644
--- a/lib/mediafile.php
+++ b/lib/mediafile.php
@@ -34,8 +34,6 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class MediaFile
{
- protected $scoped = null;
-
var $filename = null;
var $fileRecord = null;
var $fileurl = null;
@@ -236,7 +234,20 @@ class MediaFile
try {
$file = File::getByHash($filehash);
// If no exception is thrown the file exists locally, so we'll use that and just add redirections.
- $filename = $file->filename;
+ // but if the _actual_ locally stored file doesn't exist, getPath will throw FileNotFoundException
+ $filename = basename($file->getPath());
+ $mimetype = $file->mimetype;
+
+ } catch (FileNotFoundException $e) {
+ // The file does not exist in our local filesystem, so store this upload.
+
+ if (!move_uploaded_file($_FILES[$param]['tmp_name'], $e->path)) {
+ // TRANS: Client exception thrown when a file upload operation fails because the file could
+ // TRANS: not be moved from the temporary folder to the permanent file location.
+ throw new ClientException(_('File could not be moved to destination directory.'));
+ }
+
+ $filename = basename($file->getPath());
$mimetype = $file->mimetype;
} catch (NoResultException $e) {
From 97ac722b248640e9d10053fecb9e2eb9354f5378 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sat, 5 Mar 2016 12:42:27 +0100
Subject: [PATCH 080/415] Accessibility navigation improvement
---
lib/inlineattachmentlist.php | 2 +-
theme/base/css/display.css | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/inlineattachmentlist.php b/lib/inlineattachmentlist.php
index 40ec114ad8..8b055a9cfc 100644
--- a/lib/inlineattachmentlist.php
+++ b/lib/inlineattachmentlist.php
@@ -33,7 +33,7 @@ class InlineAttachmentList extends AttachmentList
{
function showListStart()
{
- $this->out->element('h3', 'attachments-title', _('Attachments'));
+ $this->out->element('h4', 'attachments-title', _('Attachments'));
parent::showListStart();
}
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 73c95c277a..8f059faadb 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -1476,7 +1476,7 @@ margin-left:0;
margin-left: 56px;
}
-.notice > footer > h3 {
+.notice > footer .attachments-title {
margin-bottom: 0;
margin-top: 1em;
}
From e9516ea4dda8c2425ad0ec13a838ceb5bd8f5d3f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 03:39:02 +0100
Subject: [PATCH 081/415] Allow gopher: scheme in link href
---
.../lib/htmlpurifier/urischeme/gopher.php | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php
diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php
new file mode 100644
index 0000000000..735ea6217d
--- /dev/null
+++ b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php
@@ -0,0 +1,36 @@
+userinfo = null;
+ return true;
+ }
+}
+
+// vim: et sw=4 sts=4
From 47ae21c08e3fa49a0f7049a399a7d5d335cd77f3 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 16:45:29 +0100
Subject: [PATCH 082/415] Don't resend confirm_address if profile is silenced
---
scripts/resend_confirm_address.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/resend_confirm_address.php b/scripts/resend_confirm_address.php
index 1d7cb55ca5..1e5bcc1555 100755
--- a/scripts/resend_confirm_address.php
+++ b/scripts/resend_confirm_address.php
@@ -64,6 +64,11 @@ function mailConfirmAddress(Confirm_address $ca)
{
try {
$user = User::getByID($ca->user_id);
+ $profile = $user->getProfile();
+ if ($profile->isSilenced()) {
+ $ca->delete();
+ return;
+ }
if ($user->email === $ca->address) {
throw new AlreadyFulfilledException('User already has identical confirmed email address.');
}
From 6ec72b29781d30c473d7d8ed69782eec92ebddad Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 17:27:40 +0100
Subject: [PATCH 083/415] Move mail_confirm_address out of mail.php
---
actions/emailsettings.php | 3 +-
classes/Confirm_address.php | 87 ++++++++++++++++++-
classes/User.php | 3 +-
lib/mail.php | 41 +--------
.../EmailRegistrationPlugin.php | 6 +-
.../scripts/cancelemailregistration.php | 8 +-
.../scripts/registerbyemail.php | 6 +-
7 files changed, 94 insertions(+), 60 deletions(-)
diff --git a/actions/emailsettings.php b/actions/emailsettings.php
index 7384b3630d..b5933fdb65 100644
--- a/actions/emailsettings.php
+++ b/actions/emailsettings.php
@@ -369,8 +369,7 @@ class EmailsettingsAction extends SettingsAction
throw new ServerException(_('Could not insert confirmation code.'));
}
- common_debug('Sending confirmation address for user '.$user->getID().' to email '.$email);
- mail_confirm_address($user, $confirm->code, $user->getNickname(), $email);
+ $confirm->sendConfirmation();
Event::handle('EndAddEmailAddress', array($user, $email));
}
diff --git a/classes/Confirm_address.php b/classes/Confirm_address.php
index 9bb56cef9c..f8b5b21124 100644
--- a/classes/Confirm_address.php
+++ b/classes/Confirm_address.php
@@ -35,18 +35,18 @@ class Confirm_address extends Managed_DataObject
);
}
- static function getAddress($address, $addressType)
+ static function getByAddress($address, $addressType)
{
$ca = new Confirm_address();
$ca->address = $address;
$ca->address_type = $addressType;
- if ($ca->find(true)) {
- return $ca;
+ if (!$ca->find(true)) {
+ throw new NoResultException($ca);
}
- return null;
+ return $ca;
}
static function saveNew($user, $address, $addressType, $extra=null)
@@ -67,6 +67,85 @@ class Confirm_address extends Managed_DataObject
return $ca;
}
+ public function getAddress()
+ {
+ return $this->address;
+ }
+
+ public function getAddressType()
+ {
+ return $this->address_type;
+ }
+
+ public function getCode()
+ {
+ return $this->code;
+ }
+
+ public function getProfile()
+ {
+ return Profile::getByID($this->user_id);
+ }
+
+ public function getUrl()
+ {
+ return common_local_url('confirmaddress', array('code' => $this->code));
+ }
+
+ /**
+ * Supply arguments in $args. Currently known args:
+ * headers Array with headers (only used for email)
+ * nickname How we great the user (defaults to nickname, but can be any string)
+ * sitename Name we sign the email with (defaults to sitename, but can be any string)
+ * url The confirmation address URL.
+ */
+ public function sendConfirmation(array $args=array())
+ {
+ common_debug('Sending confirmation URL for user '._ve($this->user_id).' using '._ve($this->address_type));
+
+ $defaults = [
+ 'headers' => array(),
+ 'nickname' => $this->getProfile()->getNickname(),
+ 'sitename' => common_config('site', 'name'),
+ 'url' => $this->getUrl(),
+ ];
+ foreach (array_keys($defaults) as $key) {
+ if (!isset($args[$key])) {
+ $args[$key] = $defaults[$key];
+ }
+ }
+
+ switch ($this->getAddressType()) {
+ case 'email':
+ $this->sendEmailConfirmation($args);
+ break;
+ default:
+ throw ServerException('Unable to handle confirm_address address type: '._ve($this->address_type));
+ }
+ }
+
+ public function sendEmailConfirmation(array $args=array())
+ {
+ // TRANS: Subject for address confirmation email.
+ $subject = _('Email address confirmation');
+
+ // TRANS: Body for address confirmation email.
+ // TRANS: %1$s is the addressed user's nickname, %2$s is the StatusNet sitename,
+ // TRANS: %3$s is the URL to confirm at.
+ $body = sprintf(_("Hey, %1\$s.\n\n".
+ "Someone just entered this email address on %2\$s.\n\n" .
+ "If it was you, and you want to confirm your entry, ".
+ "use the URL below:\n\n\t%3\$s\n\n" .
+ "If not, just ignore this message.\n\n".
+ "Thanks for your time, \n%2\$s\n"),
+ $args['nickname'],
+ $args['sitename'],
+ $args['url']);
+
+ require_once(INSTALLDIR . '/lib/mail.php');
+ return mail_to_user($this->getProfile()->getUser(), $subject, $body, $args['headers'], $this->getAddress());
+ }
+
public function delete($useWhere=false)
{
$result = parent::delete($useWhere);
diff --git a/classes/User.php b/classes/User.php
index 26225916f1..c9c61d3aed 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -384,8 +384,7 @@ class User extends Managed_DataObject
if (!empty($email) && empty($user->email)) {
try {
- require_once(INSTALLDIR . '/lib/mail.php');
- mail_confirm_address($user, $confirm->code, $profile->getNickname(), $email);
+ $confirm->sendConfirmation();
} catch (EmailException $e) {
common_log(LOG_ERR, "Could not send user registration email for user id=={$profile->getID()}: {$e->getMessage()}");
if (!$accept_email_fail) {
diff --git a/lib/mail.php b/lib/mail.php
index 42a756ac5d..428f876383 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -144,7 +144,7 @@ function mail_notify_from()
*
* @return boolean success flag
*/
-function mail_to_user(&$user, $subject, $body, $headers=array(), $address=null)
+function mail_to_user($user, $subject, $body, $headers=array(), $address=null)
{
if (!$address) {
$address = $user->email;
@@ -161,45 +161,6 @@ function mail_to_user(&$user, $subject, $body, $headers=array(), $address=null)
return mail_send($recipients, $headers, $body);
}
-/**
- * Send an email to confirm a user's control of an email address
- *
- * @param User $user User claiming the email address
- * @param string $code Confirmation code
- * @param string $nickname Nickname of user
- * @param string $address email address to confirm
- *
- * @see common_confirmation_code()
- *
- * @return success flag
- */
-function mail_confirm_address($user, $code, $nickname, $address, $url=null)
-{
- if (empty($url)) {
- $url = common_local_url('confirmaddress', array('code' => $code));
- }
-
- // TRANS: Subject for address confirmation email.
- $subject = _('Email address confirmation');
-
- // TRANS: Body for address confirmation email.
- // TRANS: %1$s is the addressed user's nickname, %2$s is the StatusNet sitename,
- // TRANS: %3$s is the URL to confirm at.
- $body = sprintf(_("Hey, %1\$s.\n\n".
- "Someone just entered this email address on %2\$s.\n\n" .
- "If it was you, and you want to confirm your entry, ".
- "use the URL below:\n\n\t%3\$s\n\n" .
- "If not, just ignore this message.\n\n".
- "Thanks for your time, \n%2\$s\n"),
- $nickname,
- common_config('site', 'name'),
- $url);
-
- $headers = array();
-
- return mail_to_user($user, $subject, $body, $headers, $address);
-}
-
/**
* notify a user of subscription by another user
*
diff --git a/plugins/EmailRegistration/EmailRegistrationPlugin.php b/plugins/EmailRegistration/EmailRegistrationPlugin.php
index 56e022435e..378cb6acd1 100644
--- a/plugins/EmailRegistration/EmailRegistrationPlugin.php
+++ b/plugins/EmailRegistration/EmailRegistrationPlugin.php
@@ -106,9 +106,9 @@ class EmailRegistrationPlugin extends Plugin
throw new ClientException(_m('Not a valid email address.'));
}
- $confirm = Confirm_address::getAddress($email, self::CONFIRMTYPE);
-
- if (empty($confirm)) {
+ try {
+ $confirm = Confirm_address::getByAddress($email, self::CONFIRMTYPE);
+ } catch (NoResultException $e) {
$confirm = Confirm_address::saveNew(null, $email, 'register');
}
diff --git a/plugins/EmailRegistration/scripts/cancelemailregistration.php b/plugins/EmailRegistration/scripts/cancelemailregistration.php
index d834aade60..b926ed9a62 100755
--- a/plugins/EmailRegistration/scripts/cancelemailregistration.php
+++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php
@@ -41,15 +41,15 @@ if (count($args) == 0) {
$email = $args[0];
-$confirm = Confirm_address::getAddress($email, EmailRegistrationPlugin::CONFIRMTYPE);
+try {
+ $confirm = Confirm_address::getByAddress($email, EmailRegistrationPlugin::CONFIRMTYPE);
-if (!empty($confirm)) {
if (have_option('d', 'dryrun')) {
print "[Dry run mode] Deleted confirmation code {$confirm->code} for {$confirm->address}.\n";
} else {
$confirm->delete();
print "Deleted confirmation code {$confirm->code} for {$confirm->address}.\n";
}
-} else {
- print "Couldn't find an email registration code for {$email}.\n";
+} catch (NoResultException $e) {
+ print "Exception thrown for {$email}: {$e->getMessage()}";
}
diff --git a/plugins/RequireValidatedEmail/scripts/registerbyemail.php b/plugins/RequireValidatedEmail/scripts/registerbyemail.php
index 4d2000ab0f..c7b4a2af9e 100755
--- a/plugins/RequireValidatedEmail/scripts/registerbyemail.php
+++ b/plugins/RequireValidatedEmail/scripts/registerbyemail.php
@@ -73,8 +73,4 @@ $url = common_local_url('confirmfirstemail',
print "$url\n";
-mail_confirm_address($user,
- $confirm->code,
- $user->nickname,
- $email,
- $url);
+$confirm->sendConfirmation(['url'=>$url]);
From 158b323767e4f5bc87281e027f289b76354a8840 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 17:31:40 +0100
Subject: [PATCH 084/415] Declare AdminpanelAction::canAdmin as static, since
that's how it's used.
---
lib/adminpanelaction.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/adminpanelaction.php b/lib/adminpanelaction.php
index 2ac92cb5c6..a7cb9fc722 100644
--- a/lib/adminpanelaction.php
+++ b/lib/adminpanelaction.php
@@ -246,7 +246,7 @@ class AdminPanelAction extends Action
$this->clientError(_('saveSettings() not implemented.'));
}
- function canAdmin($name)
+ static function canAdmin($name)
{
$isOK = false;
From d9538183bdb7f5d9a1c7c8a35cebd064b976c55c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 17:47:35 +0100
Subject: [PATCH 085/415] Use information about activityschema public mention
for Notice scope
---
classes/Notice.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 7484897679..67336bd3dc 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -931,7 +931,14 @@ class Notice extends Managed_DataObject
$act->context = new ActivityContext();
}
- $stored->scope = self::figureOutScope($actor, $groups, $scope);
+ if (array_key_exists('http://activityschema.org/collection/public', $act->context->attention)) {
+ common_debug('URI "http://activityschema.org/collection/public" was in notice attention, so we scope this public.');
+ $stored->scope = Notice::PUBLIC_SCOPE;
+ // TODO: maybe we should actually keep this? if the saveAttentions thing wants to use it...
+ unset($act->context->attention['http://activityschema.org/collection/public']);
+ } else {
+ $stored->scope = self::figureOutScope($actor, $groups, $scope);
+ }
foreach ($act->categories as $cat) {
if ($cat->term) {
From a0336ce48b6aa73f4b74a9f2760c01551c083ecd Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 6 Mar 2016 18:15:36 +0100
Subject: [PATCH 086/415] Unnecessary debug output
---
classes/Notice.php | 5 -----
1 file changed, 5 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index 67336bd3dc..ad589d786b 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -308,7 +308,6 @@ class Notice extends Managed_DataObject
// let's generate a valid link to our locally available notice on demand
return common_local_url('shownotice', array('notice' => $this->getID()), null, null, false);
default:
- common_debug('No URL available for notice: id='.$this->getID());
throw new InvalidUrlException($this->url);
}
}
@@ -521,9 +520,6 @@ class Notice extends Managed_DataObject
if (!$notice->isLocal()) {
// Only do these checks for non-local notices. Local notices will generate these values later.
- if (!common_valid_http_url($url)) {
- common_debug('Bad notice URL: ['.$url.'], URI: ['.$uri.']. Cannot link back to original! This is normal for shared notices etc.');
- }
if (empty($uri)) {
throw new ServerException('No URI for remote notice. Cannot accept that.');
}
@@ -932,7 +928,6 @@ class Notice extends Managed_DataObject
}
if (array_key_exists('http://activityschema.org/collection/public', $act->context->attention)) {
- common_debug('URI "http://activityschema.org/collection/public" was in notice attention, so we scope this public.');
$stored->scope = Notice::PUBLIC_SCOPE;
// TODO: maybe we should actually keep this? if the saveAttentions thing wants to use it...
unset($act->context->attention['http://activityschema.org/collection/public']);
From 41b64cb8a3ee58cf671b70fa6d54ced8ed452ce4 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 20:09:15 +0100
Subject: [PATCH 087/415] static function declaration
---
plugins/Favorite/classes/Fave.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/Favorite/classes/Fave.php b/plugins/Favorite/classes/Fave.php
index 864a0fc37b..7dad591181 100644
--- a/plugins/Favorite/classes/Fave.php
+++ b/plugins/Favorite/classes/Fave.php
@@ -79,7 +79,7 @@ class Fave extends Managed_DataObject
return $stored;
}
- public function removeEntry(Profile $actor, Notice $target)
+ static function removeEntry(Profile $actor, Notice $target)
{
$fave = new Fave();
$fave->user_id = $actor->getID();
From a3b265a4777e6cb217fd842e137d1b3028c7f0f8 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 20:13:07 +0100
Subject: [PATCH 088/415] Portability for filepath in File
---
classes/File.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index d6dd78cbef..20e1bc8344 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -347,8 +347,8 @@ class File extends Managed_DataObject
}
$dir = common_config('attachments', 'dir');
- if ($dir[strlen($dir)-1] != '/') {
- $dir .= '/';
+ if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
+ $dir .= DIRECTORY_SEPARATOR;
}
return $dir . $filename;
From 265fa12917132631e44dea63a70d750222867344 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 22:33:34 +0100
Subject: [PATCH 089/415] Relatively experimental change to store thumbnails in
'file/thumb/' (by default)
---
actions/attachment.php | 2 +-
actions/attachment_thumbnail.php | 2 +-
classes/File.php | 2 +-
classes/File_thumbnail.php | 81 +++++++++++++++++++++++++++-----
lib/attachmentlistitem.php | 6 +--
lib/default.php | 11 +++--
lib/gnusocial.php | 22 ++++++++-
lib/imagefile.php | 21 +++++++--
plugins/Oembed/OembedPlugin.php | 2 +-
9 files changed, 118 insertions(+), 31 deletions(-)
diff --git a/actions/attachment.php b/actions/attachment.php
index 1126759832..3ec837a511 100644
--- a/actions/attachment.php
+++ b/actions/attachment.php
@@ -96,7 +96,7 @@ class AttachmentAction extends ManagedAction
{
if (empty($this->attachment->filename)) {
// if it's not a local file, gtfo
- common_redirect($this->attachment->url, 303);
+ common_redirect($this->attachment->getUrl(), 303);
}
parent::showPage();
diff --git a/actions/attachment_thumbnail.php b/actions/attachment_thumbnail.php
index 3b8eec3ca6..cc1b0f09c6 100644
--- a/actions/attachment_thumbnail.php
+++ b/actions/attachment_thumbnail.php
@@ -62,6 +62,6 @@ class Attachment_thumbnailAction extends AttachmentAction
common_redirect($e->file->getUrl(), 302);
}
- common_redirect(File_thumbnail::url($thumbnail->filename), 302);
+ common_redirect(File_thumbnail::url($thumbnail->getFilename()), 302);
}
}
diff --git a/classes/File.php b/classes/File.php
index 20e1bc8344..a1a2f78906 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -500,7 +500,7 @@ class File extends Managed_DataObject
{
if ($prefer_local && !empty($this->filename)) {
// A locally stored file, so let's generate a URL for our instance.
- return self::url($this->filename);
+ return self::url($this->getFilename());
}
// No local filename available, return the URL we have stored
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index e028409f0f..925a3b2429 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -129,23 +129,76 @@ class File_thumbnail extends Managed_DataObject
static function path($filename)
{
- // TODO: Store thumbnails in their own directory and don't use File::path here
- return File::path($filename);
+ if (!File::validFilename($filename)) {
+ // TRANS: Client exception thrown if a file upload does not have a valid name.
+ throw new ClientException(_('Invalid filename.'));
+ }
+
+ $dir = common_config('thumbnail', 'dir') ?: File::path('thumb');
+
+ if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
+ $dir .= DIRECTORY_SEPARATOR;
+ }
+
+ return $dir . $filename;
}
static function url($filename)
{
- // TODO: Store thumbnails in their own directory and don't use File::url here
- return File::url($filename);
+ if (!File::validFilename($filename)) {
+ // TRANS: Client exception thrown if a file upload does not have a valid name.
+ throw new ClientException(_('Invalid filename.'));
+ }
+
+ // FIXME: private site thumbnails?
+
+ $path = common_config('thumbnail', 'path');
+ if (empty($path)) {
+ return File::url('thumb')."/{$filename}";
+ }
+
+ $protocol = (GNUsocial::useHTTPS() ? 'https' : 'http');
+ $server = common_config('thumbnail', 'server') ?: common_config('site', 'server');
+
+ if ($path[mb_strlen($path)-1] != '/') {
+ $path .= '/';
+ }
+ if ($path[0] != '/') {
+ $path = '/'.$path;
+ }
+
+ return $protocol.'://'.$server.$path.$filename;
+ }
+
+ public function getFilename()
+ {
+ if (!File::validFilename($this->filename)) {
+ // TRANS: Client exception thrown if a file upload does not have a valid name.
+ throw new ClientException(_("Invalid filename."));
+ }
+ return $this->filename;
}
public function getPath()
{
- $filepath = self::path($this->filename);
- if (!file_exists($filepath)) {
- throw new FileNotFoundException($filepath);
+ $oldpath = File::path($this->getFilename());
+ $thumbpath = self::path($this->getFilename());
+
+ // If we have a file in our old thumbnail storage path, move it to the new one
+ if (file_exists($oldpath) && !file_exists($thumbpath)) {
+ if ($this->getFilename() === $this->getFile()->filename) {
+ // special case where thumbnail file exactly matches stored File
+ common_debug('File filename and File_thumbnail filename match on '.$this->file_id);
+ } elseif (!rename($oldpath, $thumbpath)) {
+ common_log(LOG_ERR, 'Could not move thumbnail from '._ve($oldpath).' to '._ve($thumbpath));
+ throw new ServerException('Could not move thumbnail from old path to new path.');
+ } else {
+ common_log(LOG_DEBUG, 'Moved thumbnail '.$this->file_id.' from '._ve($oldpath).' to '._ve($thumbpath));
+ }
+ } elseif (!file_exists($thumbpath)) {
+ throw new FileNotFoundException($thumbpath);
}
- return $filepath;
+ return $thumbpath;
}
public function getUrl()
@@ -188,10 +241,14 @@ class File_thumbnail extends Managed_DataObject
public function delete($useWhere=false)
{
- if (!empty($this->filename) && file_exists(File_thumbnail::path($this->filename))) {
- $deleted = @unlink(self::path($this->filename));
- if (!$deleted) {
- common_log(LOG_ERR, sprintf('Could not unlink existing file: "%s"', self::path($this->filename)));
+ if (!empty($this->filename)) {
+ try {
+ $deleted = @unlink($this->getPath());
+ if (!$deleted) {
+ common_log(LOG_ERR, 'Could not unlink existing thumbnail file: '._ve($this->getPath()));
+ }
+ } catch (FileNotFoundException $e) {
+ common_log(LOG_INFO, 'Thumbnail already gone from '._ve($e->path));
}
}
diff --git a/lib/attachmentlistitem.php b/lib/attachmentlistitem.php
index e6163ecc92..6ee3c7087b 100644
--- a/lib/attachmentlistitem.php
+++ b/lib/attachmentlistitem.php
@@ -204,11 +204,7 @@ class AttachmentListItem extends Widget
*/
protected function scrubHtmlFile(File $attachment)
{
- $path = File::path($attachment->filename);
- if (!file_exists($path) || !is_readable($path)) {
- common_log(LOG_ERR, "Missing local HTML attachment $path");
- return false;
- }
+ $path = $attachment->getPath();
$raw = file_get_contents($path);
// Normalize...
diff --git a/lib/default.php b/lib/default.php
index d8b291b344..bf2d37d773 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -271,13 +271,18 @@ $default =
'exe' => false, // this would deny any uploads to keep the "exe" file extension
],
),
- 'thumbnail' =>
- array('crop' => false, // overridden to true if thumb height === null
+ 'thumbnail' => [
+ 'dir' => null, // falls back to File::path('thumb') (equivalent to ['attachments']['dir'] . '/thumb/')
+ 'path' => null, // falls back to generating a URL with File::url('thumb/$filename') (equivalent to ['attachments']['path'] . '/thumb/')
+ 'server' => null, // Only used if ['thumbnail']['path'] is NOT empty, and then it falls back to ['site']['server'], schema is decided from GNUsocial::useHTTPS()
+
+ 'crop' => false, // overridden to true if thumb height === null
'maxsize' => 1000, // thumbs with an edge larger than this will not be generated
'width' => 450,
'height' => 600,
'upscale' => false,
- 'animated' => false), // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin
+ 'animated' => false, // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin
+ ],
'application' =>
array('desclimit' => null),
'group' =>
diff --git a/lib/gnusocial.php b/lib/gnusocial.php
index aecebe2556..f07d2c2446 100644
--- a/lib/gnusocial.php
+++ b/lib/gnusocial.php
@@ -429,10 +429,28 @@ class GNUsocial
*/
static function verifyLoadedConfig()
{
+ $mkdirs = [];
+
if (common_config('htmlpurifier', 'Cache.DefinitionImpl') === 'Serializer'
&& !is_dir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
- if (!mkdir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
- throw new ConfigException('Could not create HTMLPurifier cache dir: '._ve(common_config('htmlpurifier', 'Cache.SerializerPath')));
+ $mkdirs[common_config('htmlpurifier', 'Cache.SerializerPath')] = 'HTMLPurifier Serializer cache';
+ }
+
+ // go through our configurable storage directories
+ foreach (['attachments', 'thumbnail'] as $dirtype) {
+ $dir = common_config($dirtype, 'dir');
+ if (!empty($dir) && !is_dir($dir)) {
+ $mkdirs[$dir] = $dirtype;
+ }
+ }
+
+ // try to create those that are not directories
+ foreach ($mkdirs as $dir=>$description) {
+ if (is_file($dir)) {
+ throw new ConfigException('Expected directory for '._ve($description).' is a file!');
+ }
+ if (!mkdir($dir)) {
+ throw new ConfigException('Could not create directory for '._ve($description).': '._ve($dir));
}
}
diff --git a/lib/imagefile.php b/lib/imagefile.php
index 9f870ae290..c707208af6 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -153,8 +153,14 @@ class ImageFile
$image = new ImageFile($file->getID(), $imgPath);
} catch (UnsupportedMediaException $e) {
// Avoid deleting the original
- if ($imgPath != $file->getPath()) {
- unlink($imgPath);
+ try {
+ if ($imgPath !== $file->getPath()) {
+ @unlink($imgPath);
+ }
+ } catch (FileNotFoundException $e) {
+ // File reported (via getPath) that the original file
+ // doesn't exist anyway, so it's safe to delete $imgPath
+ @unlink($imgPath);
}
throw $e;
}
@@ -607,10 +613,15 @@ class ImageFile
// Perform resize and store into file
$this->resizeTo($outpath, $box);
- // Avoid deleting the original
- if ($this->getPath() != File_thumbnail::path($this->filename)) {
- $this->unlink();
+ try {
+ // Avoid deleting the original
+ if (!in_array($this->getPath(), [File::path($this->filename), File_thumbnail::path($this->filename)])) {
+ $this->unlink();
+ }
+ } catch (FileNotFoundException $e) {
+ // $this->getPath() says the file doesn't exist anyway, so no point in trying to delete it!
}
+
return File_thumbnail::saveThumbnail($this->fileRecord->getID(),
null, // no url since we generated it ourselves and can dynamically generate the url
$width, $height,
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index 196b07d75d..cb59bb21e5 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -328,7 +328,7 @@ class OembedPlugin extends Plugin
$ext = File::guessMimeExtension($info['mime']);
// We'll trust sha256 (File::FILEHASH_ALG) not to have collision issues any time soon :)
- $filename = hash(File::FILEHASH_ALG, $imgData) . ".{$ext}";
+ $filename = 'oembed-'.hash(File::FILEHASH_ALG, $imgData) . ".{$ext}";
$fullpath = File_thumbnail::path($filename);
// Write the file to disk. Throw Exception on failure
if (!file_exists($fullpath) && file_put_contents($fullpath, $imgData) === false) {
From 4e5c0e70a6822dd1a2e438b1222f916fe4de290b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 22:55:52 +0100
Subject: [PATCH 090/415] fillConfigVoids to set default value of empty config
options
---
classes/File_thumbnail.php | 3 ++-
lib/gnusocial.php | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index 925a3b2429..3f36e26563 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -134,7 +134,8 @@ class File_thumbnail extends Managed_DataObject
throw new ClientException(_('Invalid filename.'));
}
- $dir = common_config('thumbnail', 'dir') ?: File::path('thumb');
+ // NOTE: If this is empty, it will be set to File::path('thumb')
+ $dir = common_config('thumbnail', 'dir');
if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
$dir .= DIRECTORY_SEPARATOR;
diff --git a/lib/gnusocial.php b/lib/gnusocial.php
index f07d2c2446..3450b04888 100644
--- a/lib/gnusocial.php
+++ b/lib/gnusocial.php
@@ -141,6 +141,7 @@ class GNUsocial
// Load settings from database; note we need autoload for this
Config::loadSettings();
+ self::fillConfigVoids();
self::verifyLoadedConfig();
self::initPlugins();
@@ -420,6 +421,14 @@ class GNUsocial
}
}
+ static function fillConfigVoids()
+ {
+ // special cases on empty configuration options
+ if (!common_config('thumbnail', 'dir')) {
+ common_config_set('thumbnail', 'dir', File::path('thumb'));
+ }
+ }
+
/**
* Verify that the loaded config is good. Not complete, but will
* throw exceptions on common configuration problems I hope.
From cfc82591daaf2e6e5acdb8cc7002e81bd2a14267 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 23:23:32 +0100
Subject: [PATCH 091/415] chmod 0775 directories we create
Security for the 'g+rx' should be handle by having the parent directory
inaccessible for global users, which is usually the case.
---
lib/gnusocial.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/gnusocial.php b/lib/gnusocial.php
index 3450b04888..789cece2be 100644
--- a/lib/gnusocial.php
+++ b/lib/gnusocial.php
@@ -461,6 +461,9 @@ class GNUsocial
if (!mkdir($dir)) {
throw new ConfigException('Could not create directory for '._ve($description).': '._ve($dir));
}
+ if (!chmod($dir, 0775)) {
+ common_log(LOG_WARNING, 'Could not chmod 0775 on directory for '._ve($description).': '._ve($dir));
+ }
}
if (!is_array(common_config('public', 'autosource'))) {
From e43fe85454423ebc049a2dd7c8a75a44c753db77 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 7 Mar 2016 23:37:07 +0100
Subject: [PATCH 092/415] Note that you should run upgrade procedure as the PHP
user
---
UPGRADE | 3 +++
1 file changed, 3 insertions(+)
diff --git a/UPGRADE b/UPGRADE
index aaf9109e39..c175ee4f87 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -11,6 +11,9 @@ and follow this procedure:
0. Backup your data. The StatusNet upgrade discussions below have some
guidelines to back up the database and files (mysqldump and rsync).
+ MAKE SURE YOU ARE THE SAME USER THAT RUNS THE PHP FILES WHILE PERFORMING
+ THE COMMANDS BELOW (I usually prepend the commands with 'sudo -u social')
+
1. Stop your queue daemons (you can run this command even if you do not
use the queue daemons):
$ bash scripts/stopdaemons.sh
From 3b1181dae658ba9deec38b7804d4b3282bb843c8 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 8 Mar 2016 01:36:24 +0100
Subject: [PATCH 093/415] Display locally stored remote GIFs as thumbnails
Many newspapers seem to use animated GIFs as catchy header images, which
we would fail to show from oEmbed/OpenGraph fetching since they would
want us to "use File as Thumbnail", but the only place the image filename
was stored was in File_thumbnail, for the thumbnail of that file_id which
had a URL set.
---
classes/File.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/classes/File.php b/classes/File.php
index a1a2f78906..66ebc26138 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -479,7 +479,13 @@ class File extends Managed_DataObject
// null means "always use file as thumbnail"
// false means you get choice between frozen frame or original when calling getThumbnail
if (is_null(common_config('thumbnail', 'animated')) || !$force_still) {
- throw new UseFileAsThumbnailException($this->id);
+ try {
+ // remote files with animated GIFs as thumbnails will match this
+ return File_thumbnail::byFile($this);
+ } catch (NoResultException $e) {
+ // and if it's not a remote file, it'll be safe to use the locally stored File
+ throw new UseFileAsThumbnailException($this->id);
+ }
}
}
From 4360c65ed9a03633553c53857c72b0a1ef0d024b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 8 Mar 2016 01:59:58 +0100
Subject: [PATCH 094/415] Super special case where we should copy files instead
of mv
---
classes/File_thumbnail.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index 3f36e26563..4a4b25ff4d 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -188,8 +188,9 @@ class File_thumbnail extends Managed_DataObject
// If we have a file in our old thumbnail storage path, move it to the new one
if (file_exists($oldpath) && !file_exists($thumbpath)) {
if ($this->getFilename() === $this->getFile()->filename) {
- // special case where thumbnail file exactly matches stored File
- common_debug('File filename and File_thumbnail filename match on '.$this->file_id);
+ // special case where thumbnail file exactly matches stored File filename
+ common_debug('File filename and File_thumbnail filename match on '.$this->file_id.', copying instead');
+ copy($oldpath, $thumbpath);
} elseif (!rename($oldpath, $thumbpath)) {
common_log(LOG_ERR, 'Could not move thumbnail from '._ve($oldpath).' to '._ve($thumbpath));
throw new ServerException('Could not move thumbnail from old path to new path.');
From 4c7436e32852a0f36481e82aa1446cd2f5e79397 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 8 Mar 2016 02:00:34 +0100
Subject: [PATCH 095/415] Match empty on "" and not just NULL
---
scripts/upgrade.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/upgrade.php b/scripts/upgrade.php
index d5178e109a..c9fe4b0817 100755
--- a/scripts/upgrade.php
+++ b/scripts/upgrade.php
@@ -457,7 +457,7 @@ function deleteLocalFileThumbnailsWithoutFilename()
while ($file->fetch()) {
$thumbs = new File_thumbnail();
$thumbs->file_id = $file->id;
- $thumbs->whereAdd('filename IS NULL');
+ $thumbs->whereAdd('filename IS NULL OR filename = ""');
// Checking if there were any File_thumbnail entries without filename
if (!$thumbs->find()) {
continue;
@@ -480,7 +480,7 @@ function deleteMissingLocalFileThumbnails()
printfnq("Removing all local File_thumbnail entries without existing files...");
$thumbs = new File_thumbnail();
- $thumbs->whereAdd('filename IS NOT NULL'); // only fill in names where they're missing
+ $thumbs->whereAdd('filename IS NOT NULL AND filename != ""');
// Checking if there were any File_thumbnail entries without filename
if ($thumbs->find()) {
while ($thumbs->fetch()) {
From e4310a57cdc335d287d13efce24814c5829a5f78 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 8 Mar 2016 19:56:25 +0100
Subject: [PATCH 096/415] Profile->noticeCount minor change
---
classes/Profile.php | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 3dbd883dd8..87168ace4a 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -833,19 +833,21 @@ class Profile extends Managed_DataObject
$c = Cache::instance();
if (!empty($c)) {
- $cnt = $c->get(Cache::key('profile:notice_count:'.$this->id));
+ $cnt = $c->get(Cache::key('profile:notice_count:'.$this->getID()));
if (is_integer($cnt)) {
return (int) $cnt;
}
}
$notices = new Notice();
- $notices->profile_id = $this->id;
- $notices->verb = ActivityVerb::POST;
- $cnt = (int) $notices->count('distinct id');
+ $notices->profile_id = $this->getID();
+ $notices->whereAddIn('verb',
+ [ActivityUtils::resolveUri(ActivityVerb::POST, true), ActivityVerb::POST],
+ $notices->columnType('verb'));
+ $cnt = (int) $notices->count(); // we don't have to provide anything as Notice is key'd
if (!empty($c)) {
- $c->set(Cache::key('profile:notice_count:'.$this->id), $cnt);
+ $c->set(Cache::key('profile:notice_count:'.$this->getID()), $cnt);
}
return $cnt;
From e2c6f2f96fc9b40a6c3386db56cd12d726cc82a7 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 8 Mar 2016 20:01:06 +0100
Subject: [PATCH 097/415] Let's be consistent with URL verbs
---
lib/activityverb.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/activityverb.php b/lib/activityverb.php
index 187962d617..c59c6371b6 100644
--- a/lib/activityverb.php
+++ b/lib/activityverb.php
@@ -54,7 +54,7 @@ class ActivityVerb
const FRIEND = 'http://activitystrea.ms/schema/1.0/make-friend';
const JOIN = 'http://activitystrea.ms/schema/1.0/join';
const TAG = 'http://activitystrea.ms/schema/1.0/tag';
- const DELETE = 'delete'; // the url part is not used anymore, and this feature is new enough to avoid problems with legacy nodes if used without http://...
+ const DELETE = 'http://activitystrea.ms/schema/1.0/delete';
// Custom OStatus verbs for the flipside until they're standardized
const UNFAVORITE = 'http://activitystrea.ms/schema/1.0/unfavorite';
From 723b49a22aed9acc98bca4fffb870f23a04b3bd7 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 9 Mar 2016 14:17:55 +0100
Subject: [PATCH 098/415] throw exception instead of clientError
---
actions/newnotice.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 6ee2092061..5aa76a94e9 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -115,7 +115,7 @@ class NewnoticeAction extends FormAction
// simply no attached media to the new notice
if (empty($content)) {
// TRANS: Client error displayed trying to send a notice without content.
- $this->clientError(_('No content!'));
+ throw new ClientException(_('No content!'));
}
}
From d179afa303ce83c2e8c8a1f4dc94e093eb44bcec Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 9 Mar 2016 14:51:52 +0100
Subject: [PATCH 099/415] Save allowed path/qstring/fragment characters in
constants
---
lib/framework.php | 4 ++++
lib/util.php | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/framework.php b/lib/framework.php
index 620730370f..3a62bb5d68 100644
--- a/lib/framework.php
+++ b/lib/framework.php
@@ -57,6 +57,10 @@ define('NOTICE_INBOX_SOURCE_FORWARD', 4);
define('NOTICE_INBOX_SOURCE_PROFILE_TAG', 5);
define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
+define('URL_REGEX_VALID_PATH_CHARS', '\pN\pL\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\@');
+define('URL_REGEX_VALID_QSTRING_CHARS', URL_REGEX_VALID_PATH_CHARS);
+define('URL_REGEX_VALID_FRAGMENT_CHARS', URL_REGEX_VALID_PATH_CHARS . '\?\#');
+
// append our extlib dir as the last-resort place to find libs
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/');
diff --git a/lib/util.php b/lib/util.php
index 05e3e732bd..977c55f4e6 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1013,9 +1013,9 @@ function common_replace_urls_callback($text, $callback, $arg = null) {
')'.
'(?:'.
'(?:\:\d+)?'. //:port
- '(?:/[\pN\pL$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'@]*)?'. // /path
- '(?:\?[\pN\pL\$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'@\/]*)?'. // ?query string
- '(?:\#[\pN\pL$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\@/\?\#]*)?'. // #fragment
+ '(?:/[' . URL_REGEX_VALID_PATH_CHARS . ']*)?'. // path
+ '(?:\?[' . URL_REGEX_VALID_QSTRING_CHARS . ']*)?'. // ?query string
+ '(?:\#[' . URL_REGEX_VALID_FRAGMENT_CHARS . ']*)?'. // #fragment
')(?
Date: Wed, 9 Mar 2016 14:52:15 +0100
Subject: [PATCH 100/415] If our host matched in File lookup, it could throw
exceptions on Router->map
---
classes/File.php | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index 66ebc26138..0368153acd 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -113,17 +113,30 @@ class File extends Managed_DataObject
if (isset($u['host']) && $u['host'] === common_config('site', 'server')) {
$r = Router::get();
// Skip the / in the beginning or $r->map won't match
- $args = $r->map(mb_substr($u['path'], 1));
- if ($args['action'] === 'attachment') {
- try {
- // $args['attachment'] should always be set if action===attachment, given our routing rules
- $file = File::getByID($args['attachment']);
- return $file;
- } catch (EmptyIdException $e) {
- // ...but $args['attachment'] can also be 0...
- } catch (NoResultException $e) {
- // apparently this link goes to us, but is _not_ an existing attachment (File) ID?
+ try {
+ $args = $r->map(mb_substr($u['path'], 1));
+ if ($args['action'] === 'attachment') {
+ try {
+ // $args['attachment'] should always be set if action===attachment, given our routing rules
+ $file = File::getByID($args['attachment']);
+ return $file;
+ } catch (EmptyIdException $e) {
+ // ...but $args['attachment'] can also be 0...
+ } catch (NoResultException $e) {
+ // apparently this link goes to us, but is _not_ an existing attachment (File) ID?
+ }
}
+ } catch (Exception $e) {
+ // Some other exception was thrown from $r->map, likely a
+ // ClientException (404) because of some malformed link to
+ // our own instance. It's still a valid URL however, so we
+ // won't abort anything... I noticed this when linking:
+ // https://social.umeahackerspace.se/mmn/foaf' (notice the
+ // apostrophe in the end, making it unrecognizable for our
+ // URL routing.
+ // That specific issue (the apostrophe being part of a link
+ // is something that may or may not have been fixed since,
+ // in lib/util.php in common_replace_urls_callback().
}
}
From c76992450510f2d6261bc7c4380151681b7d5c06 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 9 Mar 2016 15:05:36 +0100
Subject: [PATCH 101/415] Reduce the number of allowed characters in
auto-linking URLs.
---
lib/framework.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/framework.php b/lib/framework.php
index 3a62bb5d68..5017fc01ea 100644
--- a/lib/framework.php
+++ b/lib/framework.php
@@ -57,9 +57,14 @@ define('NOTICE_INBOX_SOURCE_FORWARD', 4);
define('NOTICE_INBOX_SOURCE_PROFILE_TAG', 5);
define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
-define('URL_REGEX_VALID_PATH_CHARS', '\pN\pL\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\@');
-define('URL_REGEX_VALID_QSTRING_CHARS', URL_REGEX_VALID_PATH_CHARS);
-define('URL_REGEX_VALID_FRAGMENT_CHARS', URL_REGEX_VALID_PATH_CHARS . '\?\#');
+/**
+ * StatusNet had this string as valid path characters: '\pN\pL\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\'\@'
+ * Some of those characters can be troublesome when auto-linking plain text. Such as "http://some.com/)"
+ * URL encoding should be used whenever a weird character is used, the following strings are not definitive.
+ */
+define('URL_REGEX_VALID_PATH_CHARS', '\pN\pL\,\-\_\+\/\=\:\;\%\~\*');
+define('URL_REGEX_VALID_QSTRING_CHARS', URL_REGEX_VALID_PATH_CHARS . '\&');
+define('URL_REGEX_VALID_FRAGMENT_CHARS', URL_REGEX_VALID_QSTRING_CHARS . '\?\#');
// append our extlib dir as the last-resort place to find libs
From bd753055601acd42e67136f8adc8613f462c2916 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 9 Mar 2016 15:16:47 +0100
Subject: [PATCH 102/415] Define-ify excluded end-characters of URL autolinking
---
lib/framework.php | 3 ++-
lib/util.php | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/framework.php b/lib/framework.php
index 5017fc01ea..229de8b793 100644
--- a/lib/framework.php
+++ b/lib/framework.php
@@ -62,9 +62,10 @@ define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
* Some of those characters can be troublesome when auto-linking plain text. Such as "http://some.com/)"
* URL encoding should be used whenever a weird character is used, the following strings are not definitive.
*/
-define('URL_REGEX_VALID_PATH_CHARS', '\pN\pL\,\-\_\+\/\=\:\;\%\~\*');
+define('URL_REGEX_VALID_PATH_CHARS', '\pN\pL\,\!\.\:\-\_\+\/\=\;\%\~\*');
define('URL_REGEX_VALID_QSTRING_CHARS', URL_REGEX_VALID_PATH_CHARS . '\&');
define('URL_REGEX_VALID_FRAGMENT_CHARS', URL_REGEX_VALID_QSTRING_CHARS . '\?\#');
+define('URL_REGEX_EXCLUDED_END_CHARS', '\?\.\,\!\#\:\''); // don't include these if they are directly after a URL
// append our extlib dir as the last-resort place to find libs
diff --git a/lib/util.php b/lib/util.php
index 977c55f4e6..e65097c32b 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1016,7 +1016,7 @@ function common_replace_urls_callback($text, $callback, $arg = null) {
'(?:/[' . URL_REGEX_VALID_PATH_CHARS . ']*)?'. // path
'(?:\?[' . URL_REGEX_VALID_QSTRING_CHARS . ']*)?'. // ?query string
'(?:\#[' . URL_REGEX_VALID_FRAGMENT_CHARS . ']*)?'. // #fragment
- ')(?
Date: Wed, 9 Mar 2016 23:49:01 +0100
Subject: [PATCH 103/415] Make sure File_thumbnail->getPath() doesn't throw
NoResultException
---
classes/File.php | 27 +++++++++---------
classes/File_thumbnail.php | 58 ++++++++++++++++++++++----------------
scripts/upgrade.php | 2 +-
3 files changed, 49 insertions(+), 38 deletions(-)
diff --git a/classes/File.php b/classes/File.php
index 0368153acd..9643b78f18 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -260,11 +260,7 @@ class File extends Managed_DataObject
public function getFilename()
{
- if (!self::validFilename($this->filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_("Invalid filename."));
- }
- return $this->filename;
+ return self::tryFilename($this->filename);
}
// where should the file go?
@@ -349,15 +345,23 @@ class File extends Managed_DataObject
return preg_match('/^[A-Za-z0-9._-]+$/', $filename);
}
+ static function tryFilename($filename)
+ {
+ if (!self::validFilename($filename))
+ {
+ throw new InvalidFilenameException($filename);
+ }
+ // if successful, return the filename for easy if-statementing
+ return $filename;
+ }
+
/**
* @throws ClientException on invalid filename
*/
static function path($filename)
{
- if (!self::validFilename($filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_("Invalid filename."));
- }
+ self::tryFilename($filename);
+
$dir = common_config('attachments', 'dir');
if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
@@ -369,10 +373,7 @@ class File extends Managed_DataObject
static function url($filename)
{
- if (!self::validFilename($filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_("Invalid filename."));
- }
+ self::tryFilename($filename);
if (common_config('site','private')) {
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index 4a4b25ff4d..f789a0d9a1 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -129,12 +129,9 @@ class File_thumbnail extends Managed_DataObject
static function path($filename)
{
- if (!File::validFilename($filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_('Invalid filename.'));
- }
+ File::tryFilename($filename);
- // NOTE: If this is empty, it will be set to File::path('thumb')
+ // NOTE: If this is left empty in default config, it will be set to File::path('thumb')
$dir = common_config('thumbnail', 'dir');
if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
@@ -146,10 +143,7 @@ class File_thumbnail extends Managed_DataObject
static function url($filename)
{
- if (!File::validFilename($filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_('Invalid filename.'));
- }
+ File::tryFilename($filename);
// FIXME: private site thumbnails?
@@ -173,21 +167,36 @@ class File_thumbnail extends Managed_DataObject
public function getFilename()
{
- if (!File::validFilename($this->filename)) {
- // TRANS: Client exception thrown if a file upload does not have a valid name.
- throw new ClientException(_("Invalid filename."));
- }
- return $this->filename;
+ return File::tryFilename($this->filename);
}
+ /**
+ *
+ * @return string full filesystem path to the locally stored thumbnail file
+ * @throws
+ */
public function getPath()
{
$oldpath = File::path($this->getFilename());
$thumbpath = self::path($this->getFilename());
- // If we have a file in our old thumbnail storage path, move it to the new one
+ // If we have a file in our old thumbnail storage path, move (or copy) it to the new one
+ // (if the if/elseif don't match, we have a $thumbpath just as we should and can return it)
if (file_exists($oldpath) && !file_exists($thumbpath)) {
- if ($this->getFilename() === $this->getFile()->filename) {
+ try {
+ // let's get the filename of the File, to check below if it happens to be identical
+ $file_filename = $this->getFile()->getFilename();
+ } catch (NoResultException $e) {
+ // reasonably the function calling us will handle the following as "File_thumbnail entry should be deleted"
+ throw FileNotFoundException($thumbpath);
+ } catch (InvalidFilenameException $e) {
+ // invalid filename in getFile()->getFilename(), just
+ // means the File object isn't stored locally and that
+ // means it's safe to move it below.
+ $file_filename = null;
+ }
+
+ if ($this->getFilename() === $file_filename) {
// special case where thumbnail file exactly matches stored File filename
common_debug('File filename and File_thumbnail filename match on '.$this->file_id.', copying instead');
copy($oldpath, $thumbpath);
@@ -200,6 +209,7 @@ class File_thumbnail extends Managed_DataObject
} elseif (!file_exists($thumbpath)) {
throw new FileNotFoundException($thumbpath);
}
+
return $thumbpath;
}
@@ -243,15 +253,15 @@ class File_thumbnail extends Managed_DataObject
public function delete($useWhere=false)
{
- if (!empty($this->filename)) {
- try {
- $deleted = @unlink($this->getPath());
- if (!$deleted) {
- common_log(LOG_ERR, 'Could not unlink existing thumbnail file: '._ve($this->getPath()));
- }
- } catch (FileNotFoundException $e) {
- common_log(LOG_INFO, 'Thumbnail already gone from '._ve($e->path));
+ try {
+ $thumbpath = self::path($this->getFilename());
+ // if file does not exist, try to delete it
+ $deleted = !file_exists($thumbpath) || @unlink($thumbpath);
+ if (!$deleted) {
+ common_log(LOG_ERR, 'Could not unlink existing thumbnail file: '._ve($thumbpath));
}
+ } catch (InvalidFilenameException $e) {
+ common_log(LOG_ERR, 'Deleting object but not attempting deleting file: '._ve($e->getMessage()));
}
return parent::delete($useWhere);
diff --git a/scripts/upgrade.php b/scripts/upgrade.php
index c9fe4b0817..fa55cfc206 100755
--- a/scripts/upgrade.php
+++ b/scripts/upgrade.php
@@ -503,7 +503,7 @@ function setFilehashOnLocalFiles()
printfnq('Ensuring all local files have the filehash field set...');
$file = new File();
- $file->whereAdd('filename IS NOT NULL'); // local files
+ $file->whereAdd('filename IS NOT NULL AND filename != ""'); // local files
$file->whereAdd('filehash IS NULL', 'AND'); // without filehash value
if ($file->find()) {
From 566977c136547e0aac8ffc359abf8adc2f502273 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 10 Mar 2016 13:46:19 +0100
Subject: [PATCH 104/415] forgot 'new' after throw
---
classes/File_thumbnail.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index f789a0d9a1..968883f2b8 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -188,7 +188,7 @@ class File_thumbnail extends Managed_DataObject
$file_filename = $this->getFile()->getFilename();
} catch (NoResultException $e) {
// reasonably the function calling us will handle the following as "File_thumbnail entry should be deleted"
- throw FileNotFoundException($thumbpath);
+ throw new FileNotFoundException($thumbpath);
} catch (InvalidFilenameException $e) {
// invalid filename in getFile()->getFilename(), just
// means the File object isn't stored locally and that
From 5ca2a28246bd1411c8a4b6226c9acf48aa4dfa7a Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 10 Mar 2016 14:20:21 +0100
Subject: [PATCH 105/415] Make oEmbed handle our http/https setting better.
---
lib/util.php | 9 +++++++--
plugins/Oembed/actions/oembed.php | 31 ++++++++++++-------------------
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/lib/util.php b/lib/util.php
index e65097c32b..bc4898f847 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1689,10 +1689,15 @@ function common_profile_url($nickname)
/**
* Should make up a reasonable root URL
+ *
+ * @param bool $tls true or false to force TLS scheme, null to use server configuration
*/
-function common_root_url($ssl=false)
+function common_root_url($tls=null)
{
- $url = common_path('', $ssl, false);
+ if (is_null($tls)) {
+ $tls = GNUsocial::useHTTPS();
+ }
+ $url = common_path('', $tls, false);
$i = strpos($url, '?');
if ($i !== false) {
$url = substr($url, 0, $i);
diff --git a/plugins/Oembed/actions/oembed.php b/plugins/Oembed/actions/oembed.php
index af181ad586..c374b8b34f 100644
--- a/plugins/Oembed/actions/oembed.php
+++ b/plugins/Oembed/actions/oembed.php
@@ -44,21 +44,20 @@ class OembedAction extends Action
parent::handle();
$url = $this->trimmed('url');
- if (substr(strtolower($url),0,strlen(common_root_url())) !== strtolower(common_root_url())) {
+ $tls = parse_url($url, PHP_URL_SCHEME) == 'https';
+ $root_url = common_root_url($tls);
+
+ if (substr(strtolower($url),0,mb_strlen($root_url)) !== strtolower($root_url)) {
// TRANS: Error message displaying attachments. %s is the site's base URL.
- $this->clientError(sprintf(_('oEmbed data will only be provided for %s URLs.'), common_root_url()), 400);
+ throw new ClientException(sprintf(_('oEmbed data will only be provided for %s URLs.'), $root_url));
}
- $path = substr($url,strlen(common_root_url()));
+ $path = substr($url,strlen($root_url));
$r = Router::get();
+ // $r->map will throw ClientException 404 if it fails to find a mapping
$proxy_args = $r->map($path);
- if (!$proxy_args) {
- // TRANS: Client error displayed in oEmbed action when path not found.
- // TRANS: %s is a path.
- $this->clientError(sprintf(_('"%s" not found.'),$path), 404);
- }
$oembed=array();
$oembed['version']='1.0';
@@ -68,18 +67,12 @@ class OembedAction extends Action
switch ($proxy_args['action']) {
case 'shownotice':
$oembed['type']='link';
- $id = $proxy_args['notice'];
- $notice = Notice::getKV($id);
- if(empty($notice)){
- // TRANS: Client error displayed in oEmbed action when notice not found.
- // TRANS: %s is a notice.
- $this->clientError(sprintf(_("Notice %s not found."),$id), 404);
+ try {
+ $notice = Notice::getByID($proxy_args['notice']);
+ } catch (NoResultException $e) {
+ throw new ClientException($e->getMessage(), 404);
}
$profile = $notice->getProfile();
- if (empty($profile)) {
- // TRANS: Server error displayed in oEmbed action when notice has not profile.
- $this->serverError(_('Notice has no profile.'), 500);
- }
$authorname = $profile->getFancyName();
// TRANS: oEmbed title. %1$s is the author name, %2$s is the creation date.
$oembed['title'] = sprintf(_('%1$s\'s status on %2$s'),
@@ -256,4 +249,4 @@ class OembedAction extends Action
{
return true;
}
-}
\ No newline at end of file
+}
From 0f5ebb6827557eb1e2737ddabe0f97858f2b27d5 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 10 Mar 2016 15:15:06 +0100
Subject: [PATCH 106/415] Redundant font definitions in CSS
---
theme/neo-gnu/css/display.css | 5 -----
1 file changed, 5 deletions(-)
diff --git a/theme/neo-gnu/css/display.css b/theme/neo-gnu/css/display.css
index 334177164e..5a3be469d8 100644
--- a/theme/neo-gnu/css/display.css
+++ b/theme/neo-gnu/css/display.css
@@ -16,14 +16,9 @@ body {
/* background-color: #C6C8CC;
background-image: url(../images/bg.png); */
background-color: #e9eaed;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #222;
}
-input, textarea, select, option {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
a {color: #666;}
a:hover {color: #a22430;}
From ca8f0f84c47d6ed33e596571b6b7c875c8feaa6f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 14 Mar 2016 15:25:05 +0100
Subject: [PATCH 107/415] Woops, forgot to include this file!
---
lib/invalidfilenameexception.php | 52 ++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 lib/invalidfilenameexception.php
diff --git a/lib/invalidfilenameexception.php b/lib/invalidfilenameexception.php
new file mode 100644
index 0000000000..0b398c1db3
--- /dev/null
+++ b/lib/invalidfilenameexception.php
@@ -0,0 +1,52 @@
+.
+ *
+ * @category Exception
+ * @package StatusNet
+ * @author Mikael Nordfeldth
+ * @copyright 2016 Free Software Foundation, Inc.
+ * @license https://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
+ * @link https://gnu.io/social
+ */
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+/**
+ * Class for an exception when a filename is invalid
+ *
+ * @category Exception
+ * @package GNUsocial
+ * @author Mikael Nordfeldth
+ * @license https://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
+ * @link https://gnu.io/social
+ */
+
+class InvalidFilenameException extends ServerException
+{
+ public $filename = null;
+
+ public function __construct($filename)
+ {
+ $this->filename = $filename;
+ // We could log an entry here with the search parameters
+ parent::__construct(_('Invalid filename.'));
+ }
+}
From 349e842078c5d69901df6ec9205cf7edcb4c4636 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 14 Mar 2016 15:26:03 +0100
Subject: [PATCH 108/415] UPDATE ActivityVerb
---
lib/activityverb.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/activityverb.php b/lib/activityverb.php
index c59c6371b6..c940246d15 100644
--- a/lib/activityverb.php
+++ b/lib/activityverb.php
@@ -55,6 +55,7 @@ class ActivityVerb
const JOIN = 'http://activitystrea.ms/schema/1.0/join';
const TAG = 'http://activitystrea.ms/schema/1.0/tag';
const DELETE = 'http://activitystrea.ms/schema/1.0/delete';
+ const UPDATE = 'http://activitystrea.ms/schema/1.0/update';
// Custom OStatus verbs for the flipside until they're standardized
const UNFAVORITE = 'http://activitystrea.ms/schema/1.0/unfavorite';
From f32414dd93d755012ff67397f4b990d42d09b244 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 15 Mar 2016 16:52:57 +0100
Subject: [PATCH 109/415] Upgrading from 1.1.x would make uri fields have
length=255
---
plugins/ActivityModeration/classes/Deleted_notice.php | 1 +
plugins/Event/classes/RSVP.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/plugins/ActivityModeration/classes/Deleted_notice.php b/plugins/ActivityModeration/classes/Deleted_notice.php
index 05414caab2..7a0c6a7f05 100644
--- a/plugins/ActivityModeration/classes/Deleted_notice.php
+++ b/plugins/ActivityModeration/classes/Deleted_notice.php
@@ -195,6 +195,7 @@ class Deleted_notice extends Managed_DataObject
echo "\nFound old $table table, upgrading it to add 'act_created' field...";
$schemadef['fields']['act_created'] = array('type' => 'datetime', 'not null' => true, 'description' => 'datetime the notice record was created');
+ $schemadef['fields']['uri']['length'] = 191; // we likely don't have to discover too long keys here
$schema->ensureTable($table, $schemadef);
$deleted = new Deleted_notice();
diff --git a/plugins/Event/classes/RSVP.php b/plugins/Event/classes/RSVP.php
index 84cbd624dc..f2ab8f0aa3 100644
--- a/plugins/Event/classes/RSVP.php
+++ b/plugins/Event/classes/RSVP.php
@@ -107,6 +107,7 @@ class RSVP extends Managed_DataObject
echo "\nFound old $table table, upgrading it to add 'event_uri' field...";
$schemadef['fields']['event_uri'] = array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'Event URI');
+ $schemadef['fields']['uri']['length'] = 191; // we likely don't have to discover too long keys here
$schema->ensureTable($table, $schemadef);
$rsvp = new RSVP();
From f4833c6c912cdae0f109ddbff41596f89de1740a Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 15 Mar 2016 16:53:19 +0100
Subject: [PATCH 110/415] More verbose salmon debugging
---
plugins/OStatus/lib/salmonaction.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/lib/salmonaction.php
index d1293728d2..13f49f4eff 100644
--- a/plugins/OStatus/lib/salmonaction.php
+++ b/plugins/OStatus/lib/salmonaction.php
@@ -83,6 +83,8 @@ class SalmonAction extends Action
// Cryptographic verification test, throws exception on failure
$magic_env->verify($this->actor);
+ common_debug('Salmon slap is carrying activity URI=='._ve($this->activity->id));
+
return true;
}
From bf7c035f9992b2e7f1df5ca1676d51f70acb0f8d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 16 Mar 2016 20:37:57 +0100
Subject: [PATCH 111/415] only direct .inline-attachment children
---
theme/base/css/display.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 8f059faadb..03c1544b4d 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -811,7 +811,7 @@ position:static;
margin-bottom: 1em;
}
-.notice.h-entry .attachments .inline-attachment * {
+.notice.h-entry .attachments .inline-attachment > * {
height: auto;
max-width: 100%;
}
From 99a2230fdb357f2821da0c595b79437fad23768f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 17 Mar 2016 00:31:32 +0100
Subject: [PATCH 112/415] h5 and h6 don't need margin-bottom methinks
---
theme/base/css/display.css | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 03c1544b4d..19ff81407d 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -48,9 +48,13 @@ a img {
text-decoration: none;
}
-h1, h2, h3, h4, h5, h6 {
+h1, h2, h3, h4 {
font-weight: normal;
- margin-bottom: 15px;
+ margin-bottom: 1ex;
+}
+h5, h6 {
+ font-weight: normal;
+ margin-bottom: 0;
}
h1 {font-size: 2.0em;}
From 102f7ab05954146460843a8cc3af7034ee005a85 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 17 Mar 2016 00:31:45 +0100
Subject: [PATCH 113/415] oEmbed neatifying (inspired by Qvitter)
---
plugins/Oembed/OembedPlugin.php | 62 +++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index cb59bb21e5..65d71f39c8 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -143,6 +143,11 @@ class OembedPlugin extends Plugin
return true;
}
+ public function onEndShowStylesheets(Action $action) {
+ $action->cssLink($this->path('css/oembed.css'));
+ return true;
+ }
+
/**
* Save embedding information for a File, if applicable.
*
@@ -224,6 +229,63 @@ class OembedPlugin extends Plugin
}
return true;
}
+
+ public function onStartShowAttachmentRepresentation(HTMLOutputter $out, File $file)
+ {
+ try {
+ $oembed = File_oembed::getByFile($file);
+ } catch (NoResultException $e) {
+ return true;
+ }
+
+ $out->elementStart('article', ['class'=>'oembed-item']);
+ $out->elementStart('header');
+ try {
+ $thumb = $file->getThumbnail(128, 128);
+ $out->element('img', $thumb->getHtmlAttrs(['class'=>'oembed-thumb']));
+ unset($thumb);
+ } catch (Exception $e) {
+ $out->element('div', ['class'=>'error'], $e->getMessage());
+ }
+ $out->elementStart('h5', ['class'=>'oembed-title']);
+ $out->element('a', ['href'=>$file->getUrl()], $oembed->title);
+ $out->elementEnd('h5');
+ $out->elementStart('div', ['class'=>'oembed-source']);
+ if (!empty($oembed->author_name)) {
+ // TRANS: text before the author name of oEmbed attachment representation
+ // FIXME: The whole "By x from y" should be i18n because of different language constructions.
+ $out->text(_('By '));
+ $attrs = ['class'=>'h-card'];
+ if (!empty($oembed->author_url)) {
+ $attrs['href'] = $oembed->author_url;
+ $tag = 'a';
+ } else {
+ $tag = 'span';
+ }
+ $out->element($tag, $attrs, $oembed->author_name);
+ }
+ if (!empty($oembed->provider)) {
+ // TRANS: text between the oEmbed author name and provider url
+ // FIXME: The whole "By x from y" should be i18n because of different language constructions.
+ $out->text(_(' from '));
+ $attrs = ['class'=>'h-card'];
+ if (!empty($oembed->provider_url)) {
+ $attrs['href'] = $oembed->provider_url;
+ $tag = 'a';
+ } else {
+ $tag = 'span';
+ }
+ $out->element($tag, $attrs, $oembed->provider);
+ }
+ $out->elementEnd('div');
+ $out->elementEnd('header');
+ $out->element('div', ['class'=>'oembed-item-body'], common_purify($oembed->html));
+ $out->elementStart('footer');
+ $out->elementEnd('footer');
+ $out->elementEnd('article');
+
+ return false;
+ }
public function onShowUnsupportedAttachmentRepresentation(HTMLOutputter $out, File $file)
{
From 365f3d2aa5ad1795deec11b6a5554d683c16585b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 17 Mar 2016 12:58:40 +0100
Subject: [PATCH 114/415] Full-content oEmbed html doesn't take up all space
(and renders properly)
---
plugins/Oembed/OembedPlugin.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index 65d71f39c8..4497728c4c 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -248,7 +248,7 @@ class OembedPlugin extends Plugin
$out->element('div', ['class'=>'error'], $e->getMessage());
}
$out->elementStart('h5', ['class'=>'oembed-title']);
- $out->element('a', ['href'=>$file->getUrl()], $oembed->title);
+ $out->element('a', ['href'=>$file->getUrl()], common_strip_html($oembed->title));
$out->elementEnd('h5');
$out->elementStart('div', ['class'=>'oembed-source']);
if (!empty($oembed->author_name)) {
@@ -279,7 +279,9 @@ class OembedPlugin extends Plugin
}
$out->elementEnd('div');
$out->elementEnd('header');
- $out->element('div', ['class'=>'oembed-item-body'], common_purify($oembed->html));
+ $out->elementStart('div', ['class'=>'oembed-html']);
+ $out->raw(common_purify($oembed->html));
+ $out->elementEnd('div');
$out->elementStart('footer');
$out->elementEnd('footer');
$out->elementEnd('article');
From aa3865c303c0827408a0510020147cc2929bce68 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:33:57 +0100
Subject: [PATCH 115/415] Split threaded notice list classes into own files.
---
lib/threadednoticelist.php | 215 -----------------------------
lib/threadednoticelistitem.php | 106 ++++++++++++++
lib/threadednoticelistmoreitem.php | 61 ++++++++
lib/threadednoticelistsubitem.php | 57 ++++++++
4 files changed, 224 insertions(+), 215 deletions(-)
create mode 100644 lib/threadednoticelistitem.php
create mode 100644 lib/threadednoticelistmoreitem.php
create mode 100644 lib/threadednoticelistsubitem.php
diff --git a/lib/threadednoticelist.php b/lib/threadednoticelist.php
index 4b5d28de3f..a68347b904 100644
--- a/lib/threadednoticelist.php
+++ b/lib/threadednoticelist.php
@@ -152,218 +152,3 @@ class ThreadedNoticeList extends NoticeList
return new ThreadedNoticeListItem($notice, $this->out, $this->userProfile);
}
}
-
-/**
- * widget for displaying a single notice
- *
- * This widget has the core smarts for showing a single notice: what to display,
- * where, and under which circumstances. Its key method is show(); this is a recipe
- * that calls all the other show*() methods to build up a single notice. The
- * ProfileNoticeListItem subclass, for example, overrides showAuthor() to skip
- * author info (since that's implicit by the data in the page).
- *
- * @category UI
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://status.net/
- * @see NoticeList
- * @see ProfileNoticeListItem
- */
-class ThreadedNoticeListItem extends NoticeListItem
-{
- protected $userProfile = null;
-
- function __construct(Notice $notice, Action $out=null, $profile=null)
- {
- parent::__construct($notice, $out);
- $this->userProfile = $profile;
- }
-
- function initialItems()
- {
- return 3;
- }
-
- /**
- * finish the notice
- *
- * Close the last elements in the notice list item
- *
- * @return void
- */
- function showEnd()
- {
- $max = $this->initialItems();
- if (!$this->repeat instanceof Notice) {
- $stream = new ConversationNoticeStream($this->notice->conversation, $this->userProfile);
- $notice = $stream->getNotices(0, $max + 2);
- $notices = array();
- $cnt = 0;
- $moreCutoff = null;
- while ($notice->fetch()) {
- if (Event::handle('StartAddNoticeReply', array($this, $this->notice, $notice))) {
- // Don't list repeats as separate notices in a conversation
- if (!empty($notice->repeat_of)) {
- continue;
- }
-
- if ($notice->id == $this->notice->id) {
- // Skip!
- continue;
- }
- $cnt++;
- if ($cnt > $max) {
- // boo-yah
- $moreCutoff = clone($notice);
- break;
- }
- $notices[] = clone($notice); // *grumble* inefficient as hell
- Event::handle('EndAddNoticeReply', array($this, $this->notice, $notice));
- }
- }
-
- if (Event::handle('StartShowThreadedNoticeTail', array($this, $this->notice, &$notices))) {
- $threadActive = count($notices) > 0; // has this thread had any activity?
-
- $this->out->elementStart('ul', 'notices threaded-replies xoxo');
-
- if (Event::handle('StartShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive))) {
- // Repeats and Faves/Likes are handled in plugins.
- Event::handle('EndShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive));
- }
-
- if (count($notices)>0) {
- if ($moreCutoff) {
- $item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out, count($notices));
- $item->show();
- }
- foreach (array_reverse($notices) as $notice) {
- if (Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice))) {
- $item = new ThreadedNoticeListSubItem($notice, $this->notice, $this->out);
- $item->show();
- Event::handle('EndShowThreadedNoticeSub', array($this, $this->notice, $notice));
- }
- }
- }
-
- Event::handle('EndShowThreadedNoticeTail', array($this, $this->notice, $notices));
- $this->out->elementEnd('ul');
- }
- }
-
- parent::showEnd();
- }
-}
-
-// @todo FIXME: needs documentation.
-class ThreadedNoticeListSubItem extends NoticeListItem
-{
- protected $root = null;
-
- function __construct(Notice $notice, $root, $out)
- {
- $this->root = $root;
- parent::__construct($notice, $out);
- }
-
- function avatarSize()
- {
- return AVATAR_STREAM_SIZE; // @fixme would like something in between
- }
-
- function showNoticeLocation()
- {
- //
- }
-
- function showNoticeSource()
- {
- //
- }
-
- function getAttentionProfiles()
- {
- $all = parent::getAttentionProfiles();
-
- $profiles = array();
-
- $rootAuthor = $this->root->getProfile();
-
- foreach ($all as $profile) {
- if ($profile->id != $rootAuthor->id) {
- $profiles[] = $profile;
- }
- }
-
- return $profiles;
- }
-
- function showEnd()
- {
- $threadActive = null; // unused here for now, but maybe in the future?
- if (Event::handle('StartShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive))) {
- // Repeats and Faves/Likes are handled in plugins.
- Event::handle('EndShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive));
- }
- parent::showEnd();
- }
-}
-
-/**
- * Placeholder for loading more replies...
- */
-class ThreadedNoticeListMoreItem extends NoticeListItem
-{
- protected $cnt;
-
- function __construct(Notice $notice, Action $out, $cnt)
- {
- parent::__construct($notice, $out);
- $this->cnt = $cnt;
- }
-
- /**
- * recipe function for displaying a single notice.
- *
- * This uses all the other methods to correctly display a notice. Override
- * it or one of the others to fine-tune the output.
- *
- * @return void
- */
- function show()
- {
- $this->showStart();
- $this->showMiniForm();
- $this->showEnd();
- }
-
- /**
- * start a single notice.
- *
- * @return void
- */
- function showStart()
- {
- $this->out->elementStart('li', array('class' => 'notice-reply-comments'));
- }
-
- function showEnd()
- {
- $this->out->elementEnd('li');
- }
-
- function showMiniForm()
- {
- $id = $this->notice->conversation;
- $url = common_local_url('conversation', array('id' => $id));
-
- $n = Conversation::noticeCount($id) - 1;
-
- // TRANS: Link to show replies for a notice.
- // TRANS: %d is the number of replies to a notice and used for plural.
- $msg = sprintf(_m('Show reply', 'Show all %d replies', $n), $n);
-
- $this->out->element('a', array('href' => $url), $msg);
- }
-}
diff --git a/lib/threadednoticelistitem.php b/lib/threadednoticelistitem.php
new file mode 100644
index 0000000000..7e72f6aa23
--- /dev/null
+++ b/lib/threadednoticelistitem.php
@@ -0,0 +1,106 @@
+
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ * @see NoticeList
+ * @see ProfileNoticeListItem
+ */
+class ThreadedNoticeListItem extends NoticeListItem
+{
+ protected $userProfile = null;
+
+ function __construct(Notice $notice, Action $out=null, $profile=null)
+ {
+ parent::__construct($notice, $out);
+ $this->userProfile = $profile;
+ }
+
+ function initialItems()
+ {
+ return 3;
+ }
+
+ /**
+ * finish the notice
+ *
+ * Close the last elements in the notice list item
+ *
+ * @return void
+ */
+ function showEnd()
+ {
+ $max = $this->initialItems();
+ if (!$this->repeat instanceof Notice) {
+ $stream = new ConversationNoticeStream($this->notice->conversation, $this->userProfile);
+ $notice = $stream->getNotices(0, $max + 2);
+ $notices = array();
+ $cnt = 0;
+ $moreCutoff = null;
+ while ($notice->fetch()) {
+ if (Event::handle('StartAddNoticeReply', array($this, $this->notice, $notice))) {
+ // Don't list repeats as separate notices in a conversation
+ if (!empty($notice->repeat_of)) {
+ continue;
+ }
+
+ if ($notice->id == $this->notice->id) {
+ // Skip!
+ continue;
+ }
+ $cnt++;
+ if ($cnt > $max) {
+ // boo-yah
+ $moreCutoff = clone($notice);
+ break;
+ }
+ $notices[] = clone($notice); // *grumble* inefficient as hell
+ Event::handle('EndAddNoticeReply', array($this, $this->notice, $notice));
+ }
+ }
+
+ if (Event::handle('StartShowThreadedNoticeTail', array($this, $this->notice, &$notices))) {
+ $threadActive = count($notices) > 0; // has this thread had any activity?
+
+ $this->out->elementStart('ul', 'notices threaded-replies xoxo');
+
+ if (Event::handle('StartShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive))) {
+ // Repeats and Faves/Likes are handled in plugins.
+ Event::handle('EndShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive));
+ }
+
+ if (count($notices)>0) {
+ if ($moreCutoff) {
+ $item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out, count($notices));
+ $item->show();
+ }
+ foreach (array_reverse($notices) as $notice) {
+ if (Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice))) {
+ $item = new ThreadedNoticeListSubItem($notice, $this->notice, $this->out);
+ $item->show();
+ Event::handle('EndShowThreadedNoticeSub', array($this, $this->notice, $notice));
+ }
+ }
+ }
+
+ Event::handle('EndShowThreadedNoticeTail', array($this, $this->notice, $notices));
+ $this->out->elementEnd('ul');
+ }
+ }
+
+ parent::showEnd();
+ }
+}
diff --git a/lib/threadednoticelistmoreitem.php b/lib/threadednoticelistmoreitem.php
new file mode 100644
index 0000000000..ebd0b78c84
--- /dev/null
+++ b/lib/threadednoticelistmoreitem.php
@@ -0,0 +1,61 @@
+cnt = $cnt;
+ }
+
+ /**
+ * recipe function for displaying a single notice.
+ *
+ * This uses all the other methods to correctly display a notice. Override
+ * it or one of the others to fine-tune the output.
+ *
+ * @return void
+ */
+ function show()
+ {
+ $this->showStart();
+ $this->showMiniForm();
+ $this->showEnd();
+ }
+
+ /**
+ * start a single notice.
+ *
+ * @return void
+ */
+ function showStart()
+ {
+ $this->out->elementStart('li', array('class' => 'notice-reply-comments'));
+ }
+
+ function showEnd()
+ {
+ $this->out->elementEnd('li');
+ }
+
+ function showMiniForm()
+ {
+ $id = $this->notice->conversation;
+ $url = common_local_url('conversation', array('id' => $id));
+
+ $n = Conversation::noticeCount($id) - 1;
+
+ // TRANS: Link to show replies for a notice.
+ // TRANS: %d is the number of replies to a notice and used for plural.
+ $msg = sprintf(_m('Show reply', 'Show all %d replies', $n), $n);
+
+ $this->out->element('a', array('href' => $url), $msg);
+ }
+}
diff --git a/lib/threadednoticelistsubitem.php b/lib/threadednoticelistsubitem.php
new file mode 100644
index 0000000000..99c6498d01
--- /dev/null
+++ b/lib/threadednoticelistsubitem.php
@@ -0,0 +1,57 @@
+root = $root;
+ parent::__construct($notice, $out);
+ }
+
+ function avatarSize()
+ {
+ return AVATAR_STREAM_SIZE; // @fixme would like something in between
+ }
+
+ function showNoticeLocation()
+ {
+ //
+ }
+
+ function showNoticeSource()
+ {
+ //
+ }
+
+ function getAttentionProfiles()
+ {
+ $all = parent::getAttentionProfiles();
+
+ $profiles = array();
+
+ $rootAuthor = $this->root->getProfile();
+
+ foreach ($all as $profile) {
+ if ($profile->id != $rootAuthor->id) {
+ $profiles[] = $profile;
+ }
+ }
+
+ return $profiles;
+ }
+
+ function showEnd()
+ {
+ $threadActive = null; // unused here for now, but maybe in the future?
+ if (Event::handle('StartShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive))) {
+ // Repeats and Faves/Likes are handled in plugins.
+ Event::handle('EndShowThreadedNoticeTailItems', array($this, $this->notice, &$threadActive));
+ }
+ parent::showEnd();
+ }
+}
From cdcf6cdb25a68a7374abf30bd9fb71655b0a3f9f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:42:28 +0100
Subject: [PATCH 116/415] Hacky method to avoid cutting conversation "more"
link out
---
lib/threadednoticelistitem.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/threadednoticelistitem.php b/lib/threadednoticelistitem.php
index 7e72f6aa23..81b9d2defd 100644
--- a/lib/threadednoticelistitem.php
+++ b/lib/threadednoticelistitem.php
@@ -61,6 +61,11 @@ class ThreadedNoticeListItem extends NoticeListItem
// Skip!
continue;
}
+
+ if (!$notice->isVerb([ActivityVerb::POST])) {
+ continue;
+ }
+
$cnt++;
if ($cnt > $max) {
// boo-yah
From e64c3a1d87d7747c0afc136dcabbdd579cc694ea Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:46:28 +0100
Subject: [PATCH 117/415] irc and ircs schemes for HTMLPurifier
---
.../lib/htmlpurifier/urischeme/irc.php | 36 ++++++++++++++++
.../lib/htmlpurifier/urischeme/ircs.php | 41 +++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
create mode 100644 plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
new file mode 100644
index 0000000000..53456e4bf1
--- /dev/null
+++ b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
@@ -0,0 +1,36 @@
+userinfo = null;
+ return true;
+ }
+}
+
+// vim: et sw=4 sts=4
diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
new file mode 100644
index 0000000000..5f158862a3
--- /dev/null
+++ b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
@@ -0,0 +1,41 @@
+userinfo = null;
+ return true;
+ }
+}
+
+// vim: et sw=4 sts=4
From b7c4c960e2cb966d892f248eb8dfd8462b8f6db1 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:48:37 +0100
Subject: [PATCH 118/415] Don't use default_port for irc schemes
---
plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php | 2 +-
plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
index 53456e4bf1..f44b4f2b6b 100644
--- a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
+++ b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/irc.php
@@ -8,7 +8,7 @@ class HTMLPurifier_URIScheme_irc extends HTMLPurifier_URIScheme
/**
* @type int
*/
- public $default_port = 6667;
+// public $default_port = 6667;
/**
* @type bool
diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
index 5f158862a3..d446bb7b0d 100644
--- a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
+++ b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/ircs.php
@@ -8,7 +8,7 @@ class HTMLPurifier_URIScheme_ircs extends HTMLPurifier_URIScheme
/**
* @type int
*/
- public $default_port = 6697;
+// public $default_port = 6697;
/**
* @type bool
From 78e23bd4ec426b61428c4aa4a89c0fc2f805d11d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:55:10 +0100
Subject: [PATCH 119/415] Fix issue #171 with latent htmLawed reference
---
scripts/importtwitteratom.php | 8 +-------
scripts/restoreuser.php | 1 -
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/scripts/importtwitteratom.php b/scripts/importtwitteratom.php
index 1a08dd7488..2a4cb7fc41 100755
--- a/scripts/importtwitteratom.php
+++ b/scripts/importtwitteratom.php
@@ -34,7 +34,6 @@ import an Atom feed from Twitter as notices by a user
END_OF_IMPORTTWITTERATOM_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
-require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
function getAtomFeedDocument()
{
@@ -82,12 +81,7 @@ function importActivityStream($user, $doc)
if (!have_option('q', 'quiet')) {
print $activity->content . "\n";
}
- $html = getTweetHtml($object->link);
-
- $config = array('safe' => 1,
- 'deny_attribute' => 'class,rel,id,style,on*');
-
- $html = htmLawed($html, $config);
+ $html = common_purify(getTweetHtml($object->link));
$content = html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8');
diff --git a/scripts/restoreuser.php b/scripts/restoreuser.php
index 17f007b412..6c287ad667 100644
--- a/scripts/restoreuser.php
+++ b/scripts/restoreuser.php
@@ -34,7 +34,6 @@ neither ID or name provided, will create a new user.
END_OF_RESTOREUSER_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
-require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
function getActivityStreamDocument()
From cd24f7d30a2e2190d2a0e6ae5e33ee6e67489249 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 02:56:47 +0100
Subject: [PATCH 120/415] Issue #166 - we test exif data below, no need for
error output
---
lib/imagefile.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/imagefile.php b/lib/imagefile.php
index c707208af6..a328df9852 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -95,7 +95,7 @@ class ImageFile
if ($this->type == IMAGETYPE_JPEG && function_exists('exif_read_data')) {
// Orientation value to rotate thumbnails properly
- $exif = exif_read_data($this->filepath);
+ $exif = @exif_read_data($this->filepath);
if (is_array($exif) && isset($exif['Orientation'])) {
switch ((int)$exif['Orientation']) {
case 1: // top is top
From 50a10cf1615fab6c4fefc397e7637d9a19d0278c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 03:02:22 +0100
Subject: [PATCH 121/415] Minify is evil.
---
plugins/Minify/MinifyPlugin.php | 171 --
plugins/Minify/README | 34 -
plugins/Minify/actions/minify.php | 116 -
plugins/Minify/extlib/minify/HISTORY.txt | 75 -
plugins/Minify/extlib/minify/LICENSE.txt | 26 -
plugins/Minify/extlib/minify/README.txt | 53 -
plugins/Minify/extlib/minify/UPGRADING.txt | 35 -
plugins/Minify/extlib/minify/min/README.txt | 132 --
.../extlib/minify/min/builder/_index.js | 242 ---
.../Minify/extlib/minify/min/builder/bm.js | 36 -
.../extlib/minify/min/builder/index.php | 182 --
.../extlib/minify/min/builder/ocCheck.php | 36 -
.../extlib/minify/min/builder/rewriteTest.js | 1 -
.../Minify/extlib/minify/min/groupsConfig.php | 34 -
plugins/Minify/extlib/minify/min/index.php | 66 -
.../Minify/extlib/minify/min/lib/FirePHP.php | 1370 ------------
.../minify/min/lib/HTTP/ConditionalGet.php | 348 ---
.../extlib/minify/min/lib/HTTP/Encoder.php | 326 ---
.../Minify/extlib/minify/min/lib/JSMin.php | 314 ---
.../extlib/minify/min/lib/JSMinPlus.php | 1872 -----------------
.../Minify/extlib/minify/min/lib/Minify.php | 532 -----
.../extlib/minify/min/lib/Minify/Build.php | 103 -
.../extlib/minify/min/lib/Minify/CSS.php | 83 -
.../minify/min/lib/Minify/CSS/Compressor.php | 250 ---
.../minify/min/lib/Minify/CSS/UriRewriter.php | 270 ---
.../minify/min/lib/Minify/Cache/APC.php | 130 --
.../minify/min/lib/Minify/Cache/File.php | 125 --
.../minify/min/lib/Minify/Cache/Memcache.php | 137 --
.../min/lib/Minify/CommentPreserver.php | 90 -
.../minify/min/lib/Minify/Controller/Base.php | 202 --
.../min/lib/Minify/Controller/Files.php | 78 -
.../min/lib/Minify/Controller/Groups.php | 94 -
.../min/lib/Minify/Controller/MinApp.php | 132 --
.../minify/min/lib/Minify/Controller/Page.php | 82 -
.../min/lib/Minify/Controller/Version1.php | 118 --
.../extlib/minify/min/lib/Minify/HTML.php | 245 ---
.../minify/min/lib/Minify/ImportProcessor.php | 157 --
.../extlib/minify/min/lib/Minify/Lines.php | 131 --
.../extlib/minify/min/lib/Minify/Logger.php | 45 -
.../extlib/minify/min/lib/Minify/Packer.php | 37 -
.../extlib/minify/min/lib/Minify/Source.php | 187 --
.../minify/min/lib/Minify/YUICompressor.php | 139 --
.../extlib/minify/min/lib/Solar/Dir.php | 199 --
plugins/Minify/extlib/minify/min/utils.php | 90 -
plugins/Minify/locale/Minify.pot | 40 -
.../Minify/locale/af/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ar/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/arz/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ast/LC_MESSAGES/Minify.po | 42 -
.../locale/be-tarask/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/bg/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/bn_IN/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/br/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ca/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/cs/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/da/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/de/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/el/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/en_GB/LC_MESSAGES/Minify.po | 43 -
.../Minify/locale/eo/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/es/LC_MESSAGES/Minify.po | 43 -
.../Minify/locale/eu/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/fa/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/fi/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/fr/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/fur/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/gl/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/he/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/hsb/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/hu/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/hy_AM/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ia/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/id/LC_MESSAGES/Minify.po | 43 -
.../Minify/locale/io/LC_MESSAGES/Minify.po | 43 -
.../Minify/locale/is/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/it/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ja/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ka/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ko/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ksh/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/lb/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/lt/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/lv/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/mg/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/mk/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ml/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ms/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/my/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/nb/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ne/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/nl/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/nn/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/pl/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/pt/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/pt_BR/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ro_RO/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ru/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/sl/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/sr-ec/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/sv/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ta/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/te/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/tl/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/tr/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/uk/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/ur_PK/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/vi/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/zh/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/zh_CN/LC_MESSAGES/Minify.po | 42 -
.../Minify/locale/zh_TW/LC_MESSAGES/Minify.po | 42 -
110 files changed, 11899 deletions(-)
delete mode 100644 plugins/Minify/MinifyPlugin.php
delete mode 100644 plugins/Minify/README
delete mode 100644 plugins/Minify/actions/minify.php
delete mode 100644 plugins/Minify/extlib/minify/HISTORY.txt
delete mode 100644 plugins/Minify/extlib/minify/LICENSE.txt
delete mode 100644 plugins/Minify/extlib/minify/README.txt
delete mode 100644 plugins/Minify/extlib/minify/UPGRADING.txt
delete mode 100644 plugins/Minify/extlib/minify/min/README.txt
delete mode 100644 plugins/Minify/extlib/minify/min/builder/_index.js
delete mode 100644 plugins/Minify/extlib/minify/min/builder/bm.js
delete mode 100644 plugins/Minify/extlib/minify/min/builder/index.php
delete mode 100644 plugins/Minify/extlib/minify/min/builder/ocCheck.php
delete mode 100644 plugins/Minify/extlib/minify/min/builder/rewriteTest.js
delete mode 100644 plugins/Minify/extlib/minify/min/groupsConfig.php
delete mode 100644 plugins/Minify/extlib/minify/min/index.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/FirePHP.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/HTTP/ConditionalGet.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/HTTP/Encoder.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/JSMin.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/JSMinPlus.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Build.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/CSS.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/CSS/Compressor.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/CSS/UriRewriter.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Cache/APC.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Cache/File.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Cache/Memcache.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/CommentPreserver.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/Base.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/Files.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/Groups.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/MinApp.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/Page.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Controller/Version1.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/HTML.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/ImportProcessor.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Lines.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Logger.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Packer.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/Source.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Minify/YUICompressor.php
delete mode 100644 plugins/Minify/extlib/minify/min/lib/Solar/Dir.php
delete mode 100644 plugins/Minify/extlib/minify/min/utils.php
delete mode 100644 plugins/Minify/locale/Minify.pot
delete mode 100644 plugins/Minify/locale/af/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ar/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/arz/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ast/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/be-tarask/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/bg/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/bn_IN/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/br/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ca/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/cs/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/da/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/de/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/el/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/en_GB/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/eo/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/es/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/eu/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/fa/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/fi/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/fr/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/fur/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/gl/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/he/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/hsb/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/hu/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/hy_AM/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ia/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/id/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/io/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/is/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/it/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ja/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ka/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ko/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ksh/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/lb/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/lt/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/lv/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/mg/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/mk/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ml/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ms/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/my/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/nb/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ne/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/nl/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/nn/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/pl/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/pt/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/pt_BR/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ro_RO/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ru/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/sl/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/sr-ec/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/sv/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ta/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/te/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/tl/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/tr/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/uk/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/ur_PK/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/vi/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/zh/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/zh_CN/LC_MESSAGES/Minify.po
delete mode 100644 plugins/Minify/locale/zh_TW/LC_MESSAGES/Minify.po
diff --git a/plugins/Minify/MinifyPlugin.php b/plugins/Minify/MinifyPlugin.php
deleted file mode 100644
index b970cd20c6..0000000000
--- a/plugins/Minify/MinifyPlugin.php
+++ /dev/null
@@ -1,171 +0,0 @@
-
-Author URI: http://candrews.integralblue.com/
-*/
-
-/*
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2009, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-/**
- * @package MinifyPlugin
- * @maintainer Craig Andrews
- * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-// We bundle the minify library...
-set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/minify/min/lib');
-
-class MinifyPlugin extends Plugin
-{
- private $minifyInlineJs = true;
- private $minifyInlineCss = true;
-
- const cacheKey = 'minify';
-
- /**
- * Add Minification related paths to the router table
- *
- * Hook for RouterInitialized event.
- *
- * @return boolean hook return
- */
- function onStartInitializeRouter($m)
- {
- $m->connect('main/min',
- array('action' => 'minify'));
- return true;
- }
-
- function onLoginAction($action, &$login)
- {
- switch ($action)
- {
- case 'minify':
- $login = true;
- return false;
- default:
- return true;
- }
- }
-
- function onStartScriptElement($action,&$src,&$type) {
- $url = parse_url($src);
- if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
- {
- if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
- $src = $this->minifyUrl($src);
- } else {
- $src = $this->minifyUrl('js/'.$src);
- }
- }
- }
-
- function onStartCssLinkElement($action,&$src,&$theme,&$media) {
- $allowThemeMinification =
- is_null(common_config('theme', 'dir'))
- && is_null(common_config('theme', 'path'))
- && is_null(common_config('theme', 'server'));
- $url = parse_url($src);
- if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
- {
- if(!isset($theme)) {
- $theme = common_config('site', 'theme');
- }
- if($allowThemeMinification && file_exists(INSTALLDIR.'/local/theme/'.$theme.'/'.$src)) {
- $src = $this->minifyUrl('local/theme/'.$theme.'/'.$src);
- } else if($allowThemeMinification && file_exists(INSTALLDIR.'/theme/'.$theme.'/'.$src)) {
- $src = $this->minifyUrl('theme/'.$theme.'/'.$src);
- }else if(file_exists(INSTALLDIR.'/'.$src)){
- $src = $this->minifyUrl($src);
- }
- }
- }
-
- function onStartInlineScriptElement($action,&$code,&$type)
- {
- if($this->minifyInlineJs && $type=='text/javascript'){
- $c = Cache::instance();
- if (!empty($c)) {
- $cacheKey = Cache::key(self::cacheKey . ':' . crc32($code));
- $out = $c->get($cacheKey);
- }
- if(empty($out)) {
- $out = $this->minifyJs($code);
- }
- if (!empty($c)) {
- $c->set($cacheKey, $out);
- }
- if(!empty($out)) {
- $code = $out;
- }
- }
- }
-
- function onStartStyleElement($action,&$code,&$type,&$media)
- {
- if($this->minifyInlineCss && $type=='text/css'){
- $c = Cache::instance();
- if (!empty($c)) {
- $cacheKey = Cache::key(self::cacheKey . ':' . crc32($code));
- $out = $c->get($cacheKey);
- }
- if(empty($out)) {
- $out = $this->minifyCss($code);
- }
- if (!empty($c)) {
- $c->set($cacheKey, $out);
- }
- if(!empty($out)) {
- $code = $out;
- }
- }
- }
-
- function minifyUrl($src) {
- return common_local_url('minify',null,array('f' => $src ,v => GNUSOCIAL_VERSION));
- }
-
- static function minifyJs($code) {
- require_once('JSMin.php');
- return JSMin::minify($code);
- }
-
- static function minifyCss($code, $options = array()) {
- require_once('Minify/CSS.php');
- return Minify_CSS::minify($code,$options);
- }
-
- function onPluginVersion(array &$versions)
- {
- $versions[] = array('name' => 'Minify',
- 'version' => GNUSOCIAL_VERSION,
- 'author' => 'Craig Andrews',
- 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Minify',
- 'rawdescription' =>
- // TRANS: Plugin description.
- _m('The Minify plugin minifies StatusNet\'s CSS and JavaScript, removing whitespace and comments.'));
- return true;
- }
-}
diff --git a/plugins/Minify/README b/plugins/Minify/README
deleted file mode 100644
index 97fa7dadf9..0000000000
--- a/plugins/Minify/README
+++ /dev/null
@@ -1,34 +0,0 @@
-The Minify plugin minifies your CSS and Javascript, removing whitespace and
-comments.
-
-Note that if enabled this plugin and use a theme server,
- (if any of $config['theme']['server'], $config['theme']['path'],
- $config['theme']['dir'] are set) theme CSS will not be minified.
-
-This plugin will use memcache, if it is available, for storing minified inline
- and file javascript and css. Because minification is non-trivial, using
- memcache is recommended.
-
-Installation
-============
-add "addPlugin('minify',
- array('setting'=>'value', 'setting2'=>'value2', ...);"
-to the bottom of your config.php
-
-Settings
-========
-minifyInlineJs (true): Minify inline javascript.
- Because caching isn'tas effective for inline resources (due to its more
- dynamic nature) than static files, minifying inline resources may adversely
- affect performance for higher volume sites. Testing (and memcache usage)
- are highly recommended.
-minifyInlineCss (true): Minify inline CSS.
- Because caching isn'tas effective for inline resources (due to its more
- dynamic nature) than static files, minifying inline resources may adversely
- affect performance for higher volume sites. Testing (and memcache usage)
- are highly recommended.
-
-Example
-=======
-
-addPlugin('minify', array());
diff --git a/plugins/Minify/actions/minify.php b/plugins/Minify/actions/minify.php
deleted file mode 100644
index d7ec5d1392..0000000000
--- a/plugins/Minify/actions/minify.php
+++ /dev/null
@@ -1,116 +0,0 @@
-.
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-class MinifyAction extends Action
-{
- const TYPE_CSS = 'text/css';
- const TYPE_HTML = 'text/html';
- // there is some debate over the ideal JS Content-Type, but this is the
- // Apache default and what Yahoo! uses..
- const TYPE_JS = 'application/x-javascript';
-
- var $file;
- var $v;
-
- function isReadOnly($args)
- {
- return true;
- }
-
- function prepare($args)
- {
- parent::prepare($args);
- $this->v = $args['v'];
-
- $f = $this->arg('f');
- if(isset($f)) {
- $this->file = INSTALLDIR.'/'.$f;
- if(file_exists($this->file)) {
- return true;
- } else {
- // TRANS: Client error displayed when not providing a valid path in parameter "f".
- $this->clientError(_m('The parameter "f" is not a valid path.'),404);
- }
- }else{
- // TRANS: Client error displayed when not providing parameter "f".
- $this->clientError(_m('The parameter "f" is required but missing.'),500);
- }
- }
-
- function etag()
- {
- if(isset($this->v)) {
- return "\"" . crc32($this->file . $this->v) . "\"";
- }else{
- $stat = stat($this->file);
- return '"' . $stat['ino'] . '-' . $stat['size'] . '-' . $stat['mtime'] . '"';
- }
- }
-
- function lastModified()
- {
- return filemtime($this->file);
- }
-
- function handle($args)
- {
- parent::handle($args);
-
- $c = Cache::instance();
- if (!empty($c)) {
- $cacheKey = Cache::key(MinifyPlugin::cacheKey . ':' . $this->file . '?v=' . empty($this->v)?'':$this->v);
- $out = $c->get($cacheKey);
- }
- if(empty($out)) {
- $out = $this->minify($this->file);
- }
- if (!empty($c)) {
- $c->set($cacheKey, $out);
- }
-
- $sec = session_cache_expire() * 60;
- header('Cache-Control: public, max-age=' . $sec);
- header('Pragma: public');
- $this->raw($out);
- }
-
- function minify($file)
- {
- $info = pathinfo($file);
- switch(strtolower($info['extension'])){
- case 'js':
- $out = MinifyPlugin::minifyJs(file_get_contents($file));
- header('Content-Type: ' . self::TYPE_JS);
- break;
- case 'css':
- $options = array();
- $options['currentDir'] = dirname($file);
- $options['docRoot'] = INSTALLDIR;
- $out = MinifyPlugin::minifyCss(file_get_contents($file),$options);
- header('Content-Type: ' . self::TYPE_CSS);
- break;
- default:
- // TRANS: Client error displayed when trying to minify an unsupported file type.
- $this->clientError(_m('File type not supported.'),500);
- }
- return $out;
- }
-}
diff --git a/plugins/Minify/extlib/minify/HISTORY.txt b/plugins/Minify/extlib/minify/HISTORY.txt
deleted file mode 100644
index 95a46c87ec..0000000000
--- a/plugins/Minify/extlib/minify/HISTORY.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-Minify Release History
-
-Version 2.1.3
- * HTTP fixes
- * ETag generation now valid (different when gzipped)
- * Vary header always sent when Accept-Encoding is sniffed
- * Cache-Control no longer has "must-revalidate" due to webkit bug
- See: http://mrclay.org/index.php/2009/02/24/safari-4-beta-cache-controlmust-revalidate-bug/
- * Dropped deflate encoding. Browser and proxy support could be buggy.
- See: http://stackoverflow.com/questions/883841/
- * File cache now works w/o setting $min_cachePath
- * Allow setting contentType in Minify_Source objects
- * No more 5.3 deprecation warnings: split() removed
-
-Version 2.1.2
- * Javascript fixes
- * Debug mode no longer confused by "*/*" in strings/RegExps (jQuery)
- * quote characters inside RegExp literals no longer cause exception
- * files ending in single-line comments no longer cause code loss
- * CSS: data: URLs no longer mangled
- * Optional error logging to Firefox's FirePHP extension
- * Unit tests to check for common DOCUMENT_ROOT problems
- * DOCUMENT_ROOT no longer overwritten on IIS servers
- * Builder app doesn't fail on systems without gzdeflate()
- * APC caching class included
-
-Version 2.1.1
- * Bug fix release
- * Detection and workarounds for zlib.output_compression and non-PHP encoding modules
- * Zlib not required (mod_rewrite, et.al., can still be used for encoding)
- * HTML : More IE conditional comments preserved
- * Minify_groupUri() utility fixed
-
-Version 2.1.0
- * "min" default application for quick deployment
- * Minify URI Builder app & bookmarklet for quickly creating minify URIs
- * Relative URIs in CSS file are fixed automatically by default
- * "debug" mode for revealing original line #s in combined files
- * Better IIS support
- * Improved minifier classes:
- * JS: preserves IE conditional comments
- * CSS: smaller output, preserves more hacks and valid CSS syntax,
- shorter line lengths, other bug fixes
- * HTML: smaller output, shorter line lengths, other bug fixes
- * Default Cache-Control: max-age of 30 minutes
- * Conditional GETs supported even when max-age sent
- * Experimental memcache cache class (default is files)
- * Minify_Cache_File has flock()s (by default)
- * Workaround for Windows mtime reporting bug
-
-Version 2.0.2 beta (2008-06-24)
- * Fast new cache system. Cached files served almost 3x as fast.
- * Dropped support of compress encoding (though HTTP_Encoder still supports it)
-
-Version 2.0.1 (2008-05-31)
- * E_STRICT compliance (Cache_Lite_File).
-
-Version 2.0.0 (2008-05-22)
- * Complete code overhaul. Minify is now a PEAR-style class and toolkit
- for building customized minifying file servers.
- * Content-Encoding: deflate/gzip/compress, based on request headers
- * Expanded CSS and HTML minifiers with test cases
- * Easily plug-in 3rd-party minifiers (like Packer)
- * Plug-able front end controller allows changing the way files are chosen
- * Compression & encoding modules lazy-loaded as needed (304 responses use
- use minimal code)
- * Separate utility classes for HTTP encoding and cache control
-
-Version 1.0.1 (2007-05-05)
- * Fixed various problems resolving pathnames when hosted on an NFS mount.
- * Fixed 'undefined constant' notice.
- * Replaced old JSMin library with a much faster custom implementation.
-
-Version 1.0.0 (2007-05-02)
- * First release.
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/LICENSE.txt b/plugins/Minify/extlib/minify/LICENSE.txt
deleted file mode 100644
index 8f008adb56..0000000000
--- a/plugins/Minify/extlib/minify/LICENSE.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 2008 Ryan Grove
-Copyright (c) 2008 Steve Clay
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of this project nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/plugins/Minify/extlib/minify/README.txt b/plugins/Minify/extlib/minify/README.txt
deleted file mode 100644
index 3899b99536..0000000000
--- a/plugins/Minify/extlib/minify/README.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-WELCOME TO MINIFY 2.1!
-
-Minify is an HTTP content server. It compresses sources of content
-(usually files), combines the result and serves it with appropriate
-HTTP headers. These headers can allow clients to perform conditional
-GETs (serving content only when clients do not have a valid cache)
-and tell clients to cache the file for a period of time.
-More info: http://code.google.com/p/minify/
-
-
-UPGRADING
-
-See UPGRADING.txt for instructions.
-
-
-INSTALLATION AND USAGE:
-
-1. Place the /min/ directory as a child of your DOCUMENT_ROOT
-directory: i.e. you will have: /home/user/www/public_html/min
-
-2. Open http://yourdomain/min/ in a web browser. This will forward
-you to the Minify URI Builder application, which will help you
-quickly start using Minify to serve content on your site.
-
-
-UNIT TESTING:
-
-1. Place the /min_unit_tests/ directory as a child of your DOCUMENT_ROOT
-directory: i.e. you will have: /home/user/www/public_html/min_unit_tests
-
-2. To run unit tests, access: http://yourdomain/min_unit_tests/test_all.php
-
-(If you wish, the other test_*.php files can be run to test individual
-components with more verbose output.)
-
-3. Remove /min_unit_tests/ from your DOCUMENT_ROOT when you are done.
-
-
-EXTRAS:
-
-The min_extras folder contains files for benchmarking using Apache ab on Windows
-and a couple single-use tools. DO NOT place this on your production server.
-
-
-FILE ENCODINGS
-
-Minify *should* work fine with files encoded in UTF-8 or other 8-bit
-encodings like ISO 8859/Windows-1252. By default Minify appends
-";charset=utf-8" to the Content-Type headers it sends.
-
-Leading UTF-8 BOMs are stripped from all sources to prevent
-duplication in output files, and files are converted to Unix newlines.
-
diff --git a/plugins/Minify/extlib/minify/UPGRADING.txt b/plugins/Minify/extlib/minify/UPGRADING.txt
deleted file mode 100644
index 5025faf9b7..0000000000
--- a/plugins/Minify/extlib/minify/UPGRADING.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Minify Upgrade Guide
-
-UPGRADING FROM 2.1.*
-
-1. Rename the following files:
-
- /min/config.php --> /min/old_config.php
- /min/groupsConfig.php --> /min/old_groupsConfig.php
-
-2. Overwrite all files in /min (and /min_unit_tests) with those from this zip.
-
-3. Delete /min/groupsConfig.php
-
-4. Rename /min/old_groupsConfig.php --> /min/groupsConfig.php
-
-5. Merge your settings in old_config.php into config.php.
-
- * If you've set $_SERVER['DOCUMENT_ROOT'], instead set the new option
- $min_documentRoot. This is advantageous on IIS systems because Minify
- will no longer overwrite the path you specified.
-
- * $min_errorLogger adds the ability to enable FirePHP logging.
-
-6. (optional) Delete /min/old_config.php and the Minify files from your cache
- directory (specified in $min_cachePath).
-
-
-INSTALLING FRESH
-
-See README.txt for instructions on installing this app for the first time.
-
-
-SUPPORT
-
-Send a message to http://groups.google.com/group/minify
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/README.txt b/plugins/Minify/extlib/minify/min/README.txt
deleted file mode 100644
index a7cf774a18..0000000000
--- a/plugins/Minify/extlib/minify/min/README.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-The files in this directory represent the default Minify setup designed to ease
-integration with your site. This app will combine and minify your Javascript or
-CSS files and serve them with HTTP compression and cache headers.
-
-
-RECOMMENDED
-
-It's recommended to edit config.php to set $min_cachePath to a writeable
-(by PHP) directory on your system. This will improve performance.
-
-
-GETTING STARTED
-
-The quickest way to get started is to use the Minify URI Builder application
-on your website: http://example.com/min/builder/
-
-
-MINIFYING A SINGLE FILE
-
-Let's say you want to serve this file:
- http://example.com/wp-content/themes/default/default.css
-
-Here's the "Minify URL" for this file:
- http://example.com/min/?f=wp-content/themes/default/default.css
-
-In other words, the "f" argument is set to the file path from root without the
-initial "/". As CSS files may contain relative URIs, Minify will automatically
-"fix" these by rewriting them as root relative.
-
-
-COMBINING MULTIPLE FILES IN ONE DOWNLOAD
-
-Separate the paths given to "f" with commas.
-
-Let's say you have CSS files at these URLs:
- http://example.com/scripts/jquery-1.2.6.js
- http://example.com/scripts/site.js
-
-You can combine these files through Minify by requesting this URL:
- http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js
-
-
-SIMPLIFYING URLS WITH A BASE PATH
-
-If you're combining files that share the same ancestor directory, you can use
-the "b" argument to set the base directory for the "f" argument. Do not include
-the leading or trailing "/" characters.
-
-E.g., the following URLs will serve the exact same content:
- http://example.com/min/?f=scripts/jquery-1.2.6.js,scripts/site.js,scripts/home.js
- http://example.com/min/?b=scripts&f=jquery-1.2.6.js,site.js,home.js
-
-
-MINIFY URLS IN HTML
-
-In (X)HTML files, don't forget to replace any "&" characters with "&".
-
-
-SPECIFYING ALLOWED DIRECTORIES
-
-By default, Minify will serve any *.css/*.js files within the DOCUMENT_ROOT. If
-you'd prefer to limit Minify's access to certain directories, set the
-$min_serveOptions['minApp']['allowDirs'] array in config.php. E.g. to limit
-to the /js and /themes/default directories, use:
-
-$min_serveOptions['minApp']['allowDirs'] = array('//js', '//themes/default');
-
-
-GROUPS: FASTER PERFORMANCE AND BETTER URLS
-
-For the best performance, edit groupsConfig.php to pre-specify groups of files
-to be combined under preset keys. E.g., here's an example configuration in
-groupsConfig.php:
-
-return array(
- 'js' => array('//js/Class.js', '//js/email.js')
-);
-
-This pre-selects the following files to be combined under the key "js":
- http://example.com/js/Class.js
- http://example.com/js/email.js
-
-You can now serve these files with this simple URL:
- http://example.com/min/?g=js
-
-
-GROUPS: SPECIFYING FILES OUTSIDE THE DOC_ROOT
-
-In the groupsConfig.php array, the "//" in the file paths is a shortcut for
-the DOCUMENT_ROOT, but you can also specify paths from the root of the filesystem
-or relative to the DOC_ROOT:
-
-return array(
- 'js' => array(
- '//js/file.js' // file within DOC_ROOT
- ,'//../file.js' // file in parent directory of DOC_ROOT
- ,'C:/Users/Steve/file.js' // file anywhere on filesystem
- )
-);
-
-
-FAR-FUTURE EXPIRES HEADERS
-
-Minify can send far-future (one year) Expires headers. To enable this you must
-add a number to the querystring (e.g. /min/?g=js&1234 or /min/f=file.js&1234)
-and alter it whenever a source file is changed. If you have a build process you
-can use a build/source control revision number.
-
-If you serve files as a group, you can use the utility function Minify_groupUri()
-to get a "versioned" Minify URI for use in your HTML. E.g.:
-
-";
-
-
-DEBUG MODE
-
-In debug mode, instead of compressing files, Minify sends combined files with
-comments prepended to each line to show the line number in the original source
-file. To enable this, set $min_allowDebugFlag to true in config.php and append
-"&debug=1" to your URIs. E.g. /min/?f=script1.js,script2.js&debug=1
-
-Known issue: files with comment-like strings/regexps can cause problems in this mode.
-
-
-QUESTIONS?
-
-http://groups.google.com/group/minify
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/builder/_index.js b/plugins/Minify/extlib/minify/min/builder/_index.js
deleted file mode 100644
index 8e5313a3b1..0000000000
--- a/plugins/Minify/extlib/minify/min/builder/_index.js
+++ /dev/null
@@ -1,242 +0,0 @@
-var MUB = {
- _uid : 0
- ,_minRoot : '/min/?'
- ,checkRewrite : function () {
- var testUri = location.pathname.replace(/\/[^\/]*$/, '/rewriteTest.js').substr(1);
- function fail() {
- $('#minRewriteFailed')[0].className = 'topNote';
- };
- $.ajax({
- url : '../f=' + testUri + '&' + (new Date()).getTime()
- ,success : function (data) {
- if (data === '1') {
- MUB._minRoot = '/min/';
- $('span.minRoot').html('/min/');
- } else
- fail();
- }
- ,error : fail
- });
- }
- /**
- * Get markup for new source LI element
- */
- ,newLi : function () {
- return 'http://' + location.host + '/ '
- + ' x ↑ '
- + ' ↓ ';
- }
- /**
- * Add new empty source LI and attach handlers to buttons
- */
- ,addLi : function () {
- $('#sources').append(MUB.newLi());
- var li = $('#li' + MUB._uid)[0];
- $('button[title=Remove]', li).click(function () {
- $('#results').hide();
- var hadValue = !!$('input', li)[0].value;
- $(li).remove();
- });
- $('button[title$=Earlier]', li).click(function () {
- $(li).prev('li').find('input').each(function () {
- $('#results').hide();
- // this = previous li input
- var tmp = this.value;
- this.value = $('input', li).val();
- $('input', li).val(tmp);
- MUB.updateAllTestLinks();
- });
- });
- $('button[title$=Later]', li).click(function () {
- $(li).next('li').find('input').each(function () {
- $('#results').hide();
- // this = next li input
- var tmp = this.value;
- this.value = $('input', li).val();
- $('input', li).val(tmp);
- MUB.updateAllTestLinks();
- });
- });
- ++MUB._uid;
- }
- /**
- * In the context of a source LI element, this will analyze the URI in
- * the INPUT and check the URL on the site.
- */
- ,liUpdateTestLink : function () { // call in context of li element
- if (! $('input', this)[0].value)
- return;
- var li = this;
- $('span', this).html('');
- var url = 'http://' + location.host + '/'
- + $('input', this)[0].value.replace(/^\//, '');
- $.ajax({
- url : url
- ,complete : function (xhr, stat) {
- if ('success' == stat)
- $('span', li).html('✓');
- else {
- $('span', li).html('404! recheck ')
- .find('button').click(function () {
- MUB.liUpdateTestLink.call(li);
- });
- }
- }
- ,dataType : 'text'
- });
- }
- /**
- * Check all source URLs
- */
- ,updateAllTestLinks : function () {
- $('#sources li').each(MUB.liUpdateTestLink);
- }
- /**
- * In a given array of strings, find the character they all have at
- * a particular index
- * @param Array arr array of strings
- * @param Number pos index to check
- * @return mixed a common char or '' if any do not match
- */
- ,getCommonCharAtPos : function (arr, pos) {
- var i
- ,l = arr.length
- ,c = arr[0].charAt(pos);
- if (c === '' || l === 1)
- return c;
- for (i = 1; i < l; ++i)
- if (arr[i].charAt(pos) !== c)
- return '';
- return c;
- }
- /**
- * Get the shortest URI to minify the set of source files
- * @param Array sources URIs
- */
- ,getBestUri : function (sources) {
- var pos = 0
- ,base = ''
- ,c;
- while (true) {
- c = MUB.getCommonCharAtPos(sources, pos);
- if (c === '')
- break;
- else
- base += c;
- ++pos;
- }
- base = base.replace(/[^\/]+$/, '');
- var uri = MUB._minRoot + 'f=' + sources.join(',');
- if (base.charAt(base.length - 1) === '/') {
- // we have a base dir!
- var basedSources = sources
- ,i
- ,l = sources.length;
- for (i = 0; i < l; ++i) {
- basedSources[i] = sources[i].substr(base.length);
- }
- base = base.substr(0, base.length - 1);
- var bUri = MUB._minRoot + 'b=' + base + '&f=' + basedSources.join(',');
- //window.console && console.log([uri, bUri]);
- uri = uri.length < bUri.length
- ? uri
- : bUri;
- }
- return uri;
- }
- /**
- * Create the Minify URI for the sources
- */
- ,update : function () {
- MUB.updateAllTestLinks();
- var sources = []
- ,ext = false
- ,fail = false;
- $('#sources input').each(function () {
- var m, val;
- if (! fail && this.value && (m = this.value.match(/\.(css|js)$/))) {
- var thisExt = m[1];
- if (ext === false)
- ext = thisExt;
- else if (thisExt !== ext) {
- fail = true;
- return alert('extensions must match!');
- }
- this.value = this.value.replace(/^\//, '');
- if (-1 != $.inArray(this.value, sources)) {
- fail = true;
- return alert('duplicate file!');
- }
- sources.push(this.value);
- }
- });
- if (fail || ! sources.length)
- return;
- $('#groupConfig').val(" 'keyName' => array('//" + sources.join("', '//") + "'),");
- var uri = MUB.getBestUri(sources)
- ,uriH = uri.replace(/, '<').replace(/>/, '>').replace(/&/, '&');
- $('#uriA').html(uriH)[0].href = uri;
- $('#uriHtml').val(
- ext === 'js'
- ? ''
- : ' '
- );
- $('#results').show();
- }
- /**
- * Handler for the "Add file +" button
- */
- ,addButtonClick : function () {
- $('#results').hide();
- MUB.addLi();
- MUB.updateAllTestLinks();
- $('#update').show().click(MUB.update);
- $('#sources li:last input')[0].focus();
- }
- /**
- * Runs on DOMready
- */
- ,init : function () {
- $('#app').show();
- $('#sources').html('');
- $('#add button').click(MUB.addButtonClick);
- // make easier to copy text out of
- $('#uriHtml, #groupConfig').click(function () {
- this.select();
- }).focus(function () {
- this.select();
- });
- $('a.ext').attr({target:'_blank'});
- if (location.hash) {
- // make links out of URIs from bookmarklet
- $('#getBm').hide();
- $('#bmUris').html('Found by bookmarklet: /'
- + location.hash.substr(1).split(',').join(' | /')
- + '
'
- );
- $('#bmUris a').click(function () {
- MUB.addButtonClick();
- $('#sources li:last input').val(this.innerHTML)
- MUB.liUpdateTestLink.call($('#sources li:last')[0]);
- $('#results').hide();
- return false;
- }).attr({title:'Add file +'});
- } else {
- // copy bookmarklet code into href
- var bmUri = location.pathname.replace(/\/[^\/]*$/, '/bm.js').substr(1);
- $.ajax({
- url : '../?f=' + bmUri
- ,success : function (code) {
- $('#bm')[0].href = code
- .replace('%BUILDER_URL%', location.href)
- .replace(/\n/g, ' ');
- }
- ,dataType : 'text'
- });
- $.browser.msie && $('#getBm p:last').append(' Sorry, not supported in MSIE!');
- MUB.addButtonClick();
- }
- MUB.checkRewrite();
- }
-};
-window.onload = MUB.init;
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/builder/bm.js b/plugins/Minify/extlib/minify/min/builder/bm.js
deleted file mode 100644
index 10d1943814..0000000000
--- a/plugins/Minify/extlib/minify/min/builder/bm.js
+++ /dev/null
@@ -1,36 +0,0 @@
-javascript:(function() {
- var d = document
- ,uris = []
- ,i = 0
- ,o
- ,home = (location + '').split('/').splice(0, 3).join('/') + '/';
- function add(uri) {
- return (0 === uri.indexOf(home))
- && (!/[\?&]/.test(uri))
- && uris.push(escape(uri.substr(home.length)));
- };
- function sheet(ss) {
- // we must check the domain with add() before accessing ss.cssRules
- // otherwise a security exception will be thrown
- if (ss.href && add(ss.href) && ss.cssRules) {
- var i = 0, r;
- while (r = ss.cssRules[i++])
- r.styleSheet && sheet(r.styleSheet);
- }
- };
- while (o = d.getElementsByTagName('script')[i++])
- o.src && !(o.type && /vbs/i.test(o.type)) && add(o.src);
- i = 0;
- while (o = d.styleSheets[i++])
- /* http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets
- document.styleSheet is a list property where [0] accesses the 1st element and
- [outOfRange] returns null. In IE, styleSheets is a function, and also throws an
- exception when you check the out of bounds index. (sigh) */
- sheet(o);
- if (uris.length)
- window.open('%BUILDER_URL%#' + uris.join(','));
- else
- alert('No js/css files found with URLs within "'
- + home.split('/')[2]
- + '".\n(This tool is limited to URLs with the same domain.)');
-})();
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/builder/index.php b/plugins/Minify/extlib/minify/min/builder/index.php
deleted file mode 100644
index 1b20982220..0000000000
--- a/plugins/Minify/extlib/minify/min/builder/index.php
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
-
- Minify URI Builder
-
-
-
-
-Note: Please set $min_cachePath
-in /min/config.php to improve performance.
-
-
-Note: Your webserver does not seem to
- support mod_rewrite (used in /min/.htaccess). Your Minify URIs will contain "?", which
-may reduce the benefit of proxy cache servers .
-
-Minify URI Builder
-
-Javascript and a browser supported by jQuery 1.2.6 is required
-for this application.
-
-
-
-
Create a list of Javascript or CSS files (or 1 is fine) you'd like to combine
-and click [Update].
-
-
-
Add file +
-
-
-
-
Update
-
-
-
-
Minify URI
-
Place this URI in your HTML to serve the files above combined, minified, compressed and
-with cache headers.
-
-
-
How to serve these files as a group
-
For the best performance you can serve these files as a pre-defined group with a URI
-like: /min/? g=keyName
-
To do this, add a line like this to /min/groupsConfig.php:
-
-
return array(
- ... your existing groups here ...
-
-);
-
-
Make sure to replace keyName
with a unique key for this group.
-
-
-
-
Find URIs on a Page
-
You can use the bookmarklet below to fetch all CSS & Javascript URIs from a page
-on your site. When you active it, this page will open in a new window with a list of
-available URIs to add.
-
-
Create Minify URIs (right-click, add to bookmarks)
-
-
-
Combining CSS files that contain @import
-
If your CSS files contain @import
declarations, Minify will not
-remove them. Therefore, you will want to remove those that point to files already
-in your list, and move any others to the top of the first file in your list
-(imports below any styles will be ignored by browsers as invalid).
-
If you desire, you can use Minify URIs in imports and they will not be touched
-by Minify. E.g. @import "/min/? g=css2";
-
-
-
-
-Need help? Search or post to the Minify discussion list .
-This app is minified :) view
-source
-
-
-
-
-
-
- ob_get_contents()
- ,'id' => __FILE__
- ,'lastModifiedTime' => max(
- // regenerate cache if either of these change
- filemtime(__FILE__)
- ,filemtime(dirname(__FILE__) . '/../config.php')
- )
- ,'minifyAll' => true
- ,'encodeOutput' => $encodeOutput
-);
-ob_end_clean();
-
-set_include_path(dirname(__FILE__) . '/../lib' . PATH_SEPARATOR . get_include_path());
-
-require 'Minify.php';
-
-if (0 === stripos(PHP_OS, 'win')) {
- Minify::setDocRoot(); // we may be on IIS
-}
-Minify::setCache(isset($min_cachePath) ? $min_cachePath : null);
-Minify::$uploaderHoursBehind = $min_uploaderHoursBehind;
-
-Minify::serve('Page', $serveOpts);
diff --git a/plugins/Minify/extlib/minify/min/builder/ocCheck.php b/plugins/Minify/extlib/minify/min/builder/ocCheck.php
deleted file mode 100644
index c47baa33db..0000000000
--- a/plugins/Minify/extlib/minify/min/builder/ocCheck.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 'World!'
- ,'method' => 'deflate'
- ));
- $he->encode();
- $he->sendAll();
-
-} else {
- // echo status "0" or "1"
- header('Content-Type: text/plain');
- echo (int)$_oc;
-}
diff --git a/plugins/Minify/extlib/minify/min/builder/rewriteTest.js b/plugins/Minify/extlib/minify/min/builder/rewriteTest.js
deleted file mode 100644
index 56a6051ca2..0000000000
--- a/plugins/Minify/extlib/minify/min/builder/rewriteTest.js
+++ /dev/null
@@ -1 +0,0 @@
-1
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/groupsConfig.php b/plugins/Minify/extlib/minify/min/groupsConfig.php
deleted file mode 100644
index 9e2514d7ad..0000000000
--- a/plugins/Minify/extlib/minify/min/groupsConfig.php
+++ /dev/null
@@ -1,34 +0,0 @@
- array('//js/file1.js', '//js/file2.js'),
- // 'css' => array('//css/file1.css', '//css/file2.css'),
-
- // custom source example
- /*'js2' => array(
- dirname(__FILE__) . '/../min_unit_tests/_test_files/js/before.js',
- // do NOT process this file
- new Minify_Source(array(
- 'filepath' => dirname(__FILE__) . '/../min_unit_tests/_test_files/js/before.js',
- 'minifier' => create_function('$a', 'return $a;')
- ))
- ),//*/
-
- /*'js3' => array(
- dirname(__FILE__) . '/../min_unit_tests/_test_files/js/before.js',
- // do NOT process this file
- new Minify_Source(array(
- 'filepath' => dirname(__FILE__) . '/../min_unit_tests/_test_files/js/before.js',
- 'minifier' => array('Minify_Packer', 'minify')
- ))
- ),//*/
-);
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/index.php b/plugins/Minify/extlib/minify/min/index.php
deleted file mode 100644
index 51c352569a..0000000000
--- a/plugins/Minify/extlib/minify/min/index.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- * @license http://www.opensource.org/licenses/bsd-license.php
- * @package FirePHP
- */
-
-
-/**
- * Sends the given data to the FirePHP Firefox Extension.
- * The data can be displayed in the Firebug Console or in the
- * "Server" request tab.
- *
- * For more information see: http://www.firephp.org/
- *
- * @copyright Copyright (C) 2007-2008 Christoph Dorn
- * @author Christoph Dorn
- * @license http://www.opensource.org/licenses/bsd-license.php
- * @package FirePHP
- */
-class FirePHP {
-
- /**
- * FirePHP version
- *
- * @var string
- */
- const VERSION = '0.2.0';
-
- /**
- * Firebug LOG level
- *
- * Logs a message to firebug console.
- *
- * @var string
- */
- const LOG = 'LOG';
-
- /**
- * Firebug INFO level
- *
- * Logs a message to firebug console and displays an info icon before the message.
- *
- * @var string
- */
- const INFO = 'INFO';
-
- /**
- * Firebug WARN level
- *
- * Logs a message to firebug console, displays an warning icon before the message and colors the line turquoise.
- *
- * @var string
- */
- const WARN = 'WARN';
-
- /**
- * Firebug ERROR level
- *
- * Logs a message to firebug console, displays an error icon before the message and colors the line yellow. Also increments the firebug error count.
- *
- * @var string
- */
- const ERROR = 'ERROR';
-
- /**
- * Dumps a variable to firebug's server panel
- *
- * @var string
- */
- const DUMP = 'DUMP';
-
- /**
- * Displays a stack trace in firebug console
- *
- * @var string
- */
- const TRACE = 'TRACE';
-
- /**
- * Displays an exception in firebug console
- *
- * Increments the firebug error count.
- *
- * @var string
- */
- const EXCEPTION = 'EXCEPTION';
-
- /**
- * Displays an table in firebug console
- *
- * @var string
- */
- const TABLE = 'TABLE';
-
- /**
- * Starts a group in firebug console
- *
- * @var string
- */
- const GROUP_START = 'GROUP_START';
-
- /**
- * Ends a group in firebug console
- *
- * @var string
- */
- const GROUP_END = 'GROUP_END';
-
- /**
- * Singleton instance of FirePHP
- *
- * @var FirePHP
- */
- protected static $instance = null;
-
- /**
- * Wildfire protocol message index
- *
- * @var int
- */
- protected $messageIndex = 1;
-
- /**
- * Options for the library
- *
- * @var array
- */
- protected $options = array();
-
- /**
- * Filters used to exclude object members when encoding
- *
- * @var array
- */
- protected $objectFilters = array();
-
- /**
- * A stack of objects used to detect recursion during object encoding
- *
- * @var object
- */
- protected $objectStack = array();
-
- /**
- * Flag to enable/disable logging
- *
- * @var boolean
- */
- protected $enabled = true;
-
- /**
- * The object constructor
- */
- function __construct() {
- $this->options['maxObjectDepth'] = 10;
- $this->options['maxArrayDepth'] = 20;
- $this->options['useNativeJsonEncode'] = true;
- $this->options['includeLineNumbers'] = true;
- }
-
- /**
- * When the object gets serialized only include specific object members.
- *
- * @return array
- */
- public function __sleep() {
- return array('options','objectFilters','enabled');
- }
-
- /**
- * Gets singleton instance of FirePHP
- *
- * @param boolean $AutoCreate
- * @return FirePHP
- */
- public static function getInstance($AutoCreate=false) {
- if($AutoCreate===true && !self::$instance) {
- self::init();
- }
- return self::$instance;
- }
-
- /**
- * Creates FirePHP object and stores it for singleton access
- *
- * @return FirePHP
- */
- public static function init() {
- return self::$instance = new self();
- }
-
- /**
- * Enable and disable logging to Firebug
- *
- * @param boolean $Enabled TRUE to enable, FALSE to disable
- * @return void
- */
- public function setEnabled($Enabled) {
- $this->enabled = $Enabled;
- }
-
- /**
- * Check if logging is enabled
- *
- * @return boolean TRUE if enabled
- */
- public function getEnabled() {
- return $this->enabled;
- }
-
- /**
- * Specify a filter to be used when encoding an object
- *
- * Filters are used to exclude object members.
- *
- * @param string $Class The class name of the object
- * @param array $Filter An array or members to exclude
- * @return void
- */
- public function setObjectFilter($Class, $Filter) {
- $this->objectFilters[$Class] = $Filter;
- }
-
- /**
- * Set some options for the library
- *
- * Options:
- * - maxObjectDepth: The maximum depth to traverse objects (default: 10)
- * - maxArrayDepth: The maximum depth to traverse arrays (default: 20)
- * - useNativeJsonEncode: If true will use json_encode() (default: true)
- * - includeLineNumbers: If true will include line numbers and filenames (default: true)
- *
- * @param array $Options The options to be set
- * @return void
- */
- public function setOptions($Options) {
- $this->options = array_merge($this->options,$Options);
- }
-
- /**
- * Register FirePHP as your error handler
- *
- * Will throw exceptions for each php error.
- */
- public function registerErrorHandler()
- {
- //NOTE: The following errors will not be caught by this error handler:
- // E_ERROR, E_PARSE, E_CORE_ERROR,
- // E_CORE_WARNING, E_COMPILE_ERROR,
- // E_COMPILE_WARNING, E_STRICT
-
- set_error_handler(array($this,'errorHandler'));
- }
-
- /**
- * FirePHP's error handler
- *
- * Throws exception for each php error that will occur.
- *
- * @param int $errno
- * @param string $errstr
- * @param string $errfile
- * @param int $errline
- * @param array $errcontext
- */
- public function errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
- {
- // Don't throw exception if error reporting is switched off
- if (error_reporting() == 0) {
- return;
- }
- // Only throw exceptions for errors we are asking for
- if (error_reporting() & $errno) {
- throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
- }
- }
-
- /**
- * Register FirePHP as your exception handler
- */
- public function registerExceptionHandler()
- {
- set_exception_handler(array($this,'exceptionHandler'));
- }
-
- /**
- * FirePHP's exception handler
- *
- * Logs all exceptions to your firebug console and then stops the script.
- *
- * @param Exception $Exception
- * @throws Exception
- */
- function exceptionHandler($Exception) {
- $this->fb($Exception);
- }
-
- /**
- * Set custom processor url for FirePHP
- *
- * @param string $URL
- */
- public function setProcessorUrl($URL)
- {
- $this->setHeader('X-FirePHP-ProcessorURL', $URL);
- }
-
- /**
- * Set custom renderer url for FirePHP
- *
- * @param string $URL
- */
- public function setRendererUrl($URL)
- {
- $this->setHeader('X-FirePHP-RendererURL', $URL);
- }
-
- /**
- * Start a group for following messages
- *
- * @param string $Name
- * @return true
- * @throws Exception
- */
- public function group($Name) {
- return $this->fb(null, $Name, FirePHP::GROUP_START);
- }
-
- /**
- * Ends a group you have started before
- *
- * @return true
- * @throws Exception
- */
- public function groupEnd() {
- return $this->fb(null, null, FirePHP::GROUP_END);
- }
-
- /**
- * Log object with label to firebug console
- *
- * @see FirePHP::LOG
- * @param mixes $Object
- * @param string $Label
- * @return true
- * @throws Exception
- */
- public function log($Object, $Label=null) {
- return $this->fb($Object, $Label, FirePHP::LOG);
- }
-
- /**
- * Log object with label to firebug console
- *
- * @see FirePHP::INFO
- * @param mixes $Object
- * @param string $Label
- * @return true
- * @throws Exception
- */
- public function info($Object, $Label=null) {
- return $this->fb($Object, $Label, FirePHP::INFO);
- }
-
- /**
- * Log object with label to firebug console
- *
- * @see FirePHP::WARN
- * @param mixes $Object
- * @param string $Label
- * @return true
- * @throws Exception
- */
- public function warn($Object, $Label=null) {
- return $this->fb($Object, $Label, FirePHP::WARN);
- }
-
- /**
- * Log object with label to firebug console
- *
- * @see FirePHP::ERROR
- * @param mixes $Object
- * @param string $Label
- * @return true
- * @throws Exception
- */
- public function error($Object, $Label=null) {
- return $this->fb($Object, $Label, FirePHP::ERROR);
- }
-
- /**
- * Dumps key and variable to firebug server panel
- *
- * @see FirePHP::DUMP
- * @param string $Key
- * @param mixed $Variable
- * @return true
- * @throws Exception
- */
- public function dump($Key, $Variable) {
- return $this->fb($Variable, $Key, FirePHP::DUMP);
- }
-
- /**
- * Log a trace in the firebug console
- *
- * @see FirePHP::TRACE
- * @param string $Label
- * @return true
- * @throws Exception
- */
- public function trace($Label) {
- return $this->fb($Label, FirePHP::TRACE);
- }
-
- /**
- * Log a table in the firebug console
- *
- * @see FirePHP::TABLE
- * @param string $Label
- * @param string $Table
- * @return true
- * @throws Exception
- */
- public function table($Label, $Table) {
- return $this->fb($Table, $Label, FirePHP::TABLE);
- }
-
- /**
- * Check if FirePHP is installed on client
- *
- * @return boolean
- */
- public function detectClientExtension() {
- /* Check if FirePHP is installed on client */
- if(!@preg_match_all('/\sFirePHP\/([\.|\d]*)\s?/si',$this->getUserAgent(),$m) ||
- !version_compare($m[1][0],'0.0.6','>=')) {
- return false;
- }
- return true;
- }
-
- /**
- * Log varible to Firebug
- *
- * @see http://www.firephp.org/Wiki/Reference/Fb
- * @param mixed $Object The variable to be logged
- * @return true Return TRUE if message was added to headers, FALSE otherwise
- * @throws Exception
- */
- public function fb($Object) {
-
- if(!$this->enabled) {
- return false;
- }
-
- if (headers_sent($filename, $linenum)) {
- throw $this->newException('Headers already sent in '.$filename.' on line '.$linenum.'. Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive.');
- }
-
- $Type = null;
- $Label = null;
-
- if(func_num_args()==1) {
- } else
- if(func_num_args()==2) {
- switch(func_get_arg(1)) {
- case self::LOG:
- case self::INFO:
- case self::WARN:
- case self::ERROR:
- case self::DUMP:
- case self::TRACE:
- case self::EXCEPTION:
- case self::TABLE:
- case self::GROUP_START:
- case self::GROUP_END:
- $Type = func_get_arg(1);
- break;
- default:
- $Label = func_get_arg(1);
- break;
- }
- } else
- if(func_num_args()==3) {
- $Type = func_get_arg(2);
- $Label = func_get_arg(1);
- } else {
- throw $this->newException('Wrong number of arguments to fb() function!');
- }
-
-
- if(!$this->detectClientExtension()) {
- return false;
- }
-
- $meta = array();
- $skipFinalObjectEncode = false;
-
- if($Object instanceof Exception) {
-
- $meta['file'] = $this->_escapeTraceFile($Object->getFile());
- $meta['line'] = $Object->getLine();
-
- $trace = $Object->getTrace();
- if($Object instanceof ErrorException
- && isset($trace[0]['function'])
- && $trace[0]['function']=='errorHandler'
- && isset($trace[0]['class'])
- && $trace[0]['class']=='FirePHP') {
-
- $severity = false;
- switch($Object->getSeverity()) {
- case E_WARNING: $severity = 'E_WARNING'; break;
- case E_NOTICE: $severity = 'E_NOTICE'; break;
- case E_USER_ERROR: $severity = 'E_USER_ERROR'; break;
- case E_USER_WARNING: $severity = 'E_USER_WARNING'; break;
- case E_USER_NOTICE: $severity = 'E_USER_NOTICE'; break;
- case E_STRICT: $severity = 'E_STRICT'; break;
- case E_RECOVERABLE_ERROR: $severity = 'E_RECOVERABLE_ERROR'; break;
- case E_DEPRECATED: $severity = 'E_DEPRECATED'; break;
- case E_USER_DEPRECATED: $severity = 'E_USER_DEPRECATED'; break;
- }
-
- $Object = array('Class'=>get_class($Object),
- 'Message'=>$severity.': '.$Object->getMessage(),
- 'File'=>$this->_escapeTraceFile($Object->getFile()),
- 'Line'=>$Object->getLine(),
- 'Type'=>'trigger',
- 'Trace'=>$this->_escapeTrace(array_splice($trace,2)));
- $skipFinalObjectEncode = true;
- } else {
- $Object = array('Class'=>get_class($Object),
- 'Message'=>$Object->getMessage(),
- 'File'=>$this->_escapeTraceFile($Object->getFile()),
- 'Line'=>$Object->getLine(),
- 'Type'=>'throw',
- 'Trace'=>$this->_escapeTrace($trace));
- $skipFinalObjectEncode = true;
- }
- $Type = self::EXCEPTION;
-
- } else
- if($Type==self::TRACE) {
-
- $trace = debug_backtrace();
- if(!$trace) return false;
- for( $i=0 ; $i_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php'
- || substr($this->_standardizePath($trace[$i]['file']),-29,29)=='FirePHPCore/FirePHP.class.php')) {
- /* Skip - FB::trace(), FB::send(), $firephp->trace(), $firephp->fb() */
- } else
- if(isset($trace[$i]['class'])
- && isset($trace[$i+1]['file'])
- && $trace[$i]['class']=='FirePHP'
- && substr($this->_standardizePath($trace[$i+1]['file']),-18,18)=='FirePHPCore/fb.php') {
- /* Skip fb() */
- } else
- if($trace[$i]['function']=='fb'
- || $trace[$i]['function']=='trace'
- || $trace[$i]['function']=='send') {
- $Object = array('Class'=>isset($trace[$i]['class'])?$trace[$i]['class']:'',
- 'Type'=>isset($trace[$i]['type'])?$trace[$i]['type']:'',
- 'Function'=>isset($trace[$i]['function'])?$trace[$i]['function']:'',
- 'Message'=>$trace[$i]['args'][0],
- 'File'=>isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):'',
- 'Line'=>isset($trace[$i]['line'])?$trace[$i]['line']:'',
- 'Args'=>isset($trace[$i]['args'])?$this->encodeObject($trace[$i]['args']):'',
- 'Trace'=>$this->_escapeTrace(array_splice($trace,$i+1)));
-
- $skipFinalObjectEncode = true;
- $meta['file'] = isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):'';
- $meta['line'] = isset($trace[$i]['line'])?$trace[$i]['line']:'';
- break;
- }
- }
-
- } else
- if($Type==self::TABLE) {
-
- if(isset($Object[0]) && is_string($Object[0])) {
- $Object[1] = $this->encodeTable($Object[1]);
- } else {
- $Object = $this->encodeTable($Object);
- }
-
- $skipFinalObjectEncode = true;
-
- } else {
- if($Type===null) {
- $Type = self::LOG;
- }
- }
-
- if($this->options['includeLineNumbers']) {
- if(!isset($meta['file']) || !isset($meta['line'])) {
-
- $trace = debug_backtrace();
- for( $i=0 ; $trace && $i_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php'
- || substr($this->_standardizePath($trace[$i]['file']),-29,29)=='FirePHPCore/FirePHP.class.php')) {
- /* Skip - FB::trace(), FB::send(), $firephp->trace(), $firephp->fb() */
- } else
- if(isset($trace[$i]['class'])
- && isset($trace[$i+1]['file'])
- && $trace[$i]['class']=='FirePHP'
- && substr($this->_standardizePath($trace[$i+1]['file']),-18,18)=='FirePHPCore/fb.php') {
- /* Skip fb() */
- } else
- if(isset($trace[$i]['file'])
- && substr($this->_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php') {
- /* Skip FB::fb() */
- } else {
- $meta['file'] = isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):'';
- $meta['line'] = isset($trace[$i]['line'])?$trace[$i]['line']:'';
- break;
- }
- }
-
- }
- } else {
- unset($meta['file']);
- unset($meta['line']);
- }
-
- $this->setHeader('X-Wf-Protocol-1','http://meta.wildfirehq.org/Protocol/JsonStream/0.2');
- $this->setHeader('X-Wf-1-Plugin-1','http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/'.self::VERSION);
-
- $structure_index = 1;
- if($Type==self::DUMP) {
- $structure_index = 2;
- $this->setHeader('X-Wf-1-Structure-2','http://meta.firephp.org/Wildfire/Structure/FirePHP/Dump/0.1');
- } else {
- $this->setHeader('X-Wf-1-Structure-1','http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1');
- }
-
- if($Type==self::DUMP) {
- $msg = '{"'.$Label.'":'.$this->jsonEncode($Object, $skipFinalObjectEncode).'}';
- } else {
- $msg_meta = array('Type'=>$Type);
- if($Label!==null) {
- $msg_meta['Label'] = $Label;
- }
- if(isset($meta['file'])) {
- $msg_meta['File'] = $meta['file'];
- }
- if(isset($meta['line'])) {
- $msg_meta['Line'] = $meta['line'];
- }
- $msg = '['.$this->jsonEncode($msg_meta).','.$this->jsonEncode($Object, $skipFinalObjectEncode).']';
- }
-
- $parts = explode("\n",chunk_split($msg, 5000, "\n"));
-
- for( $i=0 ; $i2) {
- // Message needs to be split into multiple parts
- $this->setHeader('X-Wf-1-'.$structure_index.'-'.'1-'.$this->messageIndex,
- (($i==0)?strlen($msg):'')
- . '|' . $part . '|'
- . (($isetHeader('X-Wf-1-'.$structure_index.'-'.'1-'.$this->messageIndex,
- strlen($part) . '|' . $part . '|');
- }
-
- $this->messageIndex++;
-
- if ($this->messageIndex > 99999) {
- throw new Exception('Maximum number (99,999) of messages reached!');
- }
- }
- }
-
- $this->setHeader('X-Wf-1-Index',$this->messageIndex-1);
-
- return true;
- }
-
- /**
- * Standardizes path for windows systems.
- *
- * @param string $Path
- * @return string
- */
- protected function _standardizePath($Path) {
- return preg_replace('/\\\\+/','/',$Path);
- }
-
- /**
- * Escape trace path for windows systems
- *
- * @param array $Trace
- * @return array
- */
- protected function _escapeTrace($Trace) {
- if(!$Trace) return $Trace;
- for( $i=0 ; $i_escapeTraceFile($Trace[$i]['file']);
- }
- if(isset($Trace[$i]['args'])) {
- $Trace[$i]['args'] = $this->encodeObject($Trace[$i]['args']);
- }
- }
- return $Trace;
- }
-
- /**
- * Escape file information of trace for windows systems
- *
- * @param string $File
- * @return string
- */
- protected function _escapeTraceFile($File) {
- /* Check if we have a windows filepath */
- if(strpos($File,'\\')) {
- /* First strip down to single \ */
-
- $file = preg_replace('/\\\\+/','\\',$File);
-
- return $file;
- }
- return $File;
- }
-
- /**
- * Send header
- *
- * @param string $Name
- * @param string_type $Value
- */
- protected function setHeader($Name, $Value) {
- return header($Name.': '.$Value);
- }
-
- /**
- * Get user agent
- *
- * @return string|false
- */
- protected function getUserAgent() {
- if(!isset($_SERVER['HTTP_USER_AGENT'])) return false;
- return $_SERVER['HTTP_USER_AGENT'];
- }
-
- /**
- * Returns a new exception
- *
- * @param string $Message
- * @return Exception
- */
- protected function newException($Message) {
- return new Exception($Message);
- }
-
- /**
- * Encode an object into a JSON string
- *
- * Uses PHP's jeson_encode() if available
- *
- * @param object $Object The object to be encoded
- * @return string The JSON string
- */
- protected function jsonEncode($Object, $skipObjectEncode=false)
- {
- if(!$skipObjectEncode) {
- $Object = $this->encodeObject($Object);
- }
-
- if(function_exists('json_encode')
- && $this->options['useNativeJsonEncode']!=false) {
-
- return json_encode($Object);
- } else {
- return $this->json_encode($Object);
- }
- }
-
- /**
- * Encodes a table by encoding each row and column with encodeObject()
- *
- * @param array $Table The table to be encoded
- * @return array
- */
- protected function encodeTable($Table) {
- if(!$Table) return $Table;
- for( $i=0 ; $iencodeObject($Table[$i][$j]);
- }
- }
- }
- return $Table;
- }
-
- /**
- * Encodes an object including members with
- * protected and private visibility
- *
- * @param Object $Object The object to be encoded
- * @param int $Depth The current traversal depth
- * @return array All members of the object
- */
- protected function encodeObject($Object, $ObjectDepth = 1, $ArrayDepth = 1)
- {
- $return = array();
-
- if (is_object($Object)) {
-
- if ($ObjectDepth > $this->options['maxObjectDepth']) {
- return '** Max Object Depth ('.$this->options['maxObjectDepth'].') **';
- }
-
- foreach ($this->objectStack as $refVal) {
- if ($refVal === $Object) {
- return '** Recursion ('.get_class($Object).') **';
- }
- }
- array_push($this->objectStack, $Object);
-
- $return['__className'] = $class = get_class($Object);
-
- $reflectionClass = new ReflectionClass($class);
- $properties = array();
- foreach( $reflectionClass->getProperties() as $property) {
- $properties[$property->getName()] = $property;
- }
-
- $members = (array)$Object;
-
- foreach( $properties as $raw_name => $property ) {
-
- $name = $raw_name;
- if($property->isStatic()) {
- $name = 'static:'.$name;
- }
- if($property->isPublic()) {
- $name = 'public:'.$name;
- } else
- if($property->isPrivate()) {
- $name = 'private:'.$name;
- $raw_name = "\0".$class."\0".$raw_name;
- } else
- if($property->isProtected()) {
- $name = 'protected:'.$name;
- $raw_name = "\0".'*'."\0".$raw_name;
- }
-
- if(!(isset($this->objectFilters[$class])
- && is_array($this->objectFilters[$class])
- && in_array($raw_name,$this->objectFilters[$class]))) {
-
- if(array_key_exists($raw_name,$members)
- && !$property->isStatic()) {
-
- $return[$name] = $this->encodeObject($members[$raw_name], $ObjectDepth + 1, 1);
-
- } else {
- if(method_exists($property,'setAccessible')) {
- $property->setAccessible(true);
- $return[$name] = $this->encodeObject($property->getValue($Object), $ObjectDepth + 1, 1);
- } else
- if($property->isPublic()) {
- $return[$name] = $this->encodeObject($property->getValue($Object), $ObjectDepth + 1, 1);
- } else {
- $return[$name] = '** Need PHP 5.3 to get value **';
- }
- }
- } else {
- $return[$name] = '** Excluded by Filter **';
- }
- }
-
- // Include all members that are not defined in the class
- // but exist in the object
- foreach( $members as $raw_name => $value ) {
-
- $name = $raw_name;
-
- if ($name{0} == "\0") {
- $parts = explode("\0", $name);
- $name = $parts[2];
- }
-
- if(!isset($properties[$name])) {
- $name = 'undeclared:'.$name;
-
- if(!(isset($this->objectFilters[$class])
- && is_array($this->objectFilters[$class])
- && in_array($raw_name,$this->objectFilters[$class]))) {
-
- $return[$name] = $this->encodeObject($value, $ObjectDepth + 1, 1);
- } else {
- $return[$name] = '** Excluded by Filter **';
- }
- }
- }
-
- array_pop($this->objectStack);
-
- } elseif (is_array($Object)) {
-
- if ($ArrayDepth > $this->options['maxArrayDepth']) {
- return '** Max Array Depth ('.$this->options['maxArrayDepth'].') **';
- }
-
- foreach ($Object as $key => $val) {
-
- // Encoding the $GLOBALS PHP array causes an infinite loop
- // if the recursion is not reset here as it contains
- // a reference to itself. This is the only way I have come up
- // with to stop infinite recursion in this case.
- if($key=='GLOBALS'
- && is_array($val)
- && array_key_exists('GLOBALS',$val)) {
- $val['GLOBALS'] = '** Recursion (GLOBALS) **';
- }
-
- $return[$key] = $this->encodeObject($val, 1, $ArrayDepth + 1);
- }
- } else {
- if(self::is_utf8($Object)) {
- return $Object;
- } else {
- return utf8_encode($Object);
- }
- }
- return $return;
- }
-
- /**
- * Returns true if $string is valid UTF-8 and false otherwise.
- *
- * @param mixed $str String to be tested
- * @return boolean
- */
- protected static function is_utf8($str) {
- $c=0; $b=0;
- $bits=0;
- $len=strlen($str);
- for($i=0; $i<$len; $i++){
- $c=ord($str[$i]);
- if($c > 128){
- if(($c >= 254)) return false;
- elseif($c >= 252) $bits=6;
- elseif($c >= 248) $bits=5;
- elseif($c >= 240) $bits=4;
- elseif($c >= 224) $bits=3;
- elseif($c >= 192) $bits=2;
- else return false;
- if(($i+$bits) > $len) return false;
- while($bits > 1){
- $i++;
- $b=ord($str[$i]);
- if($b < 128 || $b > 191) return false;
- $bits--;
- }
- }
- }
- return true;
- }
-
- /**
- * Converts to and from JSON format.
- *
- * JSON (JavaScript Object Notation) is a lightweight data-interchange
- * format. It is easy for humans to read and write. It is easy for machines
- * to parse and generate. It is based on a subset of the JavaScript
- * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
- * This feature can also be found in Python. JSON is a text format that is
- * completely language independent but uses conventions that are familiar
- * to programmers of the C-family of languages, including C, C++, C#, Java,
- * JavaScript, Perl, TCL, and many others. These properties make JSON an
- * ideal data-interchange language.
- *
- * This package provides a simple encoder and decoder for JSON notation. It
- * is intended for use with client-side Javascript applications that make
- * use of HTTPRequest to perform server communication functions - data can
- * be encoded into JSON notation for use in a client-side javascript, or
- * decoded from incoming Javascript requests. JSON format is native to
- * Javascript, and can be directly eval()'ed with no further parsing
- * overhead
- *
- * All strings should be in ASCII or UTF-8 format!
- *
- * LICENSE: Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met: Redistributions of source code must retain the
- * above copyright notice, this list of conditions and the following
- * disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * @category
- * @package Services_JSON
- * @author Michal Migurski
- * @author Matt Knapp
- * @author Brett Stimmerman
- * @author Christoph Dorn
- * @copyright 2005 Michal Migurski
- * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
- * @license http://www.opensource.org/licenses/bsd-license.php
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
- */
-
-
- /**
- * Keep a list of objects as we descend into the array so we can detect recursion.
- */
- private $json_objectStack = array();
-
-
- /**
- * convert a string from one UTF-8 char to one UTF-16 char
- *
- * Normally should be handled by mb_convert_encoding, but
- * provides a slower PHP-only method for installations
- * that lack the multibye string extension.
- *
- * @param string $utf8 UTF-8 character
- * @return string UTF-16 character
- * @access private
- */
- private function json_utf82utf16($utf8)
- {
- // oh please oh please oh please oh please oh please
- if(function_exists('mb_convert_encoding')) {
- return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
- }
-
- switch(strlen($utf8)) {
- case 1:
- // this case should never be reached, because we are in ASCII range
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return $utf8;
-
- case 2:
- // return a UTF-16 character from a 2-byte UTF-8 char
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr(0x07 & (ord($utf8{0}) >> 2))
- . chr((0xC0 & (ord($utf8{0}) << 6))
- | (0x3F & ord($utf8{1})));
-
- case 3:
- // return a UTF-16 character from a 3-byte UTF-8 char
- // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr((0xF0 & (ord($utf8{0}) << 4))
- | (0x0F & (ord($utf8{1}) >> 2)))
- . chr((0xC0 & (ord($utf8{1}) << 6))
- | (0x7F & ord($utf8{2})));
- }
-
- // ignoring UTF-32 for now, sorry
- return '';
- }
-
- /**
- * encodes an arbitrary variable into JSON format
- *
- * @param mixed $var any number, boolean, string, array, or object to be encoded.
- * see argument 1 to Services_JSON() above for array-parsing behavior.
- * if var is a strng, note that encode() always expects it
- * to be in ASCII or UTF-8 format!
- *
- * @return mixed JSON string representation of input var or an error if a problem occurs
- * @access public
- */
- private function json_encode($var)
- {
-
- if(is_object($var)) {
- if(in_array($var,$this->json_objectStack)) {
- return '"** Recursion **"';
- }
- }
-
- switch (gettype($var)) {
- case 'boolean':
- return $var ? 'true' : 'false';
-
- case 'NULL':
- return 'null';
-
- case 'integer':
- return (int) $var;
-
- case 'double':
- case 'float':
- return (float) $var;
-
- case 'string':
- // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
- $ascii = '';
- $strlen_var = strlen($var);
-
- /*
- * Iterate over every character in the string,
- * escaping with a slash or encoding to UTF-8 where necessary
- */
- for ($c = 0; $c < $strlen_var; ++$c) {
-
- $ord_var_c = ord($var{$c});
-
- switch (true) {
- case $ord_var_c == 0x08:
- $ascii .= '\b';
- break;
- case $ord_var_c == 0x09:
- $ascii .= '\t';
- break;
- case $ord_var_c == 0x0A:
- $ascii .= '\n';
- break;
- case $ord_var_c == 0x0C:
- $ascii .= '\f';
- break;
- case $ord_var_c == 0x0D:
- $ascii .= '\r';
- break;
-
- case $ord_var_c == 0x22:
- case $ord_var_c == 0x2F:
- case $ord_var_c == 0x5C:
- // double quote, slash, slosh
- $ascii .= '\\'.$var{$c};
- break;
-
- case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
- // characters U-00000000 - U-0000007F (same as ASCII)
- $ascii .= $var{$c};
- break;
-
- case (($ord_var_c & 0xE0) == 0xC0):
- // characters U-00000080 - U-000007FF, mask 110XXXXX
- // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
- $c += 1;
- $utf16 = $this->json_utf82utf16($char);
- $ascii .= sprintf('\u%04s', bin2hex($utf16));
- break;
-
- case (($ord_var_c & 0xF0) == 0xE0):
- // characters U-00000800 - U-0000FFFF, mask 1110XXXX
- // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}));
- $c += 2;
- $utf16 = $this->json_utf82utf16($char);
- $ascii .= sprintf('\u%04s', bin2hex($utf16));
- break;
-
- case (($ord_var_c & 0xF8) == 0xF0):
- // characters U-00010000 - U-001FFFFF, mask 11110XXX
- // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}));
- $c += 3;
- $utf16 = $this->json_utf82utf16($char);
- $ascii .= sprintf('\u%04s', bin2hex($utf16));
- break;
-
- case (($ord_var_c & 0xFC) == 0xF8):
- // characters U-00200000 - U-03FFFFFF, mask 111110XX
- // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}));
- $c += 4;
- $utf16 = $this->json_utf82utf16($char);
- $ascii .= sprintf('\u%04s', bin2hex($utf16));
- break;
-
- case (($ord_var_c & 0xFE) == 0xFC):
- // characters U-04000000 - U-7FFFFFFF, mask 1111110X
- // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}),
- ord($var{$c + 5}));
- $c += 5;
- $utf16 = $this->json_utf82utf16($char);
- $ascii .= sprintf('\u%04s', bin2hex($utf16));
- break;
- }
- }
-
- return '"'.$ascii.'"';
-
- case 'array':
- /*
- * As per JSON spec if any array key is not an integer
- * we must treat the the whole array as an object. We
- * also try to catch a sparsely populated associative
- * array with numeric keys here because some JS engines
- * will create an array with empty indexes up to
- * max_index which can cause memory issues and because
- * the keys, which may be relevant, will be remapped
- * otherwise.
- *
- * As per the ECMA and JSON specification an object may
- * have any string as a property. Unfortunately due to
- * a hole in the ECMA specification if the key is a
- * ECMA reserved word or starts with a digit the
- * parameter is only accessible using ECMAScript's
- * bracket notation.
- */
-
- // treat as a JSON object
- if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
-
- $this->json_objectStack[] = $var;
-
- $properties = array_map(array($this, 'json_name_value'),
- array_keys($var),
- array_values($var));
-
- array_pop($this->json_objectStack);
-
- foreach($properties as $property) {
- if($property instanceof Exception) {
- return $property;
- }
- }
-
- return '{' . join(',', $properties) . '}';
- }
-
- $this->json_objectStack[] = $var;
-
- // treat it like a regular array
- $elements = array_map(array($this, 'json_encode'), $var);
-
- array_pop($this->json_objectStack);
-
- foreach($elements as $element) {
- if($element instanceof Exception) {
- return $element;
- }
- }
-
- return '[' . join(',', $elements) . ']';
-
- case 'object':
- $vars = self::encodeObject($var);
-
- $this->json_objectStack[] = $var;
-
- $properties = array_map(array($this, 'json_name_value'),
- array_keys($vars),
- array_values($vars));
-
- array_pop($this->json_objectStack);
-
- foreach($properties as $property) {
- if($property instanceof Exception) {
- return $property;
- }
- }
-
- return '{' . join(',', $properties) . '}';
-
- default:
- return null;
- }
- }
-
- /**
- * array-walking function for use in generating JSON-formatted name-value pairs
- *
- * @param string $name name of key to use
- * @param mixed $value reference to an array element to be encoded
- *
- * @return string JSON-formatted name-value pair, like '"name":value'
- * @access private
- */
- private function json_name_value($name, $value)
- {
- // Encoding the $GLOBALS PHP array causes an infinite loop
- // if the recursion is not reset here as it contains
- // a reference to itself. This is the only way I have come up
- // with to stop infinite recursion in this case.
- if($name=='GLOBALS'
- && is_array($value)
- && array_key_exists('GLOBALS',$value)) {
- $value['GLOBALS'] = '** Recursion **';
- }
-
- $encoded_value = $this->json_encode($value);
-
- if($encoded_value instanceof Exception) {
- return $encoded_value;
- }
-
- return $this->json_encode(strval($name)) . ':' . $encoded_value;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/HTTP/ConditionalGet.php b/plugins/Minify/extlib/minify/min/lib/HTTP/ConditionalGet.php
deleted file mode 100644
index 823db058fa..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/HTTP/ConditionalGet.php
+++ /dev/null
@@ -1,348 +0,0 @@
-
- * list($updateTime, $content) = getDbUpdateAndContent();
- * $cg = new HTTP_ConditionalGet(array(
- * 'lastModifiedTime' => $updateTime
- * ,'isPublic' => true
- * ));
- * $cg->sendHeaders();
- * if ($cg->cacheIsValid) {
- * exit();
- * }
- * echo $content;
- *
- *
- * E.g. Shortcut for the above
- *
- * HTTP_ConditionalGet::check($updateTime, true); // exits if client has cache
- * echo $content;
- *
- *
- * E.g. Content from DB with no update time:
- *
- * $content = getContentFromDB();
- * $cg = new HTTP_ConditionalGet(array(
- * 'contentHash' => md5($content)
- * ));
- * $cg->sendHeaders();
- * if ($cg->cacheIsValid) {
- * exit();
- * }
- * echo $content;
- *
- *
- * E.g. Static content with some static includes:
- *
- * // before content
- * $cg = new HTTP_ConditionalGet(array(
- * 'lastUpdateTime' => max(
- * filemtime(__FILE__)
- * ,filemtime('/path/to/header.inc')
- * ,filemtime('/path/to/footer.inc')
- * )
- * ));
- * $cg->sendHeaders();
- * if ($cg->cacheIsValid) {
- * exit();
- * }
- *
- * @package Minify
- * @subpackage HTTP
- * @author Stephen Clay
- */
-class HTTP_ConditionalGet {
-
- /**
- * Does the client have a valid copy of the requested resource?
- *
- * You'll want to check this after instantiating the object. If true, do
- * not send content, just call sendHeaders() if you haven't already.
- *
- * @var bool
- */
- public $cacheIsValid = null;
-
- /**
- * @param array $spec options
- *
- * 'isPublic': (bool) if true, the Cache-Control header will contain
- * "public", allowing proxies to cache the content. Otherwise "private" will
- * be sent, allowing only browser caching. (default false)
- *
- * 'lastModifiedTime': (int) if given, both ETag AND Last-Modified headers
- * will be sent with content. This is recommended.
- *
- * 'encoding': (string) if set, the header "Vary: Accept-Encoding" will
- * always be sent and a truncated version of the encoding will be appended
- * to the ETag. E.g. "pub123456;gz". This will also trigger a more lenient
- * checking of the client's If-None-Match header, as the encoding portion of
- * the ETag will be stripped before comparison.
- *
- * 'contentHash': (string) if given, only the ETag header can be sent with
- * content (only HTTP1.1 clients can conditionally GET). The given string
- * should be short with no quote characters and always change when the
- * resource changes (recommend md5()). This is not needed/used if
- * lastModifiedTime is given.
- *
- * 'eTag': (string) if given, this will be used as the ETag header rather
- * than values based on lastModifiedTime or contentHash. Also the encoding
- * string will not be appended to the given value as described above.
- *
- * 'invalidate': (bool) if true, the client cache will be considered invalid
- * without testing. Effectively this disables conditional GET.
- * (default false)
- *
- * 'maxAge': (int) if given, this will set the Cache-Control max-age in
- * seconds, and also set the Expires header to the equivalent GMT date.
- * After the max-age period has passed, the browser will again send a
- * conditional GET to revalidate its cache.
- *
- * @return null
- */
- public function __construct($spec)
- {
- $scope = (isset($spec['isPublic']) && $spec['isPublic'])
- ? 'public'
- : 'private';
- $maxAge = 0;
- // backwards compatibility (can be removed later)
- if (isset($spec['setExpires'])
- && is_numeric($spec['setExpires'])
- && ! isset($spec['maxAge'])) {
- $spec['maxAge'] = $spec['setExpires'] - $_SERVER['REQUEST_TIME'];
- }
- if (isset($spec['maxAge'])) {
- $maxAge = $spec['maxAge'];
- $this->_headers['Expires'] = self::gmtDate(
- $_SERVER['REQUEST_TIME'] + $spec['maxAge']
- );
- }
- $etagAppend = '';
- if (isset($spec['encoding'])) {
- $this->_stripEtag = true;
- $this->_headers['Vary'] = 'Accept-Encoding';
- if ('' !== $spec['encoding']) {
- if (0 === strpos($spec['encoding'], 'x-')) {
- $spec['encoding'] = substr($spec['encoding'], 2);
- }
- $etagAppend = ';' . substr($spec['encoding'], 0, 2);
- }
- }
- if (isset($spec['lastModifiedTime'])) {
- $this->_setLastModified($spec['lastModifiedTime']);
- if (isset($spec['eTag'])) { // Use it
- $this->_setEtag($spec['eTag'], $scope);
- } else { // base both headers on time
- $this->_setEtag($spec['lastModifiedTime'] . $etagAppend, $scope);
- }
- } elseif (isset($spec['eTag'])) { // Use it
- $this->_setEtag($spec['eTag'], $scope);
- } elseif (isset($spec['contentHash'])) { // Use the hash as the ETag
- $this->_setEtag($spec['contentHash'] . $etagAppend, $scope);
- }
- $this->_headers['Cache-Control'] = "max-age={$maxAge}, {$scope}";
- // invalidate cache if disabled, otherwise check
- $this->cacheIsValid = (isset($spec['invalidate']) && $spec['invalidate'])
- ? false
- : $this->_isCacheValid();
- }
-
- /**
- * Get array of output headers to be sent
- *
- * In the case of 304 responses, this array will only contain the response
- * code header: array('_responseCode' => 'HTTP/1.0 304 Not Modified')
- *
- * Otherwise something like:
- *
- * array(
- * 'Cache-Control' => 'max-age=0, public'
- * ,'ETag' => '"foobar"'
- * )
- *
- *
- * @return array
- */
- public function getHeaders()
- {
- return $this->_headers;
- }
-
- /**
- * Set the Content-Length header in bytes
- *
- * With most PHP configs, as long as you don't flush() output, this method
- * is not needed and PHP will buffer all output and set Content-Length for
- * you. Otherwise you'll want to call this to let the client know up front.
- *
- * @param int $bytes
- *
- * @return int copy of input $bytes
- */
- public function setContentLength($bytes)
- {
- return $this->_headers['Content-Length'] = $bytes;
- }
-
- /**
- * Send headers
- *
- * @see getHeaders()
- *
- * Note this doesn't "clear" the headers. Calling sendHeaders() will
- * call header() again (but probably have not effect) and getHeaders() will
- * still return the headers.
- *
- * @return null
- */
- public function sendHeaders()
- {
- $headers = $this->_headers;
- if (array_key_exists('_responseCode', $headers)) {
- header($headers['_responseCode']);
- unset($headers['_responseCode']);
- }
- foreach ($headers as $name => $val) {
- header($name . ': ' . $val);
- }
- }
-
- /**
- * Exit if the client's cache is valid for this resource
- *
- * This is a convenience method for common use of the class
- *
- * @param int $lastModifiedTime if given, both ETag AND Last-Modified headers
- * will be sent with content. This is recommended.
- *
- * @param bool $isPublic (default false) if true, the Cache-Control header
- * will contain "public", allowing proxies to cache the content. Otherwise
- * "private" will be sent, allowing only browser caching.
- *
- * @param array $options (default empty) additional options for constructor
- *
- * @return null
- */
- public static function check($lastModifiedTime = null, $isPublic = false, $options = array())
- {
- if (null !== $lastModifiedTime) {
- $options['lastModifiedTime'] = (int)$lastModifiedTime;
- }
- $options['isPublic'] = (bool)$isPublic;
- $cg = new HTTP_ConditionalGet($options);
- $cg->sendHeaders();
- if ($cg->cacheIsValid) {
- exit();
- }
- }
-
-
- /**
- * Get a GMT formatted date for use in HTTP headers
- *
- *
- * header('Expires: ' . HTTP_ConditionalGet::gmtdate($time));
- *
- *
- * @param int $time unix timestamp
- *
- * @return string
- */
- public static function gmtDate($time)
- {
- return gmdate('D, d M Y H:i:s \G\M\T', $time);
- }
-
- protected $_headers = array();
- protected $_lmTime = null;
- protected $_etag = null;
- protected $_stripEtag = false;
-
- protected function _setEtag($hash, $scope)
- {
- $this->_etag = '"' . substr($scope, 0, 3) . $hash . '"';
- $this->_headers['ETag'] = $this->_etag;
- }
-
- protected function _setLastModified($time)
- {
- $this->_lmTime = (int)$time;
- $this->_headers['Last-Modified'] = self::gmtDate($time);
- }
-
- /**
- * Determine validity of client cache and queue 304 header if valid
- */
- protected function _isCacheValid()
- {
- if (null === $this->_etag) {
- // lmTime is copied to ETag, so this condition implies that the
- // server sent neither ETag nor Last-Modified, so the client can't
- // possibly has a valid cache.
- return false;
- }
- $isValid = ($this->resourceMatchedEtag() || $this->resourceNotModified());
- if ($isValid) {
- $this->_headers['_responseCode'] = 'HTTP/1.0 304 Not Modified';
- }
- return $isValid;
- }
-
- protected function resourceMatchedEtag()
- {
- if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
- return false;
- }
- $clientEtagList = get_magic_quotes_gpc()
- ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
- : $_SERVER['HTTP_IF_NONE_MATCH'];
- $clientEtags = explode(',', $clientEtagList);
-
- $compareTo = $this->normalizeEtag($this->_etag);
- foreach ($clientEtags as $clientEtag) {
- if ($this->normalizeEtag($clientEtag) === $compareTo) {
- // respond with the client's matched ETag, even if it's not what
- // we would've sent by default
- $this->_headers['ETag'] = trim($clientEtag);
- return true;
- }
- }
- return false;
- }
-
- protected function normalizeEtag($etag) {
- $etag = trim($etag);
- return $this->_stripEtag
- ? preg_replace('/;\\w\\w"$/', '"', $etag)
- : $etag;
- }
-
- protected function resourceNotModified()
- {
- if (!isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
- return false;
- }
- $ifModifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
- if (false !== ($semicolon = strrpos($ifModifiedSince, ';'))) {
- // IE has tacked on extra data to this header, strip it
- $ifModifiedSince = substr($ifModifiedSince, 0, $semicolon);
- }
- if ($ifModifiedSince == self::gmtDate($this->_lmTime)) {
- // Apache 2.2's behavior. If there was no ETag match, send the
- // non-encoded version of the ETag value.
- $this->_headers['ETag'] = $this->normalizeEtag($this->_etag);
- return true;
- }
- return false;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/HTTP/Encoder.php b/plugins/Minify/extlib/minify/min/lib/HTTP/Encoder.php
deleted file mode 100644
index 66c26789c3..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/HTTP/Encoder.php
+++ /dev/null
@@ -1,326 +0,0 @@
-
- * // Send a CSS file, compressed if possible
- * $he = new HTTP_Encoder(array(
- * 'content' => file_get_contents($cssFile)
- * ,'type' => 'text/css'
- * ));
- * $he->encode();
- * $he->sendAll();
- *
- *
- *
- * // Shortcut to encoding output
- * header('Content-Type: text/css'); // needed if not HTML
- * HTTP_Encoder::output($css);
- *
- *
- *
- * // Just sniff for the accepted encoding
- * $encoding = HTTP_Encoder::getAcceptedEncoding();
- *
- *
- * For more control over headers, use getHeaders() and getData() and send your
- * own output.
- *
- * Note: If you don't need header mgmt, use PHP's native gzencode, gzdeflate,
- * and gzcompress functions for gzip, deflate, and compress-encoding
- * respectively.
- *
- * @package Minify
- * @subpackage HTTP
- * @author Stephen Clay
- */
-class HTTP_Encoder {
-
- /**
- * Should the encoder allow HTTP encoding to IE6?
- *
- * If you have many IE6 users and the bandwidth savings is worth troubling
- * some of them, set this to true.
- *
- * By default, encoding is only offered to IE7+. When this is true,
- * getAcceptedEncoding() will return an encoding for IE6 if its user agent
- * string contains "SV1". This has been documented in many places as "safe",
- * but there seem to be remaining, intermittent encoding bugs in patched
- * IE6 on the wild web.
- *
- * @var bool
- */
- public static $encodeToIe6 = false;
-
-
- /**
- * Default compression level for zlib operations
- *
- * This level is used if encode() is not given a $compressionLevel
- *
- * @var int
- */
- public static $compressionLevel = 6;
-
-
- /**
- * Get an HTTP Encoder object
- *
- * @param array $spec options
- *
- * 'content': (string required) content to be encoded
- *
- * 'type': (string) if set, the Content-Type header will have this value.
- *
- * 'method: (string) only set this if you are forcing a particular encoding
- * method. If not set, the best method will be chosen by getAcceptedEncoding()
- * The available methods are 'gzip', 'deflate', 'compress', and '' (no
- * encoding)
- *
- * @return null
- */
- public function __construct($spec)
- {
- $this->_content = $spec['content'];
- $this->_headers['Content-Length'] = (string)strlen($this->_content);
- if (isset($spec['type'])) {
- $this->_headers['Content-Type'] = $spec['type'];
- }
- if (isset($spec['method'])
- && in_array($spec['method'], array('gzip', 'deflate', 'compress', '')))
- {
- $this->_encodeMethod = array($spec['method'], $spec['method']);
- } else {
- $this->_encodeMethod = self::getAcceptedEncoding();
- }
- }
-
- /**
- * Get content in current form
- *
- * Call after encode() for encoded content.
- *
- * return string
- */
- public function getContent()
- {
- return $this->_content;
- }
-
- /**
- * Get array of output headers to be sent
- *
- * E.g.
- *
- * array(
- * 'Content-Length' => '615'
- * ,'Content-Encoding' => 'x-gzip'
- * ,'Vary' => 'Accept-Encoding'
- * )
- *
- *
- * @return array
- */
- public function getHeaders()
- {
- return $this->_headers;
- }
-
- /**
- * Send output headers
- *
- * You must call this before headers are sent and it probably cannot be
- * used in conjunction with zlib output buffering / mod_gzip. Errors are
- * not handled purposefully.
- *
- * @see getHeaders()
- *
- * @return null
- */
- public function sendHeaders()
- {
- foreach ($this->_headers as $name => $val) {
- header($name . ': ' . $val);
- }
- }
-
- /**
- * Send output headers and content
- *
- * A shortcut for sendHeaders() and echo getContent()
- *
- * You must call this before headers are sent and it probably cannot be
- * used in conjunction with zlib output buffering / mod_gzip. Errors are
- * not handled purposefully.
- *
- * @return null
- */
- public function sendAll()
- {
- $this->sendHeaders();
- echo $this->_content;
- }
-
- /**
- * Determine the client's best encoding method from the HTTP Accept-Encoding
- * header.
- *
- * If no Accept-Encoding header is set, or the browser is IE before v6 SP2,
- * this will return ('', ''), the "identity" encoding.
- *
- * A syntax-aware scan is done of the Accept-Encoding, so the method must
- * be non 0. The methods are favored in order of gzip, deflate, then
- * compress. Deflate is always smallest and generally faster, but is
- * rarely sent by servers, so client support could be buggier.
- *
- * @param bool $allowCompress allow the older compress encoding
- *
- * @param bool $allowDeflate allow the more recent deflate encoding
- *
- * @return array two values, 1st is the actual encoding method, 2nd is the
- * alias of that method to use in the Content-Encoding header (some browsers
- * call gzip "x-gzip" etc.)
- */
- public static function getAcceptedEncoding($allowCompress = true, $allowDeflate = true)
- {
- // @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
- if (! isset($_SERVER['HTTP_ACCEPT_ENCODING'])
- || self::_isBuggyIe())
- {
- return array('', '');
- }
- $ae = $_SERVER['HTTP_ACCEPT_ENCODING'];
- // gzip checks (quick)
- if (0 === strpos($ae, 'gzip,') // most browsers
- || 0 === strpos($ae, 'deflate, gzip,') // opera
- ) {
- return array('gzip', 'gzip');
- }
- // gzip checks (slow)
- if (preg_match(
- '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
- return array('gzip', $m[1]);
- }
- if ($allowDeflate) {
- // deflate checks
- $aeRev = strrev($ae);
- if (0 === strpos($aeRev, 'etalfed ,') // ie, webkit
- || 0 === strpos($aeRev, 'etalfed,') // gecko
- || 0 === strpos($ae, 'deflate,') // opera
- // slow parsing
- || preg_match(
- '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae)) {
- return array('deflate', 'deflate');
- }
- }
- if ($allowCompress && preg_match(
- '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
- return array('compress', $m[1]);
- }
- return array('', '');
- }
-
- /**
- * Encode (compress) the content
- *
- * If the encode method is '' (none) or compression level is 0, or the 'zlib'
- * extension isn't loaded, we return false.
- *
- * Then the appropriate gz_* function is called to compress the content. If
- * this fails, false is returned.
- *
- * The header "Vary: Accept-Encoding" is added. If encoding is successful,
- * the Content-Length header is updated, and Content-Encoding is also added.
- *
- * @param int $compressionLevel given to zlib functions. If not given, the
- * class default will be used.
- *
- * @return bool success true if the content was actually compressed
- */
- public function encode($compressionLevel = null)
- {
- $this->_headers['Vary'] = 'Accept-Encoding';
- if (null === $compressionLevel) {
- $compressionLevel = self::$compressionLevel;
- }
- if ('' === $this->_encodeMethod[0]
- || ($compressionLevel == 0)
- || !extension_loaded('zlib'))
- {
- return false;
- }
- if ($this->_encodeMethod[0] === 'deflate') {
- $encoded = gzdeflate($this->_content, $compressionLevel);
- } elseif ($this->_encodeMethod[0] === 'gzip') {
- $encoded = gzencode($this->_content, $compressionLevel);
- } else {
- $encoded = gzcompress($this->_content, $compressionLevel);
- }
- if (false === $encoded) {
- return false;
- }
- $this->_headers['Content-Length'] = strlen($encoded);
- $this->_headers['Content-Encoding'] = $this->_encodeMethod[1];
- $this->_content = $encoded;
- return true;
- }
-
- /**
- * Encode and send appropriate headers and content
- *
- * This is a convenience method for common use of the class
- *
- * @param string $content
- *
- * @param int $compressionLevel given to zlib functions. If not given, the
- * class default will be used.
- *
- * @return bool success true if the content was actually compressed
- */
- public static function output($content, $compressionLevel = null)
- {
- if (null === $compressionLevel) {
- $compressionLevel = self::$compressionLevel;
- }
- $he = new HTTP_Encoder(array('content' => $content));
- $ret = $he->encode($compressionLevel);
- $he->sendAll();
- return $ret;
- }
-
- protected $_content = '';
- protected $_headers = array();
- protected $_encodeMethod = array('', '');
-
- /**
- * Is the browser an IE version earlier than 6 SP2?
- */
- protected static function _isBuggyIe()
- {
- $ua = $_SERVER['HTTP_USER_AGENT'];
- // quick escape for non-IEs
- if (0 !== strpos($ua, 'Mozilla/4.0 (compatible; MSIE ')
- || false !== strpos($ua, 'Opera')) {
- return false;
- }
- // no regex = faaast
- $version = (float)substr($ua, 30);
- return self::$encodeToIe6
- ? ($version < 6 || ($version == 6 && false === strpos($ua, 'SV1')))
- : ($version < 7);
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/JSMin.php b/plugins/Minify/extlib/minify/min/lib/JSMin.php
deleted file mode 100644
index 770e1c6104..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/JSMin.php
+++ /dev/null
@@ -1,314 +0,0 @@
- (PHP port)
- * @author Steve Clay (modifications + cleanup)
- * @author Andrea Giammarchi (spaceBeforeRegExp)
- * @copyright 2002 Douglas Crockford (jsmin.c)
- * @copyright 2008 Ryan Grove (PHP port)
- * @license http://opensource.org/licenses/mit-license.php MIT License
- * @link http://code.google.com/p/jsmin-php/
- */
-
-class JSMin {
- const ORD_LF = 10;
- const ORD_SPACE = 32;
- const ACTION_KEEP_A = 1;
- const ACTION_DELETE_A = 2;
- const ACTION_DELETE_A_B = 3;
-
- protected $a = "\n";
- protected $b = '';
- protected $input = '';
- protected $inputIndex = 0;
- protected $inputLength = 0;
- protected $lookAhead = null;
- protected $output = '';
-
- /**
- * Minify Javascript
- *
- * @param string $js Javascript to be minified
- * @return string
- */
- public static function minify($js)
- {
- $jsmin = new JSMin($js);
- return $jsmin->min();
- }
-
- /**
- * Setup process
- */
- public function __construct($input)
- {
- $this->input = str_replace("\r\n", "\n", $input);
- $this->inputLength = strlen($this->input);
- }
-
- /**
- * Perform minification, return result
- */
- public function min()
- {
- if ($this->output !== '') { // min already run
- return $this->output;
- }
- $this->action(self::ACTION_DELETE_A_B);
-
- while ($this->a !== null) {
- // determine next command
- $command = self::ACTION_KEEP_A; // default
- if ($this->a === ' ') {
- if (! $this->isAlphaNum($this->b)) {
- $command = self::ACTION_DELETE_A;
- }
- } elseif ($this->a === "\n") {
- if ($this->b === ' ') {
- $command = self::ACTION_DELETE_A_B;
- } elseif (false === strpos('{[(+-', $this->b)
- && ! $this->isAlphaNum($this->b)) {
- $command = self::ACTION_DELETE_A;
- }
- } elseif (! $this->isAlphaNum($this->a)) {
- if ($this->b === ' '
- || ($this->b === "\n"
- && (false === strpos('}])+-"\'', $this->a)))) {
- $command = self::ACTION_DELETE_A_B;
- }
- }
- $this->action($command);
- }
- $this->output = trim($this->output);
- return $this->output;
- }
-
- /**
- * ACTION_KEEP_A = Output A. Copy B to A. Get the next B.
- * ACTION_DELETE_A = Copy B to A. Get the next B.
- * ACTION_DELETE_A_B = Get the next B.
- */
- protected function action($command)
- {
- switch ($command) {
- case self::ACTION_KEEP_A:
- $this->output .= $this->a;
- // fallthrough
- case self::ACTION_DELETE_A:
- $this->a = $this->b;
- if ($this->a === "'" || $this->a === '"') { // string literal
- $str = $this->a; // in case needed for exception
- while (true) {
- $this->output .= $this->a;
- $this->a = $this->get();
- if ($this->a === $this->b) { // end quote
- break;
- }
- if (ord($this->a) <= self::ORD_LF) {
- throw new JSMin_UnterminatedStringException(
- 'Unterminated String: ' . var_export($str, true));
- }
- $str .= $this->a;
- if ($this->a === '\\') {
- $this->output .= $this->a;
- $this->a = $this->get();
- $str .= $this->a;
- }
- }
- }
- // fallthrough
- case self::ACTION_DELETE_A_B:
- $this->b = $this->next();
- if ($this->b === '/' && $this->isRegexpLiteral()) { // RegExp literal
- $this->output .= $this->a . $this->b;
- $pattern = '/'; // in case needed for exception
- while (true) {
- $this->a = $this->get();
- $pattern .= $this->a;
- if ($this->a === '/') { // end pattern
- break; // while (true)
- } elseif ($this->a === '\\') {
- $this->output .= $this->a;
- $this->a = $this->get();
- $pattern .= $this->a;
- } elseif (ord($this->a) <= self::ORD_LF) {
- throw new JSMin_UnterminatedRegExpException(
- 'Unterminated RegExp: '. var_export($pattern, true));
- }
- $this->output .= $this->a;
- }
- $this->b = $this->next();
- }
- // end case ACTION_DELETE_A_B
- }
- }
-
- protected function isRegexpLiteral()
- {
- if (false !== strpos("\n{;(,=:[!&|?", $this->a)) { // we aren't dividing
- return true;
- }
- if (' ' === $this->a) {
- $length = strlen($this->output);
- if ($length < 2) { // weird edge case
- return true;
- }
- // you can't divide a keyword
- if (preg_match('/(?:case|else|in|return|typeof)$/', $this->output, $m)) {
- if ($this->output === $m[0]) { // odd but could happen
- return true;
- }
- // make sure it's a keyword, not end of an identifier
- $charBeforeKeyword = substr($this->output, $length - strlen($m[0]) - 1, 1);
- if (! $this->isAlphaNum($charBeforeKeyword)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Get next char. Convert ctrl char to space.
- */
- protected function get()
- {
- $c = $this->lookAhead;
- $this->lookAhead = null;
- if ($c === null) {
- if ($this->inputIndex < $this->inputLength) {
- $c = $this->input[$this->inputIndex];
- $this->inputIndex += 1;
- } else {
- return null;
- }
- }
- if ($c === "\r" || $c === "\n") {
- return "\n";
- }
- if (ord($c) < self::ORD_SPACE) { // control char
- return ' ';
- }
- return $c;
- }
-
- /**
- * Get next char. If is ctrl character, translate to a space or newline.
- */
- protected function peek()
- {
- $this->lookAhead = $this->get();
- return $this->lookAhead;
- }
-
- /**
- * Is $c a letter, digit, underscore, dollar sign, escape, or non-ASCII?
- */
- protected function isAlphaNum($c)
- {
- return (preg_match('/^[0-9a-zA-Z_\\$\\\\]$/', $c) || ord($c) > 126);
- }
-
- protected function singleLineComment()
- {
- $comment = '';
- while (true) {
- $get = $this->get();
- $comment .= $get;
- if (ord($get) <= self::ORD_LF) { // EOL reached
- // if IE conditional comment
- if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
- return "/{$comment}";
- }
- return $get;
- }
- }
- }
-
- protected function multipleLineComment()
- {
- $this->get();
- $comment = '';
- while (true) {
- $get = $this->get();
- if ($get === '*') {
- if ($this->peek() === '/') { // end of comment reached
- $this->get();
- // if comment preserved by YUI Compressor
- if (0 === strpos($comment, '!')) {
- return "\n/*" . substr($comment, 1) . "*/\n";
- }
- // if IE conditional comment
- if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
- return "/*{$comment}*/";
- }
- return ' ';
- }
- } elseif ($get === null) {
- throw new JSMin_UnterminatedCommentException('Unterminated Comment: ' . var_export('/*' . $comment, true));
- }
- $comment .= $get;
- }
- }
-
- /**
- * Get the next character, skipping over comments.
- * Some comments may be preserved.
- */
- protected function next()
- {
- $get = $this->get();
- if ($get !== '/') {
- return $get;
- }
- switch ($this->peek()) {
- case '/': return $this->singleLineComment();
- case '*': return $this->multipleLineComment();
- default: return $get;
- }
- }
-}
-
-class JSMin_UnterminatedStringException extends Exception {}
-class JSMin_UnterminatedCommentException extends Exception {}
-class JSMin_UnterminatedRegExpException extends Exception {}
diff --git a/plugins/Minify/extlib/minify/min/lib/JSMinPlus.php b/plugins/Minify/extlib/minify/min/lib/JSMinPlus.php
deleted file mode 100644
index 31a1a5cb48..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/JSMinPlus.php
+++ /dev/null
@@ -1,1872 +0,0 @@
-
- *
- * Usage: $minified = JSMinPlus::minify($script [, $filename])
- *
- * Versionlog (see also changelog.txt):
- * 12-04-2009 - some small bugfixes and performance improvements
- * 09-04-2009 - initial open sourced version 1.0
- *
- * Latest version of this script: http://files.tweakers.net/jsminplus/jsminplus.zip
- *
- */
-
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Narcissus JavaScript engine.
- *
- * The Initial Developer of the Original Code is
- * Brendan Eich .
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Tino Zijdel
- * PHP port, modifications and minifier routine are (C) 2009
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('TOKEN_END', 1);
-define('TOKEN_NUMBER', 2);
-define('TOKEN_IDENTIFIER', 3);
-define('TOKEN_STRING', 4);
-define('TOKEN_REGEXP', 5);
-define('TOKEN_NEWLINE', 6);
-define('TOKEN_CONDCOMMENT_MULTILINE', 7);
-
-define('JS_SCRIPT', 100);
-define('JS_BLOCK', 101);
-define('JS_LABEL', 102);
-define('JS_FOR_IN', 103);
-define('JS_CALL', 104);
-define('JS_NEW_WITH_ARGS', 105);
-define('JS_INDEX', 106);
-define('JS_ARRAY_INIT', 107);
-define('JS_OBJECT_INIT', 108);
-define('JS_PROPERTY_INIT', 109);
-define('JS_GETTER', 110);
-define('JS_SETTER', 111);
-define('JS_GROUP', 112);
-define('JS_LIST', 113);
-
-define('DECLARED_FORM', 0);
-define('EXPRESSED_FORM', 1);
-define('STATEMENT_FORM', 2);
-
-class JSMinPlus
-{
- private $parser;
- private $reserved = array(
- 'break', 'case', 'catch', 'continue', 'default', 'delete', 'do',
- 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof',
- 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var',
- 'void', 'while', 'with',
- // Words reserved for future use
- 'abstract', 'boolean', 'byte', 'char', 'class', 'const', 'debugger',
- 'double', 'enum', 'export', 'extends', 'final', 'float', 'goto',
- 'implements', 'import', 'int', 'interface', 'long', 'native',
- 'package', 'private', 'protected', 'public', 'short', 'static',
- 'super', 'synchronized', 'throws', 'transient', 'volatile',
- // These are not reserved, but should be taken into account
- // in isValidIdentifier (See jslint source code)
- 'arguments', 'eval', 'true', 'false', 'Infinity', 'NaN', 'null', 'undefined'
- );
-
- private function __construct()
- {
- $this->parser = new JSParser();
- }
-
- public static function minify($js, $filename='')
- {
- static $instance;
-
- // this is a singleton
- if(!$instance)
- $instance = new JSMinPlus();
-
- return $instance->min($js, $filename);
- }
-
- private function min($js, $filename)
- {
- try
- {
- $n = $this->parser->parse($js, $filename, 1);
- return $this->parseTree($n);
- }
- catch(Exception $e)
- {
- echo $e->getMessage() . "\n";
- }
-
- return false;
- }
-
- private function parseTree($n, $noBlockGrouping = false)
- {
- $s = '';
-
- switch ($n->type)
- {
- case KEYWORD_FUNCTION:
- $s .= 'function' . ($n->name ? ' ' . $n->name : '') . '(';
- $params = $n->params;
- for ($i = 0, $j = count($params); $i < $j; $i++)
- $s .= ($i ? ',' : '') . $params[$i];
- $s .= '){' . $this->parseTree($n->body, true) . '}';
- break;
-
- case JS_SCRIPT:
- // we do nothing with funDecls or varDecls
- $noBlockGrouping = true;
- // fall through
- case JS_BLOCK:
- $childs = $n->treeNodes;
- for ($c = 0, $i = 0, $j = count($childs); $i < $j; $i++)
- {
- $t = $this->parseTree($childs[$i]);
- if (strlen($t))
- {
- if ($c)
- {
- if ($childs[$i]->type == KEYWORD_FUNCTION && $childs[$i]->functionForm == DECLARED_FORM)
- $s .= "\n"; // put declared functions on a new line
- else
- $s .= ';';
- }
-
- $s .= $t;
-
- $c++;
- }
- }
-
- if ($c > 1 && !$noBlockGrouping)
- {
- $s = '{' . $s . '}';
- }
- break;
-
- case KEYWORD_IF:
- $s = 'if(' . $this->parseTree($n->condition) . ')';
- $thenPart = $this->parseTree($n->thenPart);
- $elsePart = $n->elsePart ? $this->parseTree($n->elsePart) : null;
-
- // quite a rancid hack to see if we should enclose the thenpart in brackets
- if ($thenPart[0] != '{')
- {
- if (strpos($thenPart, 'if(') !== false)
- $thenPart = '{' . $thenPart . '}';
- elseif ($elsePart)
- $thenPart .= ';';
- }
-
- $s .= $thenPart;
-
- if ($elsePart)
- {
- $s .= 'else';
-
- if ($elsePart[0] != '{')
- $s .= ' ';
-
- $s .= $elsePart;
- }
- break;
-
- case KEYWORD_SWITCH:
- $s = 'switch(' . $this->parseTree($n->discriminant) . '){';
- $cases = $n->cases;
- for ($i = 0, $j = count($cases); $i < $j; $i++)
- {
- $case = $cases[$i];
- if ($case->type == KEYWORD_CASE)
- $s .= 'case' . ($case->caseLabel->type != TOKEN_STRING ? ' ' : '') . $this->parseTree($case->caseLabel) . ':';
- else
- $s .= 'default:';
-
- $statement = $this->parseTree($case->statements);
- if ($statement)
- $s .= $statement . ';';
- }
- $s = rtrim($s, ';') . '}';
- break;
-
- case KEYWORD_FOR:
- $s = 'for(' . ($n->setup ? $this->parseTree($n->setup) : '')
- . ';' . ($n->condition ? $this->parseTree($n->condition) : '')
- . ';' . ($n->update ? $this->parseTree($n->update) : '') . ')'
- . $this->parseTree($n->body);
- break;
-
- case KEYWORD_WHILE:
- $s = 'while(' . $this->parseTree($n->condition) . ')' . $this->parseTree($n->body);
- break;
-
- case JS_FOR_IN:
- $s = 'for(' . ($n->varDecl ? $this->parseTree($n->varDecl) : $this->parseTree($n->iterator)) . ' in ' . $this->parseTree($n->object) . ')' . $this->parseTree($n->body);
- break;
-
- case KEYWORD_DO:
- $s = 'do{' . $this->parseTree($n->body, true) . '}while(' . $this->parseTree($n->condition) . ')';
- break;
-
- case KEYWORD_BREAK:
- case KEYWORD_CONTINUE:
- $s = $n->value . ($n->label ? ' ' . $n->label : '');
- break;
-
- case KEYWORD_TRY:
- $s = 'try{' . $this->parseTree($n->tryBlock, true) . '}';
- $catchClauses = $n->catchClauses;
- for ($i = 0, $j = count($catchClauses); $i < $j; $i++)
- {
- $t = $catchClauses[$i];
- $s .= 'catch(' . $t->varName . ($t->guard ? ' if ' . $this->parseTree($t->guard) : '') . '){' . $this->parseTree($t->block, true) . '}';
- }
- if ($n->finallyBlock)
- $s .= 'finally{' . $this->parseTree($n->finallyBlock, true) . '}';
- break;
-
- case KEYWORD_THROW:
- $s = 'throw ' . $this->parseTree($n->exception);
- break;
-
- case KEYWORD_RETURN:
- $s = 'return' . ($n->value ? ' ' . $this->parseTree($n->value) : '');
- break;
-
- case KEYWORD_WITH:
- $s = 'with(' . $this->parseTree($n->object) . ')' . $this->parseTree($n->body);
- break;
-
- case KEYWORD_VAR:
- case KEYWORD_CONST:
- $s = $n->value . ' ';
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- {
- $t = $childs[$i];
- $s .= ($i ? ',' : '') . $t->name;
- $u = $t->initializer;
- if ($u)
- $s .= '=' . $this->parseTree($u);
- }
- break;
-
- case KEYWORD_DEBUGGER:
- throw new Exception('NOT IMPLEMENTED: DEBUGGER');
- break;
-
- case TOKEN_CONDCOMMENT_MULTILINE:
- $s = $n->value . ' ';
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- $s .= $this->parseTree($childs[$i]);
- break;
-
- case OP_SEMICOLON:
- if ($expression = $n->expression)
- $s = $this->parseTree($expression);
- break;
-
- case JS_LABEL:
- $s = $n->label . ':' . $this->parseTree($n->statement);
- break;
-
- case OP_COMMA:
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]);
- break;
-
- case OP_ASSIGN:
- $s = $this->parseTree($n->treeNodes[0]) . $n->value . $this->parseTree($n->treeNodes[1]);
- break;
-
- case OP_HOOK:
- $s = $this->parseTree($n->treeNodes[0]) . '?' . $this->parseTree($n->treeNodes[1]) . ':' . $this->parseTree($n->treeNodes[2]);
- break;
-
- case OP_OR: case OP_AND:
- case OP_BITWISE_OR: case OP_BITWISE_XOR: case OP_BITWISE_AND:
- case OP_EQ: case OP_NE: case OP_STRICT_EQ: case OP_STRICT_NE:
- case OP_LT: case OP_LE: case OP_GE: case OP_GT:
- case OP_LSH: case OP_RSH: case OP_URSH:
- case OP_MUL: case OP_DIV: case OP_MOD:
- $s = $this->parseTree($n->treeNodes[0]) . $n->type . $this->parseTree($n->treeNodes[1]);
- break;
-
- case OP_PLUS:
- case OP_MINUS:
- $s = $this->parseTree($n->treeNodes[0]) . $n->type;
- $nextTokenType = $n->treeNodes[1]->type;
- if ( $nextTokenType == OP_PLUS || $nextTokenType == OP_MINUS ||
- $nextTokenType == OP_INCREMENT || $nextTokenType == OP_DECREMENT ||
- $nextTokenType == OP_UNARY_PLUS || $nextTokenType == OP_UNARY_MINUS
- )
- $s .= ' ';
- $s .= $this->parseTree($n->treeNodes[1]);
- break;
-
- case KEYWORD_IN:
- $s = $this->parseTree($n->treeNodes[0]) . ' in ' . $this->parseTree($n->treeNodes[1]);
- break;
-
- case KEYWORD_INSTANCEOF:
- $s = $this->parseTree($n->treeNodes[0]) . ' instanceof ' . $this->parseTree($n->treeNodes[1]);
- break;
-
- case KEYWORD_DELETE:
- $s = 'delete ' . $this->parseTree($n->treeNodes[0]);
- break;
-
- case KEYWORD_VOID:
- $s = 'void(' . $this->parseTree($n->treeNodes[0]) . ')';
- break;
-
- case KEYWORD_TYPEOF:
- $s = 'typeof ' . $this->parseTree($n->treeNodes[0]);
- break;
-
- case OP_NOT:
- case OP_BITWISE_NOT:
- case OP_UNARY_PLUS:
- case OP_UNARY_MINUS:
- $s = $n->value . $this->parseTree($n->treeNodes[0]);
- break;
-
- case OP_INCREMENT:
- case OP_DECREMENT:
- if ($n->postfix)
- $s = $this->parseTree($n->treeNodes[0]) . $n->value;
- else
- $s = $n->value . $this->parseTree($n->treeNodes[0]);
- break;
-
- case OP_DOT:
- $s = $this->parseTree($n->treeNodes[0]) . '.' . $this->parseTree($n->treeNodes[1]);
- break;
-
- case JS_INDEX:
- $s = $this->parseTree($n->treeNodes[0]);
- // See if we can replace named index with a dot saving 3 bytes
- if ( $n->treeNodes[0]->type == TOKEN_IDENTIFIER &&
- $n->treeNodes[1]->type == TOKEN_STRING &&
- $this->isValidIdentifier(substr($n->treeNodes[1]->value, 1, -1))
- )
- $s .= '.' . substr($n->treeNodes[1]->value, 1, -1);
- else
- $s .= '[' . $this->parseTree($n->treeNodes[1]) . ']';
- break;
-
- case JS_LIST:
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]);
- break;
-
- case JS_CALL:
- $s = $this->parseTree($n->treeNodes[0]) . '(' . $this->parseTree($n->treeNodes[1]) . ')';
- break;
-
- case KEYWORD_NEW:
- case JS_NEW_WITH_ARGS:
- $s = 'new ' . $this->parseTree($n->treeNodes[0]) . '(' . ($n->type == JS_NEW_WITH_ARGS ? $this->parseTree($n->treeNodes[1]) : '') . ')';
- break;
-
- case JS_ARRAY_INIT:
- $s = '[';
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- {
- $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]);
- }
- $s .= ']';
- break;
-
- case JS_OBJECT_INIT:
- $s = '{';
- $childs = $n->treeNodes;
- for ($i = 0, $j = count($childs); $i < $j; $i++)
- {
- $t = $childs[$i];
- if ($i)
- $s .= ',';
- if ($t->type == JS_PROPERTY_INIT)
- {
- // Ditch the quotes when the index is a valid identifier
- if ( $t->treeNodes[0]->type == TOKEN_STRING &&
- $this->isValidIdentifier(substr($t->treeNodes[0]->value, 1, -1))
- )
- $s .= substr($t->treeNodes[0]->value, 1, -1);
- else
- $s .= $t->treeNodes[0]->value;
-
- $s .= ':' . $this->parseTree($t->treeNodes[1]);
- }
- else
- {
- $s .= $t->type == JS_GETTER ? 'get' : 'set';
- $s .= ' ' . $t->name . '(';
- $params = $t->params;
- for ($i = 0, $j = count($params); $i < $j; $i++)
- $s .= ($i ? ',' : '') . $params[$i];
- $s .= '){' . $this->parseTree($t->body, true) . '}';
- }
- }
- $s .= '}';
- break;
-
- case KEYWORD_NULL: case KEYWORD_THIS: case KEYWORD_TRUE: case KEYWORD_FALSE:
- case TOKEN_IDENTIFIER: case TOKEN_NUMBER: case TOKEN_STRING: case TOKEN_REGEXP:
- $s = $n->value;
- break;
-
- case JS_GROUP:
- $s = '(' . $this->parseTree($n->treeNodes[0]) . ')';
- break;
-
- default:
- throw new Exception('UNKNOWN TOKEN TYPE: ' . $n->type);
- }
-
- return $s;
- }
-
- private function isValidIdentifier($string)
- {
- return preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $string) && !in_array($string, $this->reserved);
- }
-}
-
-class JSParser
-{
- private $t;
-
- private $opPrecedence = array(
- ';' => 0,
- ',' => 1,
- '=' => 2, '?' => 2, ':' => 2,
- // The above all have to have the same precedence, see bug 330975.
- '||' => 4,
- '&&' => 5,
- '|' => 6,
- '^' => 7,
- '&' => 8,
- '==' => 9, '!=' => 9, '===' => 9, '!==' => 9,
- '<' => 10, '<=' => 10, '>=' => 10, '>' => 10, 'in' => 10, 'instanceof' => 10,
- '<<' => 11, '>>' => 11, '>>>' => 11,
- '+' => 12, '-' => 12,
- '*' => 13, '/' => 13, '%' => 13,
- 'delete' => 14, 'void' => 14, 'typeof' => 14,
- '!' => 14, '~' => 14, 'U+' => 14, 'U-' => 14,
- '++' => 15, '--' => 15,
- 'new' => 16,
- '.' => 17,
- JS_NEW_WITH_ARGS => 0, JS_INDEX => 0, JS_CALL => 0,
- JS_ARRAY_INIT => 0, JS_OBJECT_INIT => 0, JS_GROUP => 0
- );
-
- private $opArity = array(
- ',' => -2,
- '=' => 2,
- '?' => 3,
- '||' => 2,
- '&&' => 2,
- '|' => 2,
- '^' => 2,
- '&' => 2,
- '==' => 2, '!=' => 2, '===' => 2, '!==' => 2,
- '<' => 2, '<=' => 2, '>=' => 2, '>' => 2, 'in' => 2, 'instanceof' => 2,
- '<<' => 2, '>>' => 2, '>>>' => 2,
- '+' => 2, '-' => 2,
- '*' => 2, '/' => 2, '%' => 2,
- 'delete' => 1, 'void' => 1, 'typeof' => 1,
- '!' => 1, '~' => 1, 'U+' => 1, 'U-' => 1,
- '++' => 1, '--' => 1,
- 'new' => 1,
- '.' => 2,
- JS_NEW_WITH_ARGS => 2, JS_INDEX => 2, JS_CALL => 2,
- JS_ARRAY_INIT => 1, JS_OBJECT_INIT => 1, JS_GROUP => 1,
- TOKEN_CONDCOMMENT_MULTILINE => 1
- );
-
- public function __construct()
- {
- $this->t = new JSTokenizer();
- }
-
- public function parse($s, $f, $l)
- {
- // initialize tokenizer
- $this->t->init($s, $f, $l);
-
- $x = new JSCompilerContext(false);
- $n = $this->Script($x);
- if (!$this->t->isDone())
- throw $this->t->newSyntaxError('Syntax error');
-
- return $n;
- }
-
- private function Script($x)
- {
- $n = $this->Statements($x);
- $n->type = JS_SCRIPT;
- $n->funDecls = $x->funDecls;
- $n->varDecls = $x->varDecls;
-
- return $n;
- }
-
- private function Statements($x)
- {
- $n = new JSNode($this->t, JS_BLOCK);
- array_push($x->stmtStack, $n);
-
- while (!$this->t->isDone() && $this->t->peek() != OP_RIGHT_CURLY)
- $n->addNode($this->Statement($x));
-
- array_pop($x->stmtStack);
-
- return $n;
- }
-
- private function Block($x)
- {
- $this->t->mustMatch(OP_LEFT_CURLY);
- $n = $this->Statements($x);
- $this->t->mustMatch(OP_RIGHT_CURLY);
-
- return $n;
- }
-
- private function Statement($x)
- {
- $tt = $this->t->get();
- $n2 = null;
-
- // Cases for statements ending in a right curly return early, avoiding the
- // common semicolon insertion magic after this switch.
- switch ($tt)
- {
- case KEYWORD_FUNCTION:
- return $this->FunctionDefinition(
- $x,
- true,
- count($x->stmtStack) > 1 ? STATEMENT_FORM : DECLARED_FORM
- );
- break;
-
- case OP_LEFT_CURLY:
- $n = $this->Statements($x);
- $this->t->mustMatch(OP_RIGHT_CURLY);
- return $n;
-
- case KEYWORD_IF:
- $n = new JSNode($this->t);
- $n->condition = $this->ParenExpression($x);
- array_push($x->stmtStack, $n);
- $n->thenPart = $this->Statement($x);
- $n->elsePart = $this->t->match(KEYWORD_ELSE) ? $this->Statement($x) : null;
- array_pop($x->stmtStack);
- return $n;
-
- case KEYWORD_SWITCH:
- $n = new JSNode($this->t);
- $this->t->mustMatch(OP_LEFT_PAREN);
- $n->discriminant = $this->Expression($x);
- $this->t->mustMatch(OP_RIGHT_PAREN);
- $n->cases = array();
- $n->defaultIndex = -1;
-
- array_push($x->stmtStack, $n);
-
- $this->t->mustMatch(OP_LEFT_CURLY);
-
- while (($tt = $this->t->get()) != OP_RIGHT_CURLY)
- {
- switch ($tt)
- {
- case KEYWORD_DEFAULT:
- if ($n->defaultIndex >= 0)
- throw $this->t->newSyntaxError('More than one switch default');
- // FALL THROUGH
- case KEYWORD_CASE:
- $n2 = new JSNode($this->t);
- if ($tt == KEYWORD_DEFAULT)
- $n->defaultIndex = count($n->cases);
- else
- $n2->caseLabel = $this->Expression($x, OP_COLON);
- break;
- default:
- throw $this->t->newSyntaxError('Invalid switch case');
- }
-
- $this->t->mustMatch(OP_COLON);
- $n2->statements = new JSNode($this->t, JS_BLOCK);
- while (($tt = $this->t->peek()) != KEYWORD_CASE && $tt != KEYWORD_DEFAULT && $tt != OP_RIGHT_CURLY)
- $n2->statements->addNode($this->Statement($x));
-
- array_push($n->cases, $n2);
- }
-
- array_pop($x->stmtStack);
- return $n;
-
- case KEYWORD_FOR:
- $n = new JSNode($this->t);
- $n->isLoop = true;
- $this->t->mustMatch(OP_LEFT_PAREN);
-
- if (($tt = $this->t->peek()) != OP_SEMICOLON)
- {
- $x->inForLoopInit = true;
- if ($tt == KEYWORD_VAR || $tt == KEYWORD_CONST)
- {
- $this->t->get();
- $n2 = $this->Variables($x);
- }
- else
- {
- $n2 = $this->Expression($x);
- }
- $x->inForLoopInit = false;
- }
-
- if ($n2 && $this->t->match(KEYWORD_IN))
- {
- $n->type = JS_FOR_IN;
- if ($n2->type == KEYWORD_VAR)
- {
- if (count($n2->treeNodes) != 1)
- {
- throw $this->t->SyntaxError(
- 'Invalid for..in left-hand side',
- $this->t->filename,
- $n2->lineno
- );
- }
-
- // NB: n2[0].type == IDENTIFIER and n2[0].value == n2[0].name.
- $n->iterator = $n2->treeNodes[0];
- $n->varDecl = $n2;
- }
- else
- {
- $n->iterator = $n2;
- $n->varDecl = null;
- }
-
- $n->object = $this->Expression($x);
- }
- else
- {
- $n->setup = $n2 ? $n2 : null;
- $this->t->mustMatch(OP_SEMICOLON);
- $n->condition = $this->t->peek() == OP_SEMICOLON ? null : $this->Expression($x);
- $this->t->mustMatch(OP_SEMICOLON);
- $n->update = $this->t->peek() == OP_RIGHT_PAREN ? null : $this->Expression($x);
- }
-
- $this->t->mustMatch(OP_RIGHT_PAREN);
- $n->body = $this->nest($x, $n);
- return $n;
-
- case KEYWORD_WHILE:
- $n = new JSNode($this->t);
- $n->isLoop = true;
- $n->condition = $this->ParenExpression($x);
- $n->body = $this->nest($x, $n);
- return $n;
-
- case KEYWORD_DO:
- $n = new JSNode($this->t);
- $n->isLoop = true;
- $n->body = $this->nest($x, $n, KEYWORD_WHILE);
- $n->condition = $this->ParenExpression($x);
- if (!$x->ecmaStrictMode)
- {
- // ";
- * $link = " ";
- *
- * // in min.php
- * Minify::serve('Groups', array(
- * 'groups' => $groupSources
- * ,'setExpires' => (time() + 86400 * 365)
- * ));
- *
- *
- * @package Minify
- * @author Stephen Clay
- */
-class Minify_Build {
-
- /**
- * Last modification time of all files in the build
- *
- * @var int
- */
- public $lastModified = 0;
-
- /**
- * String to use as ampersand in uri(). Set this to '&' if
- * you are not HTML-escaping URIs.
- *
- * @var string
- */
- public static $ampersand = '&';
-
- /**
- * Get a time-stamped URI
- *
- *
- * echo $b->uri('/site.js');
- * // outputs "/site.js?1678242"
- *
- * echo $b->uri('/scriptaculous.js?load=effects');
- * // outputs "/scriptaculous.js?load=effects&1678242"
- *
- *
- * @param string $uri
- * @param boolean $forceAmpersand (default = false) Force the use of ampersand to
- * append the timestamp to the URI.
- * @return string
- */
- public function uri($uri, $forceAmpersand = false) {
- $sep = ($forceAmpersand || strpos($uri, '?') !== false)
- ? self::$ampersand
- : '?';
- return "{$uri}{$sep}{$this->lastModified}";
- }
-
- /**
- * Create a build object
- *
- * @param array $sources array of Minify_Source objects and/or file paths
- *
- * @return null
- */
- public function __construct($sources)
- {
- $max = 0;
- foreach ((array)$sources as $source) {
- if ($source instanceof Minify_Source) {
- $max = max($max, $source->lastModified);
- } elseif (is_string($source)) {
- if (0 === strpos($source, '//')) {
- $source = $_SERVER['DOCUMENT_ROOT'] . substr($source, 1);
- }
- if (is_file($source)) {
- $max = max($max, filemtime($source));
- }
- }
- }
- $this->lastModified = $max;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/CSS.php b/plugins/Minify/extlib/minify/min/lib/Minify/CSS.php
deleted file mode 100644
index 2220cf2211..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/CSS.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- * @author http://code.google.com/u/1stvamp/ (Issue 64 patch)
- */
-class Minify_CSS {
-
- /**
- * Minify a CSS string
- *
- * @param string $css
- *
- * @param array $options available options:
- *
- * 'preserveComments': (default true) multi-line comments that begin
- * with "/*!" will be preserved with newlines before and after to
- * enhance readability.
- *
- * 'prependRelativePath': (default null) if given, this string will be
- * prepended to all relative URIs in import/url declarations
- *
- * 'currentDir': (default null) if given, this is assumed to be the
- * directory of the current CSS file. Using this, minify will rewrite
- * all relative URIs in import/url declarations to correctly point to
- * the desired files. For this to work, the files *must* exist and be
- * visible by the PHP process.
- *
- * 'symlinks': (default = array()) If the CSS file is stored in
- * a symlink-ed directory, provide an array of link paths to
- * target paths, where the link paths are within the document root. Because
- * paths need to be normalized for this to work, use "//" to substitute
- * the doc root in the link paths (the array keys). E.g.:
- *
- * array('//symlink' => '/real/target/path') // unix
- * array('//static' => 'D:\\staticStorage') // Windows
- *
- *
- * @return string
- */
- public static function minify($css, $options = array())
- {
- require_once 'Minify/CSS/Compressor.php';
- if (isset($options['preserveComments'])
- && !$options['preserveComments']) {
- $css = Minify_CSS_Compressor::process($css, $options);
- } else {
- require_once 'Minify/CommentPreserver.php';
- $css = Minify_CommentPreserver::process(
- $css
- ,array('Minify_CSS_Compressor', 'process')
- ,array($options)
- );
- }
- if (! isset($options['currentDir']) && ! isset($options['prependRelativePath'])) {
- return $css;
- }
- require_once 'Minify/CSS/UriRewriter.php';
- if (isset($options['currentDir'])) {
- return Minify_CSS_UriRewriter::rewrite(
- $css
- ,$options['currentDir']
- ,isset($options['docRoot']) ? $options['docRoot'] : $_SERVER['DOCUMENT_ROOT']
- ,isset($options['symlinks']) ? $options['symlinks'] : array()
- );
- } else {
- return Minify_CSS_UriRewriter::prepend(
- $css
- ,$options['prependRelativePath']
- );
- }
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/CSS/Compressor.php b/plugins/Minify/extlib/minify/min/lib/Minify/CSS/Compressor.php
deleted file mode 100644
index a34828681d..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/CSS/Compressor.php
+++ /dev/null
@@ -1,250 +0,0 @@
-
- * @author http://code.google.com/u/1stvamp/ (Issue 64 patch)
- */
-class Minify_CSS_Compressor {
-
- /**
- * Minify a CSS string
- *
- * @param string $css
- *
- * @param array $options (currently ignored)
- *
- * @return string
- */
- public static function process($css, $options = array())
- {
- $obj = new Minify_CSS_Compressor($options);
- return $obj->_process($css);
- }
-
- /**
- * @var array options
- */
- protected $_options = null;
-
- /**
- * @var bool Are we "in" a hack?
- *
- * I.e. are some browsers targetted until the next comment?
- */
- protected $_inHack = false;
-
-
- /**
- * Constructor
- *
- * @param array $options (currently ignored)
- *
- * @return null
- */
- private function __construct($options) {
- $this->_options = $options;
- }
-
- /**
- * Minify a CSS string
- *
- * @param string $css
- *
- * @return string
- */
- protected function _process($css)
- {
- $css = str_replace("\r\n", "\n", $css);
-
- // preserve empty comment after '>'
- // http://www.webdevout.net/css-hacks#in_css-selectors
- $css = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $css);
-
- // preserve empty comment between property and value
- // http://css-discuss.incutio.com/?page=BoxModelHack
- $css = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $css);
- $css = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $css);
-
- // apply callback to all valid comments (and strip out surrounding ws
- $css = preg_replace_callback('@\\s*/\\*([\\s\\S]*?)\\*/\\s*@'
- ,array($this, '_commentCB'), $css);
-
- // remove ws around { } and last semicolon in declaration block
- $css = preg_replace('/\\s*{\\s*/', '{', $css);
- $css = preg_replace('/;?\\s*}\\s*/', '}', $css);
-
- // remove ws surrounding semicolons
- $css = preg_replace('/\\s*;\\s*/', ';', $css);
-
- // remove ws around urls
- $css = preg_replace('/
- url\\( # url(
- \\s*
- ([^\\)]+?) # 1 = the URL (really just a bunch of non right parenthesis)
- \\s*
- \\) # )
- /x', 'url($1)', $css);
-
- // remove ws between rules and colons
- $css = preg_replace('/
- \\s*
- ([{;]) # 1 = beginning of block or rule separator
- \\s*
- ([\\*_]?[\\w\\-]+) # 2 = property (and maybe IE filter)
- \\s*
- :
- \\s*
- (\\b|[#\'"]) # 3 = first character of a value
- /x', '$1$2:$3', $css);
-
- // remove ws in selectors
- $css = preg_replace_callback('/
- (?: # non-capture
- \\s*
- [^~>+,\\s]+ # selector part
- \\s*
- [,>+~] # combinators
- )+
- \\s*
- [^~>+,\\s]+ # selector part
- { # open declaration block
- /x'
- ,array($this, '_selectorsCB'), $css);
-
- // minimize hex colors
- $css = preg_replace('/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i'
- , '$1#$2$3$4$5', $css);
-
- // remove spaces between font families
- $css = preg_replace_callback('/font-family:([^;}]+)([;}])/'
- ,array($this, '_fontFamilyCB'), $css);
-
- $css = preg_replace('/@import\\s+url/', '@import url', $css);
-
- // replace any ws involving newlines with a single newline
- $css = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $css);
-
- // separate common descendent selectors w/ newlines (to limit line lengths)
- $css = preg_replace('/([\\w#\\.\\*]+)\\s+([\\w#\\.\\*]+){/', "$1\n$2{", $css);
-
- // Use newline after 1st numeric value (to limit line lengths).
- $css = preg_replace('/
- ((?:padding|margin|border|outline):\\d+(?:px|em)?) # 1 = prop : 1st numeric value
- \\s+
- /x'
- ,"$1\n", $css);
-
- // prevent triggering IE6 bug: http://www.crankygeek.com/ie6pebug/
- $css = preg_replace('/:first-l(etter|ine)\\{/', ':first-l$1 {', $css);
-
- return trim($css);
- }
-
- /**
- * Replace what looks like a set of selectors
- *
- * @param array $m regex matches
- *
- * @return string
- */
- protected function _selectorsCB($m)
- {
- // remove ws around the combinators
- return preg_replace('/\\s*([,>+~])\\s*/', '$1', $m[0]);
- }
-
- /**
- * Process a comment and return a replacement
- *
- * @param array $m regex matches
- *
- * @return string
- */
- protected function _commentCB($m)
- {
- $hasSurroundingWs = (trim($m[0]) !== $m[1]);
- $m = $m[1];
- // $m is the comment content w/o the surrounding tokens,
- // but the return value will replace the entire comment.
- if ($m === 'keep') {
- return '/**/';
- }
- if ($m === '" "') {
- // component of http://tantek.com/CSS/Examples/midpass.html
- return '/*" "*/';
- }
- if (preg_match('@";\\}\\s*\\}/\\*\\s+@', $m)) {
- // component of http://tantek.com/CSS/Examples/midpass.html
- return '/*";}}/* */';
- }
- if ($this->_inHack) {
- // inversion: feeding only to one browser
- if (preg_match('@
- ^/ # comment started like /*/
- \\s*
- (\\S[\\s\\S]+?) # has at least some non-ws content
- \\s*
- /\\* # ends like /*/ or /**/
- @x', $m, $n)) {
- // end hack mode after this comment, but preserve the hack and comment content
- $this->_inHack = false;
- return "/*/{$n[1]}/**/";
- }
- }
- if (substr($m, -1) === '\\') { // comment ends like \*/
- // begin hack mode and preserve hack
- $this->_inHack = true;
- return '/*\\*/';
- }
- if ($m !== '' && $m[0] === '/') { // comment looks like /*/ foo */
- // begin hack mode and preserve hack
- $this->_inHack = true;
- return '/*/*/';
- }
- if ($this->_inHack) {
- // a regular comment ends hack mode but should be preserved
- $this->_inHack = false;
- return '/**/';
- }
- // Issue 107: if there's any surrounding whitespace, it may be important, so
- // replace the comment with a single space
- return $hasSurroundingWs // remove all other comments
- ? ' '
- : '';
- }
-
- /**
- * Process a font-family listing and return a replacement
- *
- * @param array $m regex matches
- *
- * @return string
- */
- protected function _fontFamilyCB($m)
- {
- $m[1] = preg_replace('/
- \\s*
- (
- "[^"]+" # 1 = family in double qutoes
- |\'[^\']+\' # or 1 = family in single quotes
- |[\\w\\-]+ # or 1 = unquoted family
- )
- \\s*
- /x', '$1', $m[1]);
- return 'font-family:' . $m[1] . $m[2];
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/CSS/UriRewriter.php b/plugins/Minify/extlib/minify/min/lib/Minify/CSS/UriRewriter.php
deleted file mode 100644
index 824c6bb2a1..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/CSS/UriRewriter.php
+++ /dev/null
@@ -1,270 +0,0 @@
-
- */
-class Minify_CSS_UriRewriter {
-
- /**
- * Defines which class to call as part of callbacks, change this
- * if you extend Minify_CSS_UriRewriter
- * @var string
- */
- protected static $className = 'Minify_CSS_UriRewriter';
-
- /**
- * rewrite() and rewriteRelative() append debugging information here
- * @var string
- */
- public static $debugText = '';
-
- /**
- * Rewrite file relative URIs as root relative in CSS files
- *
- * @param string $css
- *
- * @param string $currentDir The directory of the current CSS file.
- *
- * @param string $docRoot The document root of the web site in which
- * the CSS file resides (default = $_SERVER['DOCUMENT_ROOT']).
- *
- * @param array $symlinks (default = array()) If the CSS file is stored in
- * a symlink-ed directory, provide an array of link paths to
- * target paths, where the link paths are within the document root. Because
- * paths need to be normalized for this to work, use "//" to substitute
- * the doc root in the link paths (the array keys). E.g.:
- *
- * array('//symlink' => '/real/target/path') // unix
- * array('//static' => 'D:\\staticStorage') // Windows
- *
- *
- * @return string
- */
- public static function rewrite($css, $currentDir, $docRoot = null, $symlinks = array())
- {
- self::$_docRoot = self::_realpath(
- $docRoot ? $docRoot : $_SERVER['DOCUMENT_ROOT']
- );
- self::$_currentDir = self::_realpath($currentDir);
- self::$_symlinks = array();
-
- // normalize symlinks
- foreach ($symlinks as $link => $target) {
- $link = ($link === '//')
- ? self::$_docRoot
- : str_replace('//', self::$_docRoot . '/', $link);
- $link = strtr($link, '/', DIRECTORY_SEPARATOR);
- self::$_symlinks[$link] = self::_realpath($target);
- }
-
- self::$debugText .= "docRoot : " . self::$_docRoot . "\n"
- . "currentDir : " . self::$_currentDir . "\n";
- if (self::$_symlinks) {
- self::$debugText .= "symlinks : " . var_export(self::$_symlinks, 1) . "\n";
- }
- self::$debugText .= "\n";
-
- $css = self::_trimUrls($css);
-
- // rewrite
- $css = preg_replace_callback('/@import\\s+([\'"])(.*?)[\'"]/'
- ,array(self::$className, '_processUriCB'), $css);
- $css = preg_replace_callback('/url\\(\\s*([^\\)\\s]+)\\s*\\)/'
- ,array(self::$className, '_processUriCB'), $css);
-
- return $css;
- }
-
- /**
- * Prepend a path to relative URIs in CSS files
- *
- * @param string $css
- *
- * @param string $path The path to prepend.
- *
- * @return string
- */
- public static function prepend($css, $path)
- {
- self::$_prependPath = $path;
-
- $css = self::_trimUrls($css);
-
- // append
- $css = preg_replace_callback('/@import\\s+([\'"])(.*?)[\'"]/'
- ,array(self::$className, '_processUriCB'), $css);
- $css = preg_replace_callback('/url\\(\\s*([^\\)\\s]+)\\s*\\)/'
- ,array(self::$className, '_processUriCB'), $css);
-
- self::$_prependPath = null;
- return $css;
- }
-
-
- /**
- * @var string directory of this stylesheet
- */
- private static $_currentDir = '';
-
- /**
- * @var string DOC_ROOT
- */
- private static $_docRoot = '';
-
- /**
- * @var array directory replacements to map symlink targets back to their
- * source (within the document root) E.g. '/var/www/symlink' => '/var/realpath'
- */
- private static $_symlinks = array();
-
- /**
- * @var string path to prepend
- */
- private static $_prependPath = null;
-
- private static function _trimUrls($css)
- {
- return preg_replace('/
- url\\( # url(
- \\s*
- ([^\\)]+?) # 1 = URI (assuming does not contain ")")
- \\s*
- \\) # )
- /x', 'url($1)', $css);
- }
-
- private static function _processUriCB($m)
- {
- // $m matched either '/@import\\s+([\'"])(.*?)[\'"]/' or '/url\\(\\s*([^\\)\\s]+)\\s*\\)/'
- $isImport = ($m[0][0] === '@');
- // determine URI and the quote character (if any)
- if ($isImport) {
- $quoteChar = $m[1];
- $uri = $m[2];
- } else {
- // $m[1] is either quoted or not
- $quoteChar = ($m[1][0] === "'" || $m[1][0] === '"')
- ? $m[1][0]
- : '';
- $uri = ($quoteChar === '')
- ? $m[1]
- : substr($m[1], 1, strlen($m[1]) - 2);
- }
- // analyze URI
- if ('/' !== $uri[0] // root-relative
- && false === strpos($uri, '//') // protocol (non-data)
- && 0 !== strpos($uri, 'data:') // data protocol
- ) {
- // URI is file-relative: rewrite depending on options
- $uri = (self::$_prependPath !== null)
- ? (self::$_prependPath . $uri)
- : self::rewriteRelative($uri, self::$_currentDir, self::$_docRoot, self::$_symlinks);
- }
- return $isImport
- ? "@import {$quoteChar}{$uri}{$quoteChar}"
- : "url({$quoteChar}{$uri}{$quoteChar})";
- }
-
- /**
- * Rewrite a file relative URI as root relative
- *
- *
- * Minify_CSS_UriRewriter::rewriteRelative(
- * '../img/hello.gif'
- * , '/home/user/www/css' // path of CSS file
- * , '/home/user/www' // doc root
- * );
- * // returns '/img/hello.gif'
- *
- * // example where static files are stored in a symlinked directory
- * Minify_CSS_UriRewriter::rewriteRelative(
- * 'hello.gif'
- * , '/var/staticFiles/theme'
- * , '/home/user/www'
- * , array('/home/user/www/static' => '/var/staticFiles')
- * );
- * // returns '/static/theme/hello.gif'
- *
- *
- * @param string $uri file relative URI
- *
- * @param string $realCurrentDir realpath of the current file's directory.
- *
- * @param string $realDocRoot realpath of the site document root.
- *
- * @param array $symlinks (default = array()) If the file is stored in
- * a symlink-ed directory, provide an array of link paths to
- * real target paths, where the link paths "appear" to be within the document
- * root. E.g.:
- *
- * array('/home/foo/www/not/real/path' => '/real/target/path') // unix
- * array('C:\\htdocs\\not\\real' => 'D:\\real\\target\\path') // Windows
- *
- *
- * @return string
- */
- public static function rewriteRelative($uri, $realCurrentDir, $realDocRoot, $symlinks = array())
- {
- // prepend path with current dir separator (OS-independent)
- $path = strtr($realCurrentDir, '/', DIRECTORY_SEPARATOR)
- . DIRECTORY_SEPARATOR . strtr($uri, '/', DIRECTORY_SEPARATOR);
-
- self::$debugText .= "file-relative URI : {$uri}\n"
- . "path prepended : {$path}\n";
-
- // "unresolve" a symlink back to doc root
- foreach ($symlinks as $link => $target) {
- if (0 === strpos($path, $target)) {
- // replace $target with $link
- $path = $link . substr($path, strlen($target));
-
- self::$debugText .= "symlink unresolved : {$path}\n";
-
- break;
- }
- }
- // strip doc root
- $path = substr($path, strlen($realDocRoot));
-
- self::$debugText .= "docroot stripped : {$path}\n";
-
- // fix to root-relative URI
-
- $uri = strtr($path, '/\\', '//');
-
- // remove /./ and /../ where possible
- $uri = str_replace('/./', '/', $uri);
- // inspired by patch from Oleg Cherniy
- do {
- $uri = preg_replace('@/[^/]+/\\.\\./@', '/', $uri, 1, $changed);
- } while ($changed);
-
- self::$debugText .= "traversals removed : {$uri}\n\n";
-
- return $uri;
- }
-
- /**
- * Get realpath with any trailing slash removed. If realpath() fails,
- * just remove the trailing slash.
- *
- * @param string $path
- *
- * @return mixed path with no trailing slash
- */
- protected static function _realpath($path)
- {
- $realPath = realpath($path);
- if ($realPath !== false) {
- $path = $realPath;
- }
- return rtrim($path, '/\\');
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/APC.php b/plugins/Minify/extlib/minify/min/lib/Minify/Cache/APC.php
deleted file mode 100644
index ca84d29987..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/APC.php
+++ /dev/null
@@ -1,130 +0,0 @@
-
- * Minify::setCache(new Minify_Cache_APC());
- *
- *
- * @package Minify
- * @author Chris Edwards
- **/
-class Minify_Cache_APC {
-
- /**
- * Create a Minify_Cache_APC object, to be passed to
- * Minify::setCache().
- *
- *
- * @param int $expire seconds until expiration (default = 0
- * meaning the item will not get an expiration date)
- *
- * @return null
- */
- public function __construct($expire = 0)
- {
- $this->_exp = $expire;
- }
-
- /**
- * Write data to cache.
- *
- * @param string $id cache id
- *
- * @param string $data
- *
- * @return bool success
- */
- public function store($id, $data)
- {
- return apc_store($id, "{$_SERVER['REQUEST_TIME']}|{$data}", $this->_exp);
- }
-
- /**
- * Get the size of a cache entry
- *
- * @param string $id cache id
- *
- * @return int size in bytes
- */
- public function getSize($id)
- {
- return $this->_fetch($id)
- ? strlen($this->_data)
- : false;
- }
-
- /**
- * Does a valid cache entry exist?
- *
- * @param string $id cache id
- *
- * @param int $srcMtime mtime of the original source file(s)
- *
- * @return bool exists
- */
- public function isValid($id, $srcMtime)
- {
- return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
- }
-
- /**
- * Send the cached content to output
- *
- * @param string $id cache id
- */
- public function display($id)
- {
- echo $this->_fetch($id)
- ? $this->_data
- : '';
- }
-
- /**
- * Fetch the cached content
- *
- * @param string $id cache id
- *
- * @return string
- */
- public function fetch($id)
- {
- return $this->_fetch($id)
- ? $this->_data
- : '';
- }
-
- private $_exp = null;
-
- // cache of most recently fetched id
- private $_lm = null;
- private $_data = null;
- private $_id = null;
-
- /**
- * Fetch data and timestamp from apc, store in instance
- *
- * @param string $id
- *
- * @return bool success
- */
- private function _fetch($id)
- {
- if ($this->_id === $id) {
- return true;
- }
- $ret = apc_fetch($id);
- if (false === $ret) {
- $this->_id = null;
- return false;
- }
- list($this->_lm, $this->_data) = explode('|', $ret, 2);
- $this->_id = $id;
- return true;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/File.php b/plugins/Minify/extlib/minify/min/lib/Minify/Cache/File.php
deleted file mode 100644
index 8744a7e04f..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/File.php
+++ /dev/null
@@ -1,125 +0,0 @@
-_locking = $fileLocking;
- $this->_path = $path;
- }
-
- /**
- * Write data to cache.
- *
- * @param string $id cache id (e.g. a filename)
- *
- * @param string $data
- *
- * @return bool success
- */
- public function store($id, $data)
- {
- $flag = $this->_locking
- ? LOCK_EX
- : null;
- if (is_file($this->_path . '/' . $id)) {
- @unlink($this->_path . '/' . $id);
- }
- if (! @file_put_contents($this->_path . '/' . $id, $data, $flag)) {
- return false;
- }
- // write control
- if ($data !== $this->fetch($id)) {
- @unlink($file);
- return false;
- }
- return true;
- }
-
- /**
- * Get the size of a cache entry
- *
- * @param string $id cache id (e.g. a filename)
- *
- * @return int size in bytes
- */
- public function getSize($id)
- {
- return filesize($this->_path . '/' . $id);
- }
-
- /**
- * Does a valid cache entry exist?
- *
- * @param string $id cache id (e.g. a filename)
- *
- * @param int $srcMtime mtime of the original source file(s)
- *
- * @return bool exists
- */
- public function isValid($id, $srcMtime)
- {
- $file = $this->_path . '/' . $id;
- return (is_file($file) && (filemtime($file) >= $srcMtime));
- }
-
- /**
- * Send the cached content to output
- *
- * @param string $id cache id (e.g. a filename)
- */
- public function display($id)
- {
- if ($this->_locking) {
- $fp = fopen($this->_path . '/' . $id, 'rb');
- flock($fp, LOCK_SH);
- fpassthru($fp);
- flock($fp, LOCK_UN);
- fclose($fp);
- } else {
- readfile($this->_path . '/' . $id);
- }
- }
-
- /**
- * Fetch the cached content
- *
- * @param string $id cache id (e.g. a filename)
- *
- * @return string
- */
- public function fetch($id)
- {
- if ($this->_locking) {
- $fp = fopen($this->_path . '/' . $id, 'rb');
- flock($fp, LOCK_SH);
- $ret = stream_get_contents($fp);
- flock($fp, LOCK_UN);
- fclose($fp);
- return $ret;
- } else {
- return file_get_contents($this->_path . '/' . $id);
- }
- }
-
- /**
- * Fetch the cache path used
- *
- * @return string
- */
- public function getPath()
- {
- return $this->_path;
- }
-
- private $_path = null;
- private $_locking = null;
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/Memcache.php b/plugins/Minify/extlib/minify/min/lib/Minify/Cache/Memcache.php
deleted file mode 100644
index 2b81e7a329..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Cache/Memcache.php
+++ /dev/null
@@ -1,137 +0,0 @@
-
- * // fall back to disk caching if memcache can't connect
- * $memcache = new Memcache;
- * if ($memcache->connect('localhost', 11211)) {
- * Minify::setCache(new Minify_Cache_Memcache($memcache));
- * } else {
- * Minify::setCache();
- * }
- *
- **/
-class Minify_Cache_Memcache {
-
- /**
- * Create a Minify_Cache_Memcache object, to be passed to
- * Minify::setCache().
- *
- * @param Memcache $memcache already-connected instance
- *
- * @param int $expire seconds until expiration (default = 0
- * meaning the item will not get an expiration date)
- *
- * @return null
- */
- public function __construct($memcache, $expire = 0)
- {
- $this->_mc = $memcache;
- $this->_exp = $expire;
- }
-
- /**
- * Write data to cache.
- *
- * @param string $id cache id
- *
- * @param string $data
- *
- * @return bool success
- */
- public function store($id, $data)
- {
- return $this->_mc->set($id, "{$_SERVER['REQUEST_TIME']}|{$data}", 0, $this->_exp);
- }
-
-
- /**
- * Get the size of a cache entry
- *
- * @param string $id cache id
- *
- * @return int size in bytes
- */
- public function getSize($id)
- {
- return $this->_fetch($id)
- ? strlen($this->_data)
- : false;
- }
-
- /**
- * Does a valid cache entry exist?
- *
- * @param string $id cache id
- *
- * @param int $srcMtime mtime of the original source file(s)
- *
- * @return bool exists
- */
- public function isValid($id, $srcMtime)
- {
- return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
- }
-
- /**
- * Send the cached content to output
- *
- * @param string $id cache id
- */
- public function display($id)
- {
- echo $this->_fetch($id)
- ? $this->_data
- : '';
- }
-
- /**
- * Fetch the cached content
- *
- * @param string $id cache id
- *
- * @return string
- */
- public function fetch($id)
- {
- return $this->_fetch($id)
- ? $this->_data
- : '';
- }
-
- private $_mc = null;
- private $_exp = null;
-
- // cache of most recently fetched id
- private $_lm = null;
- private $_data = null;
- private $_id = null;
-
- /**
- * Fetch data and timestamp from memcache, store in instance
- *
- * @param string $id
- *
- * @return bool success
- */
- private function _fetch($id)
- {
- if ($this->_id === $id) {
- return true;
- }
- $ret = $this->_mc->get($id);
- if (false === $ret) {
- $this->_id = null;
- return false;
- }
- list($this->_lm, $this->_data) = explode('|', $ret, 2);
- $this->_id = $id;
- return true;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/CommentPreserver.php b/plugins/Minify/extlib/minify/min/lib/Minify/CommentPreserver.php
deleted file mode 100644
index f56eb3461c..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/CommentPreserver.php
+++ /dev/null
@@ -1,90 +0,0 @@
-
- */
-class Minify_CommentPreserver {
-
- /**
- * String to be prepended to each preserved comment
- *
- * @var string
- */
- public static $prepend = "\n";
-
- /**
- * String to be appended to each preserved comment
- *
- * @var string
- */
- public static $append = "\n";
-
- /**
- * Process a string outside of C-style comments that begin with "/*!"
- *
- * On each non-empty string outside these comments, the given processor
- * function will be called. The first "!" will be removed from the
- * preserved comments, and the comments will be surrounded by
- * Minify_CommentPreserver::$preprend and Minify_CommentPreserver::$append.
- *
- * @param string $content
- * @param callback $processor function
- * @param array $args array of extra arguments to pass to the processor
- * function (default = array())
- * @return string
- */
- public static function process($content, $processor, $args = array())
- {
- $ret = '';
- while (true) {
- list($beforeComment, $comment, $afterComment) = self::_nextComment($content);
- if ('' !== $beforeComment) {
- $callArgs = $args;
- array_unshift($callArgs, $beforeComment);
- $ret .= call_user_func_array($processor, $callArgs);
- }
- if (false === $comment) {
- break;
- }
- $ret .= $comment;
- $content = $afterComment;
- }
- return $ret;
- }
-
- /**
- * Extract comments that YUI Compressor preserves.
- *
- * @param string $in input
- *
- * @return array 3 elements are returned. If a YUI comment is found, the
- * 2nd element is the comment and the 1st and 2nd are the surrounding
- * strings. If no comment is found, the entire string is returned as the
- * 1st element and the other two are false.
- */
- private static function _nextComment($in)
- {
- if (
- false === ($start = strpos($in, '/*!'))
- || false === ($end = strpos($in, '*/', $start + 3))
- ) {
- return array($in, false, false);
- }
- $ret = array(
- substr($in, 0, $start)
- ,self::$prepend . '/*' . substr($in, $start + 3, $end - $start - 1) . self::$append
- );
- $endChars = (strlen($in) - $end - 2);
- $ret[] = (0 === $endChars)
- ? ''
- : substr($in, -$endChars);
- return $ret;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Base.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Base.php
deleted file mode 100644
index 84889b3f0c..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Base.php
+++ /dev/null
@@ -1,202 +0,0 @@
-
- */
-abstract class Minify_Controller_Base {
-
- /**
- * Setup controller sources and set an needed options for Minify::source
- *
- * You must override this method in your subclass controller to set
- * $this->sources. If the request is NOT valid, make sure $this->sources
- * is left an empty array. Then strip any controller-specific options from
- * $options and return it. To serve files, $this->sources must be an array of
- * Minify_Source objects.
- *
- * @param array $options controller and Minify options
- *
- * return array $options Minify::serve options
- */
- abstract public function setupSources($options);
-
- /**
- * Get default Minify options for this controller.
- *
- * Override in subclass to change defaults
- *
- * @return array options for Minify
- */
- public function getDefaultMinifyOptions() {
- return array(
- 'isPublic' => true
- ,'encodeOutput' => function_exists('gzdeflate')
- ,'encodeMethod' => null // determine later
- ,'encodeLevel' => 9
- ,'minifierOptions' => array() // no minifier options
- ,'contentTypeCharset' => 'utf-8'
- ,'maxAge' => 1800 // 30 minutes
- ,'rewriteCssUris' => true
- ,'bubbleCssImports' => false
- ,'quiet' => false // serve() will send headers and output
- ,'debug' => false
-
- // if you override this, the response code MUST be directly after
- // the first space.
- ,'badRequestHeader' => 'HTTP/1.0 400 Bad Request'
-
- // callback function to see/modify content of all sources
- ,'postprocessor' => null
- // file to require to load preprocessor
- ,'postprocessorRequire' => null
- );
- }
-
- /**
- * Get default minifiers for this controller.
- *
- * Override in subclass to change defaults
- *
- * @return array minifier callbacks for common types
- */
- public function getDefaultMinifers() {
- $ret[Minify::TYPE_JS] = array('JSMin', 'minify');
- $ret[Minify::TYPE_CSS] = array('Minify_CSS', 'minify');
- $ret[Minify::TYPE_HTML] = array('Minify_HTML', 'minify');
- return $ret;
- }
-
- /**
- * Load any code necessary to execute the given minifier callback.
- *
- * The controller is responsible for loading minification code on demand
- * via this method. This built-in function will only load classes for
- * static method callbacks where the class isn't already defined. It uses
- * the PEAR convention, so, given array('Jimmy_Minifier', 'minCss'), this
- * function will include 'Jimmy/Minifier.php'.
- *
- * If you need code loaded on demand and this doesn't suit you, you'll need
- * to override this function in your subclass.
- * @see Minify_Controller_Page::loadMinifier()
- *
- * @param callback $minifierCallback callback of minifier function
- *
- * @return null
- */
- public function loadMinifier($minifierCallback)
- {
- if (is_array($minifierCallback)
- && is_string($minifierCallback[0])
- && !class_exists($minifierCallback[0], false)) {
-
- require str_replace('_', '/', $minifierCallback[0]) . '.php';
- }
- }
-
- /**
- * Is a user-given file within an allowable directory, existing,
- * and having an extension js/css/html/txt ?
- *
- * This is a convenience function for controllers that have to accept
- * user-given paths
- *
- * @param string $file full file path (already processed by realpath())
- *
- * @param array $safeDirs directories where files are safe to serve. Files can also
- * be in subdirectories of these directories.
- *
- * @return bool file is safe
- */
- public static function _fileIsSafe($file, $safeDirs)
- {
- $pathOk = false;
- foreach ((array)$safeDirs as $safeDir) {
- if (strpos($file, $safeDir) === 0) {
- $pathOk = true;
- break;
- }
- }
- $base = basename($file);
- if (! $pathOk || ! is_file($file) || $base[0] === '.') {
- return false;
- }
- list($revExt) = explode('.', strrev($base));
- return in_array(strrev($revExt), array('js', 'css', 'html', 'txt'));
- }
-
- /**
- * @var array instances of Minify_Source, which provide content and
- * any individual minification needs.
- *
- * @see Minify_Source
- */
- public $sources = array();
-
- /**
- * Mix in default controller options with user-given options
- *
- * @param array $options user options
- *
- * @return array mixed options
- */
- public final function mixInDefaultOptions($options)
- {
- $ret = array_merge(
- $this->getDefaultMinifyOptions(), $options
- );
- if (! isset($options['minifiers'])) {
- $options['minifiers'] = array();
- }
- $ret['minifiers'] = array_merge(
- $this->getDefaultMinifers(), $options['minifiers']
- );
- return $ret;
- }
-
- /**
- * Analyze sources (if there are any) and set $options 'contentType'
- * and 'lastModifiedTime' if they already aren't.
- *
- * @param array $options options for Minify
- *
- * @return array options for Minify
- */
- public final function analyzeSources($options = array())
- {
- if ($this->sources) {
- if (! isset($options['contentType'])) {
- $options['contentType'] = Minify_Source::getContentType($this->sources);
- }
- // last modified is needed for caching, even if setExpires is set
- if (! isset($options['lastModifiedTime'])) {
- $max = 0;
- foreach ($this->sources as $source) {
- $max = max($source->lastModified, $max);
- }
- $options['lastModifiedTime'] = $max;
- }
- }
- return $options;
- }
-
- /**
- * Send message to the Minify logger
- * @param string $msg
- * @return null
- */
- protected function log($msg) {
- require_once 'Minify/Logger.php';
- Minify_Logger::log($msg);
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Files.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Files.php
deleted file mode 100644
index 83f028adf7..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Files.php
+++ /dev/null
@@ -1,78 +0,0 @@
-
- * Minify::serve('Files', array(
- * 'files' => array(
- * '//js/jquery.js'
- * ,'//js/plugins.js'
- * ,'/home/username/file.js'
- * )
- * ));
- *
- *
- * As a shortcut, the controller will replace "//" at the beginning
- * of a filename with $_SERVER['DOCUMENT_ROOT'] . '/'.
- *
- * @package Minify
- * @author Stephen Clay
- */
-class Minify_Controller_Files extends Minify_Controller_Base {
-
- /**
- * Set up file sources
- *
- * @param array $options controller and Minify options
- * @return array Minify options
- *
- * Controller options:
- *
- * 'files': (required) array of complete file paths, or a single path
- */
- public function setupSources($options) {
- // strip controller options
-
- $files = $options['files'];
- // if $files is a single object, casting will break it
- if (is_object($files)) {
- $files = array($files);
- } elseif (! is_array($files)) {
- $files = (array)$files;
- }
- unset($options['files']);
-
- $sources = array();
- foreach ($files as $file) {
- if ($file instanceof Minify_Source) {
- $sources[] = $file;
- continue;
- }
- if (0 === strpos($file, '//')) {
- $file = $_SERVER['DOCUMENT_ROOT'] . substr($file, 1);
- }
- $realPath = realpath($file);
- if (is_file($realPath)) {
- $sources[] = new Minify_Source(array(
- 'filepath' => $realPath
- ));
- } else {
- $this->log("The path \"{$file}\" could not be found (or was not a file)");
- return $options;
- }
- }
- if ($sources) {
- $this->sources = $sources;
- }
- return $options;
- }
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Groups.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Groups.php
deleted file mode 100644
index 1ac57703ad..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Groups.php
+++ /dev/null
@@ -1,94 +0,0 @@
-
- * Minify::serve('Groups', array(
- * 'groups' => array(
- * 'css' => array('//css/type.css', '//css/layout.css')
- * ,'js' => array('//js/jquery.js', '//js/site.js')
- * )
- * ));
- *
- *
- * If the above code were placed in /serve.php, it would enable the URLs
- * /serve.php/js and /serve.php/css
- *
- * As a shortcut, the controller will replace "//" at the beginning
- * of a filename with $_SERVER['DOCUMENT_ROOT'] . '/'.
- *
- * @package Minify
- * @author Stephen Clay
- */
-class Minify_Controller_Groups extends Minify_Controller_Base {
-
- /**
- * Set up groups of files as sources
- *
- * @param array $options controller and Minify options
- * @return array Minify options
- *
- * Controller options:
- *
- * 'groups': (required) array mapping PATH_INFO strings to arrays
- * of complete file paths. @see Minify_Controller_Groups
- */
- public function setupSources($options) {
- // strip controller options
- $groups = $options['groups'];
- unset($options['groups']);
-
- // mod_fcgid places PATH_INFO in ORIG_PATH_INFO
- $pi = isset($_SERVER['ORIG_PATH_INFO'])
- ? substr($_SERVER['ORIG_PATH_INFO'], 1)
- : (isset($_SERVER['PATH_INFO'])
- ? substr($_SERVER['PATH_INFO'], 1)
- : false
- );
- if (false === $pi || ! isset($groups[$pi])) {
- // no PATH_INFO or not a valid group
- $this->log("Missing PATH_INFO or no group set for \"$pi\"");
- return $options;
- }
- $sources = array();
-
- $files = $groups[$pi];
- // if $files is a single object, casting will break it
- if (is_object($files)) {
- $files = array($files);
- } elseif (! is_array($files)) {
- $files = (array)$files;
- }
- foreach ($files as $file) {
- if ($file instanceof Minify_Source) {
- $sources[] = $file;
- continue;
- }
- if (0 === strpos($file, '//')) {
- $file = $_SERVER['DOCUMENT_ROOT'] . substr($file, 1);
- }
- $realPath = realpath($file);
- if (is_file($realPath)) {
- $sources[] = new Minify_Source(array(
- 'filepath' => $realPath
- ));
- } else {
- $this->log("The path \"{$file}\" could not be found (or was not a file)");
- return $options;
- }
- }
- if ($sources) {
- $this->sources = $sources;
- }
- return $options;
- }
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/MinApp.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/MinApp.php
deleted file mode 100644
index 9582d292ca..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/MinApp.php
+++ /dev/null
@@ -1,132 +0,0 @@
-
- */
-class Minify_Controller_MinApp extends Minify_Controller_Base {
-
- /**
- * Set up groups of files as sources
- *
- * @param array $options controller and Minify options
- * @return array Minify options
- *
- */
- public function setupSources($options) {
- // filter controller options
- $cOptions = array_merge(
- array(
- 'allowDirs' => '//'
- ,'groupsOnly' => false
- ,'groups' => array()
- ,'maxFiles' => 10
- )
- ,(isset($options['minApp']) ? $options['minApp'] : array())
- );
- unset($options['minApp']);
- $sources = array();
- if (isset($_GET['g'])) {
- // try groups
- if (! isset($cOptions['groups'][$_GET['g']])) {
- $this->log("A group configuration for \"{$_GET['g']}\" was not set");
- return $options;
- }
-
- $files = $cOptions['groups'][$_GET['g']];
- // if $files is a single object, casting will break it
- if (is_object($files)) {
- $files = array($files);
- } elseif (! is_array($files)) {
- $files = (array)$files;
- }
- foreach ($files as $file) {
- if ($file instanceof Minify_Source) {
- $sources[] = $file;
- continue;
- }
- if (0 === strpos($file, '//')) {
- $file = $_SERVER['DOCUMENT_ROOT'] . substr($file, 1);
- }
- $file = realpath($file);
- if (is_file($file)) {
- $sources[] = new Minify_Source(array(
- 'filepath' => $file
- ));
- } else {
- $this->log("The path \"{$file}\" could not be found (or was not a file)");
- return $options;
- }
- }
- } elseif (! $cOptions['groupsOnly'] && isset($_GET['f'])) {
- // try user files
- // The following restrictions are to limit the URLs that minify will
- // respond to. Ideally there should be only one way to reference a file.
- if (// verify at least one file, files are single comma separated,
- // and are all same extension
- ! preg_match('/^[^,]+\\.(css|js)(?:,[^,]+\\.\\1)*$/', $_GET['f'])
- // no "//"
- || strpos($_GET['f'], '//') !== false
- // no "\"
- || strpos($_GET['f'], '\\') !== false
- // no "./"
- || preg_match('/(?:^|[^\\.])\\.\\//', $_GET['f'])
- ) {
- $this->log("GET param 'f' invalid (see MinApp.php line 63)");
- return $options;
- }
- $files = explode(',', $_GET['f']);
- if (count($files) > $cOptions['maxFiles'] || $files != array_unique($files)) {
- $this->log("Too many or duplicate files specified");
- return $options;
- }
- if (isset($_GET['b'])) {
- // check for validity
- if (preg_match('@^[^/]+(?:/[^/]+)*$@', $_GET['b'])
- && false === strpos($_GET['b'], '..')
- && $_GET['b'] !== '.') {
- // valid base
- $base = "/{$_GET['b']}/";
- } else {
- $this->log("GET param 'b' invalid (see MinApp.php line 84)");
- return $options;
- }
- } else {
- $base = '/';
- }
- $allowDirs = array();
- foreach ((array)$cOptions['allowDirs'] as $allowDir) {
- $allowDirs[] = realpath(str_replace('//', $_SERVER['DOCUMENT_ROOT'] . '/', $allowDir));
- }
- foreach ($files as $file) {
- $path = $_SERVER['DOCUMENT_ROOT'] . $base . $file;
- $file = realpath($path);
- if (false === $file) {
- $this->log("Path \"{$path}\" failed realpath()");
- return $options;
- } elseif (! parent::_fileIsSafe($file, $allowDirs)) {
- $this->log("Path \"{$path}\" failed Minify_Controller_Base::_fileIsSafe()");
- return $options;
- } else {
- $sources[] = new Minify_Source(array(
- 'filepath' => $file
- ));
- }
- }
- }
- if ($sources) {
- $this->sources = $sources;
- } else {
- $this->log("No sources to serve");
- }
- return $options;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Page.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Page.php
deleted file mode 100644
index fa4599abd9..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Page.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- */
-class Minify_Controller_Page extends Minify_Controller_Base {
-
- /**
- * Set up source of HTML content
- *
- * @param array $options controller and Minify options
- * @return array Minify options
- *
- * Controller options:
- *
- * 'content': (required) HTML markup
- *
- * 'id': (required) id of page (string for use in server-side caching)
- *
- * 'lastModifiedTime': timestamp of when this content changed. This
- * is recommended to allow both server and client-side caching.
- *
- * 'minifyAll': should all CSS and Javascript blocks be individually
- * minified? (default false)
- *
- * @todo Add 'file' option to read HTML file.
- */
- public function setupSources($options) {
- if (isset($options['file'])) {
- $sourceSpec = array(
- 'filepath' => $options['file']
- );
- } else {
- // strip controller options
- $sourceSpec = array(
- 'content' => $options['content']
- ,'id' => $options['id']
- );
- unset($options['content'], $options['id']);
- }
- if (isset($options['minifyAll'])) {
- // this will be the 2nd argument passed to Minify_HTML::minify()
- $sourceSpec['minifyOptions'] = array(
- 'cssMinifier' => array('Minify_CSS', 'minify')
- ,'jsMinifier' => array('JSMin', 'minify')
- );
- $this->_loadCssJsMinifiers = true;
- unset($options['minifyAll']);
- }
- $this->sources[] = new Minify_Source($sourceSpec);
-
- $options['contentType'] = Minify::TYPE_HTML;
- return $options;
- }
-
- protected $_loadCssJsMinifiers = false;
-
- /**
- * @see Minify_Controller_Base::loadMinifier()
- */
- public function loadMinifier($minifierCallback)
- {
- if ($this->_loadCssJsMinifiers) {
- // Minify will not call for these so we must manually load
- // them when Minify/HTML.php is called for.
- require_once 'Minify/CSS.php';
- require_once 'JSMin.php';
- }
- parent::loadMinifier($minifierCallback); // load Minify/HTML.php
- }
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Version1.php b/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Version1.php
deleted file mode 100644
index 1861aabc11..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Controller/Version1.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
- * Minify::serve('Version1');
- *
- *
- * @package Minify
- * @author Stephen Clay
- */
-class Minify_Controller_Version1 extends Minify_Controller_Base {
-
- /**
- * Set up groups of files as sources
- *
- * @param array $options controller and Minify options
- * @return array Minify options
- *
- */
- public function setupSources($options) {
- self::_setupDefines();
- if (MINIFY_USE_CACHE) {
- $cacheDir = defined('MINIFY_CACHE_DIR')
- ? MINIFY_CACHE_DIR
- : '';
- Minify::setCache($cacheDir);
- }
- $options['badRequestHeader'] = 'HTTP/1.0 404 Not Found';
- $options['contentTypeCharset'] = MINIFY_ENCODING;
-
- // The following restrictions are to limit the URLs that minify will
- // respond to. Ideally there should be only one way to reference a file.
- if (! isset($_GET['files'])
- // verify at least one file, files are single comma separated,
- // and are all same extension
- || ! preg_match('/^[^,]+\\.(css|js)(,[^,]+\\.\\1)*$/', $_GET['files'], $m)
- // no "//" (makes URL rewriting easier)
- || strpos($_GET['files'], '//') !== false
- // no "\"
- || strpos($_GET['files'], '\\') !== false
- // no "./"
- || preg_match('/(?:^|[^\\.])\\.\\//', $_GET['files'])
- ) {
- return $options;
- }
- $extension = $m[1];
-
- $files = explode(',', $_GET['files']);
- if (count($files) > MINIFY_MAX_FILES) {
- return $options;
- }
-
- // strings for prepending to relative/absolute paths
- $prependRelPaths = dirname($_SERVER['SCRIPT_FILENAME'])
- . DIRECTORY_SEPARATOR;
- $prependAbsPaths = $_SERVER['DOCUMENT_ROOT'];
-
- $sources = array();
- $goodFiles = array();
- $hasBadSource = false;
-
- $allowDirs = isset($options['allowDirs'])
- ? $options['allowDirs']
- : MINIFY_BASE_DIR;
-
- foreach ($files as $file) {
- // prepend appropriate string for abs/rel paths
- $file = ($file[0] === '/' ? $prependAbsPaths : $prependRelPaths) . $file;
- // make sure a real file!
- $file = realpath($file);
- // don't allow unsafe or duplicate files
- if (parent::_fileIsSafe($file, $allowDirs)
- && !in_array($file, $goodFiles))
- {
- $goodFiles[] = $file;
- $srcOptions = array(
- 'filepath' => $file
- );
- $this->sources[] = new Minify_Source($srcOptions);
- } else {
- $hasBadSource = true;
- break;
- }
- }
- if ($hasBadSource) {
- $this->sources = array();
- }
- if (! MINIFY_REWRITE_CSS_URLS) {
- $options['rewriteCssUris'] = false;
- }
- return $options;
- }
-
- private static function _setupDefines()
- {
- $defaults = array(
- 'MINIFY_BASE_DIR' => realpath($_SERVER['DOCUMENT_ROOT'])
- ,'MINIFY_ENCODING' => 'utf-8'
- ,'MINIFY_MAX_FILES' => 16
- ,'MINIFY_REWRITE_CSS_URLS' => true
- ,'MINIFY_USE_CACHE' => true
- );
- foreach ($defaults as $const => $val) {
- if (! defined($const)) {
- define($const, $val);
- }
- }
- }
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/HTML.php b/plugins/Minify/extlib/minify/min/lib/Minify/HTML.php
deleted file mode 100644
index fb5c1e9829..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/HTML.php
+++ /dev/null
@@ -1,245 +0,0 @@
-
- */
-class Minify_HTML {
-
- /**
- * "Minify" an HTML page
- *
- * @param string $html
- *
- * @param array $options
- *
- * 'cssMinifier' : (optional) callback function to process content of STYLE
- * elements.
- *
- * 'jsMinifier' : (optional) callback function to process content of SCRIPT
- * elements. Note: the type attribute is ignored.
- *
- * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
- * unset, minify will sniff for an XHTML doctype.
- *
- * @return string
- */
- public static function minify($html, $options = array()) {
- $min = new Minify_HTML($html, $options);
- return $min->process();
- }
-
-
- /**
- * Create a minifier object
- *
- * @param string $html
- *
- * @param array $options
- *
- * 'cssMinifier' : (optional) callback function to process content of STYLE
- * elements.
- *
- * 'jsMinifier' : (optional) callback function to process content of SCRIPT
- * elements. Note: the type attribute is ignored.
- *
- * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
- * unset, minify will sniff for an XHTML doctype.
- *
- * @return null
- */
- public function __construct($html, $options = array())
- {
- $this->_html = str_replace("\r\n", "\n", trim($html));
- if (isset($options['xhtml'])) {
- $this->_isXhtml = (bool)$options['xhtml'];
- }
- if (isset($options['cssMinifier'])) {
- $this->_cssMinifier = $options['cssMinifier'];
- }
- if (isset($options['jsMinifier'])) {
- $this->_jsMinifier = $options['jsMinifier'];
- }
- }
-
-
- /**
- * Minify the markeup given in the constructor
- *
- * @return string
- */
- public function process()
- {
- if ($this->_isXhtml === null) {
- $this->_isXhtml = (false !== strpos($this->_html, '_html);
-
- // fill placeholders
- $this->_html = str_replace(
- array_keys($this->_placeholders)
- ,array_values($this->_placeholders)
- ,$this->_html
- );
- return $this->_html;
- }
-
- protected function _commentCB($m)
- {
- return (0 === strpos($m[1], '[') || false !== strpos($m[1], '_replacementHash . count($this->_placeholders) . '%';
- $this->_placeholders[$placeholder] = $content;
- return $placeholder;
- }
-
- protected $_isXhtml = null;
- protected $_replacementHash = null;
- protected $_placeholders = array();
- protected $_cssMinifier = null;
- protected $_jsMinifier = null;
-
- protected function _outsideTagCB($m)
- {
- return '>' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<';
- }
-
- protected function _removePreCB($m)
- {
- return $this->_reservePlace($m[1]);
- }
-
- protected function _removeTextareaCB($m)
- {
- return $this->_reservePlace($m[1]);
- }
-
- protected function _removeStyleCB($m)
- {
- $openStyle = $m[1];
- $css = $m[2];
- // remove HTML comments
- $css = preg_replace('/(?:^\\s*\\s*$)/', '', $css);
-
- // remove CDATA section markers
- $css = $this->_removeCdata($css);
-
- // minify
- $minifier = $this->_cssMinifier
- ? $this->_cssMinifier
- : 'trim';
- $css = call_user_func($minifier, $css);
-
- return $this->_reservePlace($this->_needsCdata($css)
- ? "{$openStyle}/**/"
- : "{$openStyle}{$css}"
- );
- }
-
- protected function _removeScriptCB($m)
- {
- $openScript = $m[2];
- $js = $m[3];
-
- // whitespace surrounding? preserve at least one space
- $ws1 = ($m[1] === '') ? '' : ' ';
- $ws2 = ($m[4] === '') ? '' : ' ';
-
- // remove HTML comments (and ending "//" if present)
- $js = preg_replace('/(?:^\\s*\\s*$)/', '', $js);
-
- // remove CDATA section markers
- $js = $this->_removeCdata($js);
-
- // minify
- $minifier = $this->_jsMinifier
- ? $this->_jsMinifier
- : 'trim';
- $js = call_user_func($minifier, $js);
-
- return $this->_reservePlace($this->_needsCdata($js)
- ? "{$ws1}{$openScript}/**/{$ws2}"
- : "{$ws1}{$openScript}{$js}{$ws2}"
- );
- }
-
- protected function _removeCdata($str)
- {
- return (false !== strpos($str, ''), '', $str)
- : $str;
- }
-
- protected function _needsCdata($str)
- {
- return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/ImportProcessor.php b/plugins/Minify/extlib/minify/min/lib/Minify/ImportProcessor.php
deleted file mode 100644
index 0d6d90a816..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/ImportProcessor.php
+++ /dev/null
@@ -1,157 +0,0 @@
-
- */
-class Minify_ImportProcessor {
-
- public static $filesIncluded = array();
-
- public static function process($file)
- {
- self::$filesIncluded = array();
- self::$_isCss = (strtolower(substr($file, -4)) === '.css');
- $obj = new Minify_ImportProcessor(dirname($file));
- return $obj->_getContent($file);
- }
-
- // allows callback funcs to know the current directory
- private $_currentDir = null;
-
- // allows _importCB to write the fetched content back to the obj
- private $_importedContent = '';
-
- private static $_isCss = null;
-
- private function __construct($currentDir)
- {
- $this->_currentDir = $currentDir;
- }
-
- private function _getContent($file)
- {
- $file = realpath($file);
- if (! $file
- || in_array($file, self::$filesIncluded)
- || false === ($content = @file_get_contents($file))
- ) {
- // file missing, already included, or failed read
- return '';
- }
- self::$filesIncluded[] = realpath($file);
- $this->_currentDir = dirname($file);
-
- // remove UTF-8 BOM if present
- if (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3)) {
- $content = substr($content, 3);
- }
- // ensure uniform EOLs
- $content = str_replace("\r\n", "\n", $content);
-
- // process @imports
- $content = preg_replace_callback(
- '/
- @import\\s+
- (?:url\\(\\s*)? # maybe url(
- [\'"]? # maybe quote
- (.*?) # 1 = URI
- [\'"]? # maybe end quote
- (?:\\s*\\))? # maybe )
- ([a-zA-Z,\\s]*)? # 2 = media list
- ; # end token
- /x'
- ,array($this, '_importCB')
- ,$content
- );
-
- if (self::$_isCss) {
- // rewrite remaining relative URIs
- $content = preg_replace_callback(
- '/url\\(\\s*([^\\)\\s]+)\\s*\\)/'
- ,array($this, '_urlCB')
- ,$content
- );
- }
-
- return $this->_importedContent . $content;
- }
-
- private function _importCB($m)
- {
- $url = $m[1];
- $mediaList = preg_replace('/\\s+/', '', $m[2]);
-
- if (strpos($url, '://') > 0) {
- // protocol, leave in place for CSS, comment for JS
- return self::$_isCss
- ? $m[0]
- : "/* Minify_ImportProcessor will not include remote content */";
- }
- if ('/' === $url[0]) {
- // protocol-relative or root path
- $url = ltrim($url, '/');
- $file = realpath($_SERVER['DOCUMENT_ROOT']) . DIRECTORY_SEPARATOR
- . strtr($url, '/', DIRECTORY_SEPARATOR);
- } else {
- // relative to current path
- $file = $this->_currentDir . DIRECTORY_SEPARATOR
- . strtr($url, '/', DIRECTORY_SEPARATOR);
- }
- $obj = new Minify_ImportProcessor(dirname($file));
- $content = $obj->_getContent($file);
- if ('' === $content) {
- // failed. leave in place for CSS, comment for JS
- return self::$_isCss
- ? $m[0]
- : "/* Minify_ImportProcessor could not fetch '{$file}' */";;
- }
- return (!self::$_isCss || preg_match('@(?:^$|\\ball\\b)@', $mediaList))
- ? $content
- : "@media {$mediaList} {\n{$content}\n}\n";
- }
-
- private function _urlCB($m)
- {
- // $m[1] is either quoted or not
- $quote = ($m[1][0] === "'" || $m[1][0] === '"')
- ? $m[1][0]
- : '';
- $url = ($quote === '')
- ? $m[1]
- : substr($m[1], 1, strlen($m[1]) - 2);
- if ('/' !== $url[0]) {
- if (strpos($url, '//') > 0) {
- // probably starts with protocol, do not alter
- } else {
- // prepend path with current dir separator (OS-independent)
- $path = $this->_currentDir
- . DIRECTORY_SEPARATOR . strtr($url, '/', DIRECTORY_SEPARATOR);
- // strip doc root
- $path = substr($path, strlen(realpath($_SERVER['DOCUMENT_ROOT'])));
- // fix to absolute URL
- $url = strtr($path, '/\\', '//');
- // remove /./ and /../ where possible
- $url = str_replace('/./', '/', $url);
- // inspired by patch from Oleg Cherniy
- do {
- $url = preg_replace('@/[^/]+/\\.\\./@', '/', $url, 1, $changed);
- } while ($changed);
- }
- }
- return "url({$quote}{$url}{$quote})";
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Lines.php b/plugins/Minify/extlib/minify/min/lib/Minify/Lines.php
deleted file mode 100644
index 6f94fb63c4..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Lines.php
+++ /dev/null
@@ -1,131 +0,0 @@
-
- * @author Adam Pedersen (Issue 55 fix)
- */
-class Minify_Lines {
-
- /**
- * Add line numbers in C-style comments
- *
- * This uses a very basic parser easily fooled by comment tokens inside
- * strings or regexes, but, otherwise, generally clean code will not be
- * mangled. URI rewriting can also be performed.
- *
- * @param string $content
- *
- * @param array $options available options:
- *
- * 'id': (optional) string to identify file. E.g. file name/path
- *
- * 'currentDir': (default null) if given, this is assumed to be the
- * directory of the current CSS file. Using this, minify will rewrite
- * all relative URIs in import/url declarations to correctly point to
- * the desired files, and prepend a comment with debugging information about
- * this process.
- *
- * @return string
- */
- public static function minify($content, $options = array())
- {
- $id = (isset($options['id']) && $options['id'])
- ? $options['id']
- : '';
- $content = str_replace("\r\n", "\n", $content);
- $lines = explode("\n", $content);
- $numLines = count($lines);
- // determine left padding
- $padTo = strlen($numLines);
- $inComment = false;
- $i = 0;
- $newLines = array();
- while (null !== ($line = array_shift($lines))) {
- if (('' !== $id) && (0 == $i % 50)) {
- array_push($newLines, '', "/* {$id} */", '');
- }
- ++$i;
- $newLines[] = self::_addNote($line, $i, $inComment, $padTo);
- $inComment = self::_eolInComment($line, $inComment);
- }
- $content = implode("\n", $newLines) . "\n";
-
- // check for desired URI rewriting
- if (isset($options['currentDir'])) {
- require_once 'Minify/CSS/UriRewriter.php';
- Minify_CSS_UriRewriter::$debugText = '';
- $content = Minify_CSS_UriRewriter::rewrite(
- $content
- ,$options['currentDir']
- ,isset($options['docRoot']) ? $options['docRoot'] : $_SERVER['DOCUMENT_ROOT']
- ,isset($options['symlinks']) ? $options['symlinks'] : array()
- );
- $content = "/* Minify_CSS_UriRewriter::\$debugText\n\n"
- . Minify_CSS_UriRewriter::$debugText . "*/\n"
- . $content;
- }
-
- return $content;
- }
-
- /**
- * Is the parser within a C-style comment at the end of this line?
- *
- * @param string $line current line of code
- *
- * @param bool $inComment was the parser in a comment at the
- * beginning of the line?
- *
- * @return bool
- */
- private static function _eolInComment($line, $inComment)
- {
- while (strlen($line)) {
- $search = $inComment
- ? '*/'
- : '/*';
- $pos = strpos($line, $search);
- if (false === $pos) {
- return $inComment;
- } else {
- if ($pos == 0
- || ($inComment
- ? substr($line, $pos, 3)
- : substr($line, $pos-1, 3)) != '*/*')
- {
- $inComment = ! $inComment;
- }
- $line = substr($line, $pos + 2);
- }
- }
- return $inComment;
- }
-
- /**
- * Prepend a comment (or note) to the given line
- *
- * @param string $line current line of code
- *
- * @param string $note content of note/comment
- *
- * @param bool $inComment was the parser in a comment at the
- * beginning of the line?
- *
- * @param int $padTo minimum width of comment
- *
- * @return string
- */
- private static function _addNote($line, $note, $inComment, $padTo)
- {
- return $inComment
- ? '/* ' . str_pad($note, $padTo, ' ', STR_PAD_RIGHT) . ' *| ' . $line
- : '/* ' . str_pad($note, $padTo, ' ', STR_PAD_RIGHT) . ' */ ' . $line;
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Logger.php b/plugins/Minify/extlib/minify/min/lib/Minify/Logger.php
deleted file mode 100644
index 7844eea356..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Logger.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- */
-class Minify_Logger {
-
- /**
- * Set logger object.
- *
- * The object should have a method "log" that accepts a value as 1st argument and
- * an optional string label as the 2nd.
- *
- * @param mixed $obj or a "falsey" value to disable
- * @return null
- */
- public static function setLogger($obj = null) {
- self::$_logger = $obj
- ? $obj
- : null;
- }
-
- /**
- * Pass a message to the logger (if set)
- *
- * @param string $msg message to log
- * @return null
- */
- public static function log($msg, $label = 'Minify') {
- if (! self::$_logger) return;
- self::$_logger->log($msg, $label);
- }
-
- /**
- * @var mixed logger object (like FirePHP) or null (i.e. no logger available)
- */
- private static $_logger = null;
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Packer.php b/plugins/Minify/extlib/minify/min/lib/Minify/Packer.php
deleted file mode 100644
index 949c3eef04..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Packer.php
+++ /dev/null
@@ -1,37 +0,0 @@
-pack());
- }
-}
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/Source.php b/plugins/Minify/extlib/minify/min/lib/Minify/Source.php
deleted file mode 100644
index 5a85d10d0d..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/Source.php
+++ /dev/null
@@ -1,187 +0,0 @@
-
- */
-class Minify_Source {
-
- /**
- * @var int time of last modification
- */
- public $lastModified = null;
-
- /**
- * @var callback minifier function specifically for this source.
- */
- public $minifier = null;
-
- /**
- * @var array minification options specific to this source.
- */
- public $minifyOptions = null;
-
- /**
- * @var string full path of file
- */
- public $filepath = null;
-
- /**
- * @var string HTTP Content Type (Minify requires one of the constants Minify::TYPE_*)
- */
- public $contentType = null;
-
- /**
- * Create a Minify_Source
- *
- * In the $spec array(), you can either provide a 'filepath' to an existing
- * file (existence will not be checked!) or give 'id' (unique string for
- * the content), 'content' (the string content) and 'lastModified'
- * (unixtime of last update).
- *
- * As a shortcut, the controller will replace "//" at the beginning
- * of a filepath with $_SERVER['DOCUMENT_ROOT'] . '/'.
- *
- * @param array $spec options
- */
- public function __construct($spec)
- {
- if (isset($spec['filepath'])) {
- if (0 === strpos($spec['filepath'], '//')) {
- $spec['filepath'] = $_SERVER['DOCUMENT_ROOT'] . substr($spec['filepath'], 1);
- }
- $segments = explode('.', $spec['filepath']);
- $ext = strtolower(array_pop($segments));
- switch ($ext) {
- case 'js' : $this->contentType = 'application/x-javascript';
- break;
- case 'css' : $this->contentType = 'text/css';
- break;
- case 'htm' : // fallthrough
- case 'html' : $this->contentType = 'text/html';
- break;
- }
- $this->filepath = $spec['filepath'];
- $this->_id = $spec['filepath'];
- $this->lastModified = filemtime($spec['filepath'])
- // offset for Windows uploaders with out of sync clocks
- + round(Minify::$uploaderHoursBehind * 3600);
- } elseif (isset($spec['id'])) {
- $this->_id = 'id::' . $spec['id'];
- if (isset($spec['content'])) {
- $this->_content = $spec['content'];
- } else {
- $this->_getContentFunc = $spec['getContentFunc'];
- }
- $this->lastModified = isset($spec['lastModified'])
- ? $spec['lastModified']
- : time();
- }
- if (isset($spec['contentType'])) {
- $this->contentType = $spec['contentType'];
- }
- if (isset($spec['minifier'])) {
- $this->minifier = $spec['minifier'];
- }
- if (isset($spec['minifyOptions'])) {
- $this->minifyOptions = $spec['minifyOptions'];
- }
- }
-
- /**
- * Get content
- *
- * @return string
- */
- public function getContent()
- {
- $content = (null !== $this->filepath)
- ? file_get_contents($this->filepath)
- : ((null !== $this->_content)
- ? $this->_content
- : call_user_func($this->_getContentFunc, $this->_id)
- );
- // remove UTF-8 BOM if present
- return (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3))
- ? substr($content, 3)
- : $content;
- }
-
- /**
- * Get id
- *
- * @return string
- */
- public function getId()
- {
- return $this->_id;
- }
-
- /**
- * Verifies a single minification call can handle all sources
- *
- * @param array $sources Minify_Source instances
- *
- * @return bool true iff there no sources with specific minifier preferences.
- */
- public static function haveNoMinifyPrefs($sources)
- {
- foreach ($sources as $source) {
- if (null !== $source->minifier
- || null !== $source->minifyOptions) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Get unique string for a set of sources
- *
- * @param array $sources Minify_Source instances
- *
- * @return string
- */
- public static function getDigest($sources)
- {
- foreach ($sources as $source) {
- $info[] = array(
- $source->_id, $source->minifier, $source->minifyOptions
- );
- }
- return md5(serialize($info));
- }
-
- /**
- * Get content type from a group of sources
- *
- * This is called if the user doesn't pass in a 'contentType' options
- *
- * @param array $sources Minify_Source instances
- *
- * @return string content type. e.g. 'text/css'
- */
- public static function getContentType($sources)
- {
- foreach ($sources as $source) {
- if ($source->contentType !== null) {
- return $source->contentType;
- }
- }
- return 'text/plain';
- }
-
- protected $_content = null;
- protected $_getContentFunc = null;
- protected $_id = null;
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Minify/YUICompressor.php b/plugins/Minify/extlib/minify/min/lib/Minify/YUICompressor.php
deleted file mode 100644
index 7cb61adbec..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Minify/YUICompressor.php
+++ /dev/null
@@ -1,139 +0,0 @@
-
- * Minify_YUICompressor::$jarFile = '/path/to/yuicompressor-2.3.5.jar';
- * Minify_YUICompressor::$tempDir = '/tmp';
- * $code = Minify_YUICompressor::minifyJs(
- * $code
- * ,array('nomunge' => true, 'line-break' => 1000)
- * );
- *
- *
- * @todo unit tests, $options docs
- *
- * @package Minify
- * @author Stephen Clay
- */
-class Minify_YUICompressor {
-
- /**
- * Filepath of the YUI Compressor jar file. This must be set before
- * calling minifyJs() or minifyCss().
- *
- * @var string
- */
- public static $jarFile = null;
-
- /**
- * Writable temp directory. This must be set before calling minifyJs()
- * or minifyCss().
- *
- * @var string
- */
- public static $tempDir = null;
-
- /**
- * Filepath of "java" executable (may be needed if not in shell's PATH)
- *
- * @var string
- */
- public static $javaExecutable = 'java';
-
- /**
- * Minify a Javascript string
- *
- * @param string $js
- *
- * @param array $options (verbose is ignored)
- *
- * @see http://www.julienlecomte.net/yuicompressor/README
- *
- * @return string
- */
- public static function minifyJs($js, $options = array())
- {
- return self::_minify('js', $js, $options);
- }
-
- /**
- * Minify a CSS string
- *
- * @param string $css
- *
- * @param array $options (verbose is ignored)
- *
- * @see http://www.julienlecomte.net/yuicompressor/README
- *
- * @return string
- */
- public static function minifyCss($css, $options = array())
- {
- return self::_minify('css', $css, $options);
- }
-
- private static function _minify($type, $content, $options)
- {
- self::_prepare();
- if (! ($tmpFile = tempnam(self::$tempDir, 'yuic_'))) {
- throw new Exception('Minify_YUICompressor : could not create temp file.');
- }
- file_put_contents($tmpFile, $content);
- exec(self::_getCmd($options, $type, $tmpFile), $output);
- unlink($tmpFile);
- return implode("\n", $output);
- }
-
- private static function _getCmd($userOptions, $type, $tmpFile)
- {
- $o = array_merge(
- array(
- 'charset' => ''
- ,'line-break' => 5000
- ,'type' => $type
- ,'nomunge' => false
- ,'preserve-semi' => false
- ,'disable-optimizations' => false
- )
- ,$userOptions
- );
- $cmd = self::$javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)
- . " --type {$type}"
- . (preg_match('/^[a-zA-Z\\-]+$/', $o['charset'])
- ? " --charset {$o['charset']}"
- : '')
- . (is_numeric($o['line-break']) && $o['line-break'] >= 0
- ? ' --line-break ' . (int)$o['line-break']
- : '');
- if ($type === 'js') {
- foreach (array('nomunge', 'preserve-semi', 'disable-optimizations') as $opt) {
- $cmd .= $o[$opt]
- ? " --{$opt}"
- : '';
- }
- }
- return $cmd . ' ' . escapeshellarg($tmpFile);
- }
-
- private static function _prepare()
- {
- if (! is_file(self::$jarFile)
- || ! is_dir(self::$tempDir)
- || ! is_writable(self::$tempDir)
- ) {
- throw new Exception('Minify_YUICompressor : $jarFile and $tempDir must be set.');
- }
- }
-}
-
diff --git a/plugins/Minify/extlib/minify/min/lib/Solar/Dir.php b/plugins/Minify/extlib/minify/min/lib/Solar/Dir.php
deleted file mode 100644
index 37f7169624..0000000000
--- a/plugins/Minify/extlib/minify/min/lib/Solar/Dir.php
+++ /dev/null
@@ -1,199 +0,0 @@
-
- *
- * @license http://opensource.org/licenses/bsd-license.php BSD
- *
- * @version $Id: Dir.php 2926 2007-11-09 16:25:44Z pmjones $
- *
- */
-class Solar_Dir {
-
- /**
- *
- * The OS-specific temporary directory location.
- *
- * @var string
- *
- */
- protected static $_tmp;
-
- /**
- *
- * Hack for [[php::is_dir() | ]] that checks the include_path.
- *
- * Use this to see if a directory exists anywhere in the include_path.
- *
- * {{code: php
- * $dir = Solar_Dir::exists('path/to/dir')
- * if ($dir) {
- * $files = scandir($dir);
- * } else {
- * echo "Not found in the include-path.";
- * }
- * }}
- *
- * @param string $dir Check for this directory in the include_path.
- *
- * @return mixed If the directory exists in the include_path, returns the
- * absolute path; if not, returns boolean false.
- *
- */
- public static function exists($dir)
- {
- // no file requested?
- $dir = trim($dir);
- if (! $dir) {
- return false;
- }
-
- // using an absolute path for the file?
- // dual check for Unix '/' and Windows '\',
- // or Windows drive letter and a ':'.
- $abs = ($dir[0] == '/' || $dir[0] == '\\' || $dir[1] == ':');
- if ($abs && is_dir($dir)) {
- return $dir;
- }
-
- // using a relative path on the file
- $path = explode(PATH_SEPARATOR, ini_get('include_path'));
- foreach ($path as $base) {
- // strip Unix '/' and Windows '\'
- $target = rtrim($base, '\\/') . DIRECTORY_SEPARATOR . $dir;
- if (is_dir($target)) {
- return $target;
- }
- }
-
- // never found it
- return false;
- }
-
- /**
- *
- * "Fixes" a directory string for the operating system.
- *
- * Use slashes anywhere you need a directory separator. Then run the
- * string through fixdir() and the slashes will be converted to the
- * proper separator (for example '\' on Windows).
- *
- * Always adds a final trailing separator.
- *
- * @param string $dir The directory string to 'fix'.
- *
- * @return string The "fixed" directory string.
- *
- */
- public static function fix($dir)
- {
- $dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);
- return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
- }
-
- /**
- *
- * Convenience method for dirname() and higher-level directories.
- *
- * @param string $file Get the dirname() of this file.
- *
- * @param int $up Move up in the directory structure this many
- * times, default 0.
- *
- * @return string The dirname() of the file.
- *
- */
- public static function name($file, $up = 0)
- {
- $dir = dirname($file);
- while ($up --) {
- $dir = dirname($dir);
- }
- return $dir;
- }
-
- /**
- *
- * Returns the OS-specific directory for temporary files.
- *
- * @param string $sub Add this subdirectory to the returned temporary
- * directory name.
- *
- * @return string The temporary directory path.
- *
- */
- public static function tmp($sub = '')
- {
- // find the tmp dir if needed
- if (! Solar_Dir::$_tmp) {
-
- // use the system if we can
- if (function_exists('sys_get_temp_dir')) {
- $tmp = sys_get_temp_dir();
- } else {
- $tmp = Solar_Dir::_tmp();
- }
-
- // remove trailing separator and save
- Solar_Dir::$_tmp = rtrim($tmp, DIRECTORY_SEPARATOR);
- }
-
- // do we have a subdirectory request?
- $sub = trim($sub);
- if ($sub) {
- // remove leading and trailing separators, and force exactly
- // one trailing separator
- $sub = trim($sub, DIRECTORY_SEPARATOR)
- . DIRECTORY_SEPARATOR;
- }
-
- return Solar_Dir::$_tmp . DIRECTORY_SEPARATOR . $sub;
- }
-
- /**
- *
- * Returns the OS-specific temporary directory location.
- *
- * @return string The temp directory path.
- *
- */
- protected static function _tmp()
- {
- // non-Windows system?
- if (strtolower(substr(PHP_OS, 0, 3)) != 'win') {
- $tmp = empty($_ENV['TMPDIR']) ? getenv('TMPDIR') : $_ENV['TMPDIR'];
- if ($tmp) {
- return $tmp;
- } else {
- return '/tmp';
- }
- }
-
- // Windows 'TEMP'
- $tmp = empty($_ENV['TEMP']) ? getenv('TEMP') : $_ENV['TEMP'];
- if ($tmp) {
- return $tmp;
- }
-
- // Windows 'TMP'
- $tmp = empty($_ENV['TMP']) ? getenv('TMP') : $_ENV['TMP'];
- if ($tmp) {
- return $tmp;
- }
-
- // Windows 'windir'
- $tmp = empty($_ENV['windir']) ? getenv('windir') : $_ENV['windir'];
- if ($tmp) {
- return $tmp;
- }
-
- // final fallback for Windows
- return getenv('SystemRoot') . '\\temp';
- }
-}
\ No newline at end of file
diff --git a/plugins/Minify/extlib/minify/min/utils.php b/plugins/Minify/extlib/minify/min/utils.php
deleted file mode 100644
index c735941520..0000000000
--- a/plugins/Minify/extlib/minify/min/utils.php
+++ /dev/null
@@ -1,90 +0,0 @@
-
- *
- *
- *
- *
- * If you do not want ampersands as HTML entities, set Minify_Build::$ampersand = "&"
- * before using this function.
- *
- * @param string $group a key from groupsConfig.php
- * @param boolean $forceAmpersand (default false) Set to true if the RewriteRule
- * directives in .htaccess are functional. This will remove the "?" from URIs, making them
- * more cacheable by proxies.
- * @return string
- */
-function Minify_groupUri($group, $forceAmpersand = false)
-{
- $path = $forceAmpersand
- ? "/g={$group}"
- : "/?g={$group}";
- return _Minify_getBuild($group)->uri(
- '/' . basename(dirname(__FILE__)) . $path
- ,$forceAmpersand
- );
-}
-
-
-/**
- * Get the last modification time of the source js/css files used by Minify to
- * build the page.
- *
- * If you're caching the output of Minify_groupUri(), you'll want to rebuild
- * the cache if it's older than this timestamp.
- *
- *
- * // simplistic HTML cache system
- * $file = '/path/to/cache/file';
- * if (! file_exists($file) || filemtime($file) < Minify_groupsMtime(array('js', 'css'))) {
- * // (re)build cache
- * $page = buildPage(); // this calls Minify_groupUri() for js and css
- * file_put_contents($file, $page);
- * echo $page;
- * exit();
- * }
- * readfile($file);
- *
- *
- * @param array $groups an array of keys from groupsConfig.php
- * @return int Unix timestamp of the latest modification
- */
-function Minify_groupsMtime($groups)
-{
- $max = 0;
- foreach ((array)$groups as $group) {
- $max = max($max, _Minify_getBuild($group)->lastModified);
- }
- return $max;
-}
-
-/**
- * @param string $group a key from groupsConfig.php
- * @return Minify_Build
- * @private
- */
-function _Minify_getBuild($group)
-{
- static $builds = array();
- static $gc = false;
- if (false === $gc) {
- $gc = (require dirname(__FILE__) . '/groupsConfig.php');
- }
- if (! isset($builds[$group])) {
- $builds[$group] = new Minify_Build($gc[$group]);
- }
- return $builds[$group];
-}
diff --git a/plugins/Minify/locale/Minify.pot b/plugins/Minify/locale/Minify.pot
deleted file mode 100644
index 1adbfbf4b2..0000000000
--- a/plugins/Minify/locale/Minify.pot
+++ /dev/null
@@ -1,40 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR , YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-27 16:31+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/af/LC_MESSAGES/Minify.po b/plugins/Minify/locale/af/LC_MESSAGES/Minify.po
deleted file mode 100644
index f90d7a8278..0000000000
--- a/plugins/Minify/locale/af/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Afrikaans (http://www.transifex.com/gnu-social/gnu-social/language/af/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: af\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ar/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ar/LC_MESSAGES/Minify.po
deleted file mode 100644
index db8d5445b2..0000000000
--- a/plugins/Minify/locale/ar/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Arabic (http://www.transifex.com/gnu-social/gnu-social/language/ar/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ar\n"
-"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/arz/LC_MESSAGES/Minify.po b/plugins/Minify/locale/arz/LC_MESSAGES/Minify.po
deleted file mode 100644
index b22526f40c..0000000000
--- a/plugins/Minify/locale/arz/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Arabic (Egypt) (http://www.transifex.com/gnu-social/gnu-social/language/ar_EG/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ar_EG\n"
-"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ast/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ast/LC_MESSAGES/Minify.po
deleted file mode 100644
index b50fb92bcb..0000000000
--- a/plugins/Minify/locale/ast/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Asturian (http://www.transifex.com/gnu-social/gnu-social/language/ast/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ast\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/be-tarask/LC_MESSAGES/Minify.po b/plugins/Minify/locale/be-tarask/LC_MESSAGES/Minify.po
deleted file mode 100644
index 0a31ebacac..0000000000
--- a/plugins/Minify/locale/be-tarask/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Belarusian (Tarask) (http://www.transifex.com/gnu-social/gnu-social/language/be@tarask/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: be@tarask\n"
-"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/bg/LC_MESSAGES/Minify.po b/plugins/Minify/locale/bg/LC_MESSAGES/Minify.po
deleted file mode 100644
index 5119c5d51f..0000000000
--- a/plugins/Minify/locale/bg/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Bulgarian (http://www.transifex.com/gnu-social/gnu-social/language/bg/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: bg\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/bn_IN/LC_MESSAGES/Minify.po b/plugins/Minify/locale/bn_IN/LC_MESSAGES/Minify.po
deleted file mode 100644
index ec9c1cf81d..0000000000
--- a/plugins/Minify/locale/bn_IN/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Bengali (India) (http://www.transifex.com/gnu-social/gnu-social/language/bn_IN/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: bn_IN\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/br/LC_MESSAGES/Minify.po b/plugins/Minify/locale/br/LC_MESSAGES/Minify.po
deleted file mode 100644
index bd54d72430..0000000000
--- a/plugins/Minify/locale/br/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Breton (http://www.transifex.com/gnu-social/gnu-social/language/br/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: br\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "N'eo ket skoret ar seurt restroù"
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ca/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ca/LC_MESSAGES/Minify.po
deleted file mode 100644
index 4539488ccd..0000000000
--- a/plugins/Minify/locale/ca/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Catalan (http://www.transifex.com/gnu-social/gnu-social/language/ca/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ca\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/cs/LC_MESSAGES/Minify.po b/plugins/Minify/locale/cs/LC_MESSAGES/Minify.po
deleted file mode 100644
index d2096e8896..0000000000
--- a/plugins/Minify/locale/cs/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Czech (http://www.transifex.com/gnu-social/gnu-social/language/cs/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: cs\n"
-"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/da/LC_MESSAGES/Minify.po b/plugins/Minify/locale/da/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6f93787b5e..0000000000
--- a/plugins/Minify/locale/da/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Danish (http://www.transifex.com/gnu-social/gnu-social/language/da/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: da\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/de/LC_MESSAGES/Minify.po b/plugins/Minify/locale/de/LC_MESSAGES/Minify.po
deleted file mode 100644
index 107c6b360e..0000000000
--- a/plugins/Minify/locale/de/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: German (http://www.transifex.com/gnu-social/gnu-social/language/de/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: de\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Der Parameter „f“ ist keine gültige Pfadangabe."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Der Parameter „f“ ist erfordert, fehlt jedoch."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Dateityp nicht unterstützt."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Das Minify-Plugin minimiert das CSS und JavaScript von StatusNet durch Entfernen von Leerzeichen und Kommentaren."
diff --git a/plugins/Minify/locale/el/LC_MESSAGES/Minify.po b/plugins/Minify/locale/el/LC_MESSAGES/Minify.po
deleted file mode 100644
index 4042f30311..0000000000
--- a/plugins/Minify/locale/el/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Greek (http://www.transifex.com/gnu-social/gnu-social/language/el/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: el\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/en_GB/LC_MESSAGES/Minify.po b/plugins/Minify/locale/en_GB/LC_MESSAGES/Minify.po
deleted file mode 100644
index b3700ff723..0000000000
--- a/plugins/Minify/locale/en_GB/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,43 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-# Luke Hollins , 2015
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-03-07 12:52+0000\n"
-"Last-Translator: Luke Hollins \n"
-"Language-Team: English (United Kingdom) (http://www.transifex.com/gnu-social/gnu-social/language/en_GB/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: en_GB\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "The parameter \"f\" is not a valid path."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "The parameter \"f\" is required but missing."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "File type not supported."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "The Minify plugin minifies StatusNet's CSS and JavaScript, removing whitespace and comments."
diff --git a/plugins/Minify/locale/eo/LC_MESSAGES/Minify.po b/plugins/Minify/locale/eo/LC_MESSAGES/Minify.po
deleted file mode 100644
index 0cd70205e0..0000000000
--- a/plugins/Minify/locale/eo/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Esperanto (http://www.transifex.com/gnu-social/gnu-social/language/eo/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: eo\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/es/LC_MESSAGES/Minify.po b/plugins/Minify/locale/es/LC_MESSAGES/Minify.po
deleted file mode 100644
index 61bd0924e8..0000000000
--- a/plugins/Minify/locale/es/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,43 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-# Juan Riquelme González , 2015
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-27 16:01+0000\n"
-"Last-Translator: Juan Riquelme González \n"
-"Language-Team: Spanish (http://www.transifex.com/gnu-social/gnu-social/language/es/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: es\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "El parámetro f no contiene una ruta válida."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "No se encuentra el parámetro f (requerido)."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Tipo de archivo no soportado."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "El complemento Minify minimiza los archivos CSS y JavaScript de GNU social, borrando espacios en blanco y comentarios."
diff --git a/plugins/Minify/locale/eu/LC_MESSAGES/Minify.po b/plugins/Minify/locale/eu/LC_MESSAGES/Minify.po
deleted file mode 100644
index 60554c7145..0000000000
--- a/plugins/Minify/locale/eu/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Basque (http://www.transifex.com/gnu-social/gnu-social/language/eu/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: eu\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "\"f\" parametroa ez da baliozko bide bat."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Beharrezkoa den \"f\" parametroa falta da."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Fitxategi moeta ez da onartzen."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Minify pluginak StatusNeten CSS eta Javascripta sinplifikatzen ditu, iruzikin eta zuriuneak ezabatuz."
diff --git a/plugins/Minify/locale/fa/LC_MESSAGES/Minify.po b/plugins/Minify/locale/fa/LC_MESSAGES/Minify.po
deleted file mode 100644
index 766b59d729..0000000000
--- a/plugins/Minify/locale/fa/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Persian (http://www.transifex.com/gnu-social/gnu-social/language/fa/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fa\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/fi/LC_MESSAGES/Minify.po b/plugins/Minify/locale/fi/LC_MESSAGES/Minify.po
deleted file mode 100644
index a30119c4a4..0000000000
--- a/plugins/Minify/locale/fi/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Finnish (http://www.transifex.com/gnu-social/gnu-social/language/fi/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fi\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/fr/LC_MESSAGES/Minify.po b/plugins/Minify/locale/fr/LC_MESSAGES/Minify.po
deleted file mode 100644
index e274a34014..0000000000
--- a/plugins/Minify/locale/fr/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: French (http://www.transifex.com/gnu-social/gnu-social/language/fr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fr\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Le paramètre « f » ne contient pas un chemin valide."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Le paramètre « f » est nécessaire mais absent."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Type de fichier non pris en charge."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Le greffon Minify minimise vos CSS et Javascript, en supprimant les espaces et les commentaires."
diff --git a/plugins/Minify/locale/fur/LC_MESSAGES/Minify.po b/plugins/Minify/locale/fur/LC_MESSAGES/Minify.po
deleted file mode 100644
index 80ca1a914a..0000000000
--- a/plugins/Minify/locale/fur/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Friulian (http://www.transifex.com/gnu-social/gnu-social/language/fur/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fur\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/gl/LC_MESSAGES/Minify.po b/plugins/Minify/locale/gl/LC_MESSAGES/Minify.po
deleted file mode 100644
index 33194827ce..0000000000
--- a/plugins/Minify/locale/gl/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Galician (http://www.transifex.com/gnu-social/gnu-social/language/gl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: gl\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "O parámetro \"f\" non é unha ruta válida."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "O parámetro \"f\" é necesario, pero falta."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Tipo de ficheiro non soportado."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "O complemento Minify minimiza o CSS e o JavaScript de StatusNet, eliminando os espazos en branco e os comentarios."
diff --git a/plugins/Minify/locale/he/LC_MESSAGES/Minify.po b/plugins/Minify/locale/he/LC_MESSAGES/Minify.po
deleted file mode 100644
index ee9644fd6a..0000000000
--- a/plugins/Minify/locale/he/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Hebrew (http://www.transifex.com/gnu-social/gnu-social/language/he/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: he\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/hsb/LC_MESSAGES/Minify.po b/plugins/Minify/locale/hsb/LC_MESSAGES/Minify.po
deleted file mode 100644
index f2694835e5..0000000000
--- a/plugins/Minify/locale/hsb/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Upper Sorbian (http://www.transifex.com/gnu-social/gnu-social/language/hsb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: hsb\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/hu/LC_MESSAGES/Minify.po b/plugins/Minify/locale/hu/LC_MESSAGES/Minify.po
deleted file mode 100644
index 82df2927eb..0000000000
--- a/plugins/Minify/locale/hu/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Hungarian (http://www.transifex.com/gnu-social/gnu-social/language/hu/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: hu\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/hy_AM/LC_MESSAGES/Minify.po b/plugins/Minify/locale/hy_AM/LC_MESSAGES/Minify.po
deleted file mode 100644
index 3e92943f5e..0000000000
--- a/plugins/Minify/locale/hy_AM/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Armenian (Armenia) (http://www.transifex.com/gnu-social/gnu-social/language/hy_AM/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: hy_AM\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ia/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ia/LC_MESSAGES/Minify.po
deleted file mode 100644
index 5f72274228..0000000000
--- a/plugins/Minify/locale/ia/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Interlingua (http://www.transifex.com/gnu-social/gnu-social/language/ia/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ia\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Le parametro \"f\" non es un cammino valide."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Le parametro \"f\" es necessari, ma manca."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Typo de file non supportate."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Le plug-in Minify minimisa le CSS e JavaScript de StatusNet, removente spatio blanc e commentos."
diff --git a/plugins/Minify/locale/id/LC_MESSAGES/Minify.po b/plugins/Minify/locale/id/LC_MESSAGES/Minify.po
deleted file mode 100644
index cbd7980dfb..0000000000
--- a/plugins/Minify/locale/id/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,43 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-# zk , 2015
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-05-28 15:50+0000\n"
-"Last-Translator: zk \n"
-"Language-Team: Indonesian (http://www.transifex.com/gnu-social/gnu-social/language/id/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: id\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Parameter \"f\" bukan jalur yang valid."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/io/LC_MESSAGES/Minify.po b/plugins/Minify/locale/io/LC_MESSAGES/Minify.po
deleted file mode 100644
index dd7aece571..0000000000
--- a/plugins/Minify/locale/io/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,43 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-# Ciencisto Dementa , 2015
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-06-16 23:52+0000\n"
-"Last-Translator: Ciencisto Dementa \n"
-"Language-Team: Ido (http://www.transifex.com/gnu-social/gnu-social/language/io/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: io\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "La parametro \"f\" ne es valida voyo."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "La parametro \"f\" es necesa ma mankanta."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Dokumento-tipo nesuportata."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "L'extensilo Minify miniaturigas la CSS e JavaScript di GNU social, per efacar vakua spaco e komenti."
diff --git a/plugins/Minify/locale/is/LC_MESSAGES/Minify.po b/plugins/Minify/locale/is/LC_MESSAGES/Minify.po
deleted file mode 100644
index d8a56e1a31..0000000000
--- a/plugins/Minify/locale/is/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Icelandic (http://www.transifex.com/gnu-social/gnu-social/language/is/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: is\n"
-"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/it/LC_MESSAGES/Minify.po b/plugins/Minify/locale/it/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6fc817e97d..0000000000
--- a/plugins/Minify/locale/it/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Italian (http://www.transifex.com/gnu-social/gnu-social/language/it/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: it\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Il parametro \"f\" non contiene un percorso valido."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Il parametro \"f\" è richiesto ma è mancante."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Tipo di file non supportato."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "L'estensione Minify minimizza il CSS e gli JavaScript utilizzati da StatusNet, rimuovendo spazi bianchi e commenti."
diff --git a/plugins/Minify/locale/ja/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ja/LC_MESSAGES/Minify.po
deleted file mode 100644
index 91d280c3ec..0000000000
--- a/plugins/Minify/locale/ja/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Japanese (http://www.transifex.com/gnu-social/gnu-social/language/ja/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ja\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ka/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ka/LC_MESSAGES/Minify.po
deleted file mode 100644
index bf4ac1b763..0000000000
--- a/plugins/Minify/locale/ka/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Georgian (http://www.transifex.com/gnu-social/gnu-social/language/ka/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ka\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ko/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ko/LC_MESSAGES/Minify.po
deleted file mode 100644
index 5cfc9f5cee..0000000000
--- a/plugins/Minify/locale/ko/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Korean (http://www.transifex.com/gnu-social/gnu-social/language/ko/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ko\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ksh/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ksh/LC_MESSAGES/Minify.po
deleted file mode 100644
index ce1df8d749..0000000000
--- a/plugins/Minify/locale/ksh/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Colognian (http://www.transifex.com/gnu-social/gnu-social/language/ksh/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ksh\n"
-"Plural-Forms: nplurals=3; plural=(n==0) ? 0 : (n==1) ? 1 : 2;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/lb/LC_MESSAGES/Minify.po b/plugins/Minify/locale/lb/LC_MESSAGES/Minify.po
deleted file mode 100644
index 631ad6d8a1..0000000000
--- a/plugins/Minify/locale/lb/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Luxembourgish (http://www.transifex.com/gnu-social/gnu-social/language/lb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lb\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/lt/LC_MESSAGES/Minify.po b/plugins/Minify/locale/lt/LC_MESSAGES/Minify.po
deleted file mode 100644
index e6aeaddf25..0000000000
--- a/plugins/Minify/locale/lt/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Lithuanian (http://www.transifex.com/gnu-social/gnu-social/language/lt/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lt\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/lv/LC_MESSAGES/Minify.po b/plugins/Minify/locale/lv/LC_MESSAGES/Minify.po
deleted file mode 100644
index 7b2535ea63..0000000000
--- a/plugins/Minify/locale/lv/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:39+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Latvian (http://www.transifex.com/gnu-social/gnu-social/language/lv/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lv\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/mg/LC_MESSAGES/Minify.po b/plugins/Minify/locale/mg/LC_MESSAGES/Minify.po
deleted file mode 100644
index 5990916e9c..0000000000
--- a/plugins/Minify/locale/mg/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Malagasy (http://www.transifex.com/gnu-social/gnu-social/language/mg/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: mg\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/mk/LC_MESSAGES/Minify.po b/plugins/Minify/locale/mk/LC_MESSAGES/Minify.po
deleted file mode 100644
index b3be7fcb2d..0000000000
--- a/plugins/Minify/locale/mk/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Macedonian (http://www.transifex.com/gnu-social/gnu-social/language/mk/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: mk\n"
-"Plural-Forms: nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Параметарот „f“ не претставува важечка патека."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Параметарот „f“ е задолжителен, но недостасува."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Овој топ на податотека не е поддржан."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Приклучокот Minify ги смалува CSS и JavaScript на StatusNet, отстранувајќи бели простори и коментари."
diff --git a/plugins/Minify/locale/ml/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ml/LC_MESSAGES/Minify.po
deleted file mode 100644
index 2f913ec933..0000000000
--- a/plugins/Minify/locale/ml/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Malayalam (http://www.transifex.com/gnu-social/gnu-social/language/ml/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ml\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ms/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ms/LC_MESSAGES/Minify.po
deleted file mode 100644
index 51bab20de0..0000000000
--- a/plugins/Minify/locale/ms/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Malay (http://www.transifex.com/gnu-social/gnu-social/language/ms/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ms\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/my/LC_MESSAGES/Minify.po b/plugins/Minify/locale/my/LC_MESSAGES/Minify.po
deleted file mode 100644
index dc341f1259..0000000000
--- a/plugins/Minify/locale/my/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Burmese (http://www.transifex.com/gnu-social/gnu-social/language/my/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: my\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/nb/LC_MESSAGES/Minify.po b/plugins/Minify/locale/nb/LC_MESSAGES/Minify.po
deleted file mode 100644
index b4b1cbbc9d..0000000000
--- a/plugins/Minify/locale/nb/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Norwegian Bokmål (http://www.transifex.com/gnu-social/gnu-social/language/nb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nb\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Parameteren «f» er ikke en gyldig sti."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Parameteren «f» er nødvendig, men mangler."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Filtype støttes ikke."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Utvidelsen Minify minimerer StatusNets CSS og JavaScript og fjerner mellomrom og kommentarer."
diff --git a/plugins/Minify/locale/ne/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ne/LC_MESSAGES/Minify.po
deleted file mode 100644
index 504f645396..0000000000
--- a/plugins/Minify/locale/ne/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:30+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Nepali (http://www.transifex.com/gnu-social/gnu-social/language/ne/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ne\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/nl/LC_MESSAGES/Minify.po b/plugins/Minify/locale/nl/LC_MESSAGES/Minify.po
deleted file mode 100644
index f53ff843b9..0000000000
--- a/plugins/Minify/locale/nl/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Dutch (http://www.transifex.com/gnu-social/gnu-social/language/nl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nl\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "De parameter \"f\" is geen geldig pad."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "De parameter \"f\" is vereist, maar ontbreekt."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Dit bestandstype wordt niet ondersteund"
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "De plug-in Minify maakt CSS en JavaScript kleiner door witruimte en opmerkingen te verwijderen."
diff --git a/plugins/Minify/locale/nn/LC_MESSAGES/Minify.po b/plugins/Minify/locale/nn/LC_MESSAGES/Minify.po
deleted file mode 100644
index 80aa586139..0000000000
--- a/plugins/Minify/locale/nn/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Norwegian Nynorsk (http://www.transifex.com/gnu-social/gnu-social/language/nn/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nn\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/pl/LC_MESSAGES/Minify.po b/plugins/Minify/locale/pl/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6025d136a2..0000000000
--- a/plugins/Minify/locale/pl/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Polish (http://www.transifex.com/gnu-social/gnu-social/language/pl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pl\n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/pt/LC_MESSAGES/Minify.po b/plugins/Minify/locale/pt/LC_MESSAGES/Minify.po
deleted file mode 100644
index d897cdfc6f..0000000000
--- a/plugins/Minify/locale/pt/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Portuguese (http://www.transifex.com/gnu-social/gnu-social/language/pt/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pt\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/pt_BR/LC_MESSAGES/Minify.po b/plugins/Minify/locale/pt_BR/LC_MESSAGES/Minify.po
deleted file mode 100644
index 9a8dea10a2..0000000000
--- a/plugins/Minify/locale/pt_BR/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Portuguese (Brazil) (http://www.transifex.com/gnu-social/gnu-social/language/pt_BR/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pt_BR\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ro_RO/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ro_RO/LC_MESSAGES/Minify.po
deleted file mode 100644
index aa39878909..0000000000
--- a/plugins/Minify/locale/ro_RO/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Romanian (Romania) (http://www.transifex.com/gnu-social/gnu-social/language/ro_RO/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ro_RO\n"
-"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ru/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ru/LC_MESSAGES/Minify.po
deleted file mode 100644
index 9e1356f405..0000000000
--- a/plugins/Minify/locale/ru/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Russian (http://www.transifex.com/gnu-social/gnu-social/language/ru/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ru\n"
-"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Параметр «f» содержит неправильный путь."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Требуется параметр «f», но он отсутствует."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Тип файла не поддерживается."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Плагин «Minify» сжимает CSS и JavaScript StatusNet'а, удаляя лишние пробелы и комментарии."
diff --git a/plugins/Minify/locale/sl/LC_MESSAGES/Minify.po b/plugins/Minify/locale/sl/LC_MESSAGES/Minify.po
deleted file mode 100644
index 9a93409f2f..0000000000
--- a/plugins/Minify/locale/sl/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Slovenian (http://www.transifex.com/gnu-social/gnu-social/language/sl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: sl\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/sr-ec/LC_MESSAGES/Minify.po b/plugins/Minify/locale/sr-ec/LC_MESSAGES/Minify.po
deleted file mode 100644
index 03a895693e..0000000000
--- a/plugins/Minify/locale/sr-ec/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Serbian (http://www.transifex.com/gnu-social/gnu-social/language/sr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: sr\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/sv/LC_MESSAGES/Minify.po b/plugins/Minify/locale/sv/LC_MESSAGES/Minify.po
deleted file mode 100644
index f416f55e39..0000000000
--- a/plugins/Minify/locale/sv/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Swedish (http://www.transifex.com/gnu-social/gnu-social/language/sv/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: sv\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Parametern \"f\" är inte en giltig sökväg."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Parametern \"f\" är obligatoriska men saknas."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Filtypen stöds inte"
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/ta/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ta/LC_MESSAGES/Minify.po
deleted file mode 100644
index e588fd50e6..0000000000
--- a/plugins/Minify/locale/ta/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Tamil (http://www.transifex.com/gnu-social/gnu-social/language/ta/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ta\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/te/LC_MESSAGES/Minify.po b/plugins/Minify/locale/te/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6fa1fd040a..0000000000
--- a/plugins/Minify/locale/te/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Telugu (http://www.transifex.com/gnu-social/gnu-social/language/te/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: te\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/tl/LC_MESSAGES/Minify.po b/plugins/Minify/locale/tl/LC_MESSAGES/Minify.po
deleted file mode 100644
index 911b6b4ca8..0000000000
--- a/plugins/Minify/locale/tl/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Tagalog (http://www.transifex.com/gnu-social/gnu-social/language/tl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: tl\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Ang parametrong \"f\" ay hindi isang tanggap na landas."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Ang parametrong \"f\" ay kailangan ngunit nawawala."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Hindi tinatangkilik ang uri ng talaksan."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Ang pamasak na Minify ay nagpapaliit sa CSS at JavaScript ng StatusNet, na nagtatanggal ng puting puwang at mga puna."
diff --git a/plugins/Minify/locale/tr/LC_MESSAGES/Minify.po b/plugins/Minify/locale/tr/LC_MESSAGES/Minify.po
deleted file mode 100644
index 4c2f2f6ea7..0000000000
--- a/plugins/Minify/locale/tr/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Turkish (http://www.transifex.com/gnu-social/gnu-social/language/tr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: tr\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/uk/LC_MESSAGES/Minify.po b/plugins/Minify/locale/uk/LC_MESSAGES/Minify.po
deleted file mode 100644
index c3196917c6..0000000000
--- a/plugins/Minify/locale/uk/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Ukrainian (http://www.transifex.com/gnu-social/gnu-social/language/uk/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: uk\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "Параметр «f» не є правильним шляхом."
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "Параметр «f» має бути зазначено, але він відсутній."
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "Тип файлу не підтримується."
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Додаток Minify мінімізує CSS та JavaScript сайту StatusNet, усуваючи пропуски і коментарі."
diff --git a/plugins/Minify/locale/ur_PK/LC_MESSAGES/Minify.po b/plugins/Minify/locale/ur_PK/LC_MESSAGES/Minify.po
deleted file mode 100644
index adffb75f71..0000000000
--- a/plugins/Minify/locale/ur_PK/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Urdu (Pakistan) (http://www.transifex.com/gnu-social/gnu-social/language/ur_PK/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ur_PK\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/vi/LC_MESSAGES/Minify.po b/plugins/Minify/locale/vi/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6ded091da6..0000000000
--- a/plugins/Minify/locale/vi/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Vietnamese (http://www.transifex.com/gnu-social/gnu-social/language/vi/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: vi\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/zh/LC_MESSAGES/Minify.po b/plugins/Minify/locale/zh/LC_MESSAGES/Minify.po
deleted file mode 100644
index 2cdb0d63e7..0000000000
--- a/plugins/Minify/locale/zh/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Chinese (http://www.transifex.com/gnu-social/gnu-social/language/zh/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: zh\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
diff --git a/plugins/Minify/locale/zh_CN/LC_MESSAGES/Minify.po b/plugins/Minify/locale/zh_CN/LC_MESSAGES/Minify.po
deleted file mode 100644
index 9256e7bb60..0000000000
--- a/plugins/Minify/locale/zh_CN/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:02+0000\n"
-"Last-Translator: digitaldreamer \n"
-"Language-Team: Chinese (China) (http://www.transifex.com/gnu-social/gnu-social/language/zh_CN/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: zh_CN\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr "参数 \"f\" 不是个有效的路径。"
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr "需要参数 \"f\" 但是丢失了。"
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr "文件类型不支持。"
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr "Minify 插件通过删除空白和注释缩小 StatusNet 的 CSS 和 JavaScript。"
diff --git a/plugins/Minify/locale/zh_TW/LC_MESSAGES/Minify.po b/plugins/Minify/locale/zh_TW/LC_MESSAGES/Minify.po
deleted file mode 100644
index 6ee98595d9..0000000000
--- a/plugins/Minify/locale/zh_TW/LC_MESSAGES/Minify.po
+++ /dev/null
@@ -1,42 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:50+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Chinese (Taiwan) (http://www.transifex.com/gnu-social/gnu-social/language/zh_TW/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: zh_TW\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Client error displayed when not providing a valid path in parameter
-#. "f".
-#: actions/minify.php:50
-msgid "The parameter \"f\" is not a valid path."
-msgstr ""
-
-#. TRANS: Client error displayed when not providing parameter "f".
-#: actions/minify.php:54
-msgid "The parameter \"f\" is required but missing."
-msgstr ""
-
-#. TRANS: Client error displayed when trying to minify an unsupported file
-#. type.
-#: actions/minify.php:112
-msgid "File type not supported."
-msgstr ""
-
-#. TRANS: Plugin description.
-#: MinifyPlugin.php:168
-msgid ""
-"The Minify plugin minifies StatusNet's CSS and JavaScript, removing "
-"whitespace and comments."
-msgstr ""
From ae681b10e7bd61743bd772f5be09ce539c26b33b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 03:11:22 +0100
Subject: [PATCH 122/415] geometa.js doesn't exist anymore
---
lib/action.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/action.php b/lib/action.php
index 7fffa6576b..6d6efb1cbc 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -434,7 +434,6 @@ class Action extends HTMLOutputter // lawsuit
if (Event::handle('StartShowStatusNetScripts', array($this))) {
$this->script('util.js');
$this->script('xbImportNode.js');
- $this->script('geometa.js');
// This route isn't available in single-user mode.
// Not sure why, but it causes errors here.
From 241b965715f3f1dba4290500110a457262a19b11 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 03:12:24 +0100
Subject: [PATCH 123/415] oEmbed CSS file
---
plugins/Oembed/css/oembed.css | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 plugins/Oembed/css/oembed.css
diff --git a/plugins/Oembed/css/oembed.css b/plugins/Oembed/css/oembed.css
new file mode 100644
index 0000000000..ad7b3fb9b0
--- /dev/null
+++ b/plugins/Oembed/css/oembed.css
@@ -0,0 +1,15 @@
+.oembed-thumb {
+ float: left;
+ margin-bottom: 1ex;
+ margin-right: 1em;
+ padding-bottom: 1ex;
+}
+
+.oembed-source {
+ font-style: italic;
+}
+
+.oembed-html {
+ max-height: 100px;
+ overflow: auto;
+}
From 38f7deca7859f1c70721a82ace2024d014f4654f Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 11:17:25 +0100
Subject: [PATCH 124/415] Avoid "property of non-object" PHP notice.
---
lib/peopletaggroupnav.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/peopletaggroupnav.php b/lib/peopletaggroupnav.php
index fb579affe0..44e4756b81 100644
--- a/lib/peopletaggroupnav.php
+++ b/lib/peopletaggroupnav.php
@@ -105,7 +105,8 @@ class PeopletagGroupNav extends Widget
$this->out->elementStart('ul', array('class' => 'nav'));
- if (Event::handle('StartPeopletagGroupNav', array($this))) {
+ if (Event::handle('StartPeopletagGroupNav', array($this))
+ && $tag instanceof Profile_list && $user_profile instanceof Profile) {
// People tag timeline
$this->out->menuItem(common_local_url('showprofiletag', array('nickname' => $user_profile->nickname,
'tag' => $tag->tag)),
From 1ebd4f342e20c6a6ea517e15c4e81446f377d656 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 12:12:24 +0100
Subject: [PATCH 125/415] woops, accidentally deleted updates-from rel on mass
Google-deletion
---
plugins/LRDD/lib/discovery.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/LRDD/lib/discovery.php b/plugins/LRDD/lib/discovery.php
index 9825ea3cb7..4049113408 100644
--- a/plugins/LRDD/lib/discovery.php
+++ b/plugins/LRDD/lib/discovery.php
@@ -37,6 +37,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class Discovery
{
const LRDD_REL = 'lrdd';
+ const UPDATESFROM = 'http://schemas.google.com/g/2010#updates-from';
const HCARD = 'http://microformats.org/profile/hcard';
const MF2_HCARD = 'http://microformats.org/profile/h-card'; // microformats2 h-card
From 39ebb64b858b1b3e7fd21c6de82895dfcaec77b3 Mon Sep 17 00:00:00 2001
From: "Neil E. Hodges" <47hasbegun@gmail.com>
Date: Sat, 19 Mar 2016 03:23:26 -0700
Subject: [PATCH 126/415] Added proper enabling and disabling of sending RTs to
Twitter.
---
classes/Foreign_link.php | 8 +++++++-
lib/framework.php | 1 +
plugins/FacebookBridge/actions/facebooksettings.php | 3 ++-
plugins/TwitterBridge/actions/twitterauthorization.php | 2 +-
plugins/TwitterBridge/actions/twittersettings.php | 9 ++++++++-
plugins/TwitterBridge/twitter.php | 9 ++++++++-
6 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index b3757448ad..8388f12e72 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -89,7 +89,7 @@ class Foreign_link extends Managed_DataObject
return $flink;
}
- function set_flags($noticesend, $noticerecv, $replysync, $friendsync)
+ function set_flags($noticesend, $noticerecv, $replysync, $repeatsync, $friendsync)
{
if ($noticesend) {
$this->noticesync |= FOREIGN_NOTICE_SEND;
@@ -109,6 +109,12 @@ class Foreign_link extends Managed_DataObject
$this->noticesync &= ~FOREIGN_NOTICE_SEND_REPLY;
}
+ if ($repeatsync) {
+ $this->noticesync |= FOREIGN_NOTICE_SEND_REPEAT;
+ } else {
+ $this->noticesync &= ~FOREIGN_NOTICE_SEND_REPEAT;
+ }
+
if ($friendsync) {
$this->friendsync |= FOREIGN_FRIEND_RECV;
} else {
diff --git a/lib/framework.php b/lib/framework.php
index 229de8b793..79d171c698 100644
--- a/lib/framework.php
+++ b/lib/framework.php
@@ -46,6 +46,7 @@ define('PROFILES_PER_MINILIST', 8);
define('FOREIGN_NOTICE_SEND', 1);
define('FOREIGN_NOTICE_RECV', 2);
define('FOREIGN_NOTICE_SEND_REPLY', 4);
+define('FOREIGN_NOTICE_SEND_REPEAT', 8);
define('FOREIGN_FRIEND_SEND', 1);
define('FOREIGN_FRIEND_RECV', 2);
diff --git a/plugins/FacebookBridge/actions/facebooksettings.php b/plugins/FacebookBridge/actions/facebooksettings.php
index 67dd20e036..9073256d1d 100644
--- a/plugins/FacebookBridge/actions/facebooksettings.php
+++ b/plugins/FacebookBridge/actions/facebooksettings.php
@@ -213,7 +213,8 @@ class FacebooksettingsAction extends SettingsAction {
$replysync = $this->boolean('replysync');
$original = clone($this->flink);
- $this->flink->set_flags($noticesync, false, $replysync, false);
+ // TODO: Allow disabling of repeats
+ $this->flink->set_flags($noticesync, false, $replysync, true, false);
$result = $this->flink->update($original);
if ($result === false) {
diff --git a/plugins/TwitterBridge/actions/twitterauthorization.php b/plugins/TwitterBridge/actions/twitterauthorization.php
index c9b892b640..9ee7e6b899 100644
--- a/plugins/TwitterBridge/actions/twitterauthorization.php
+++ b/plugins/TwitterBridge/actions/twitterauthorization.php
@@ -237,7 +237,7 @@ class TwitterauthorizationAction extends FormAction
// Defaults: noticesync on, everything else off
- $flink->set_flags(true, false, false, false);
+ $flink->set_flags(true, false, false, false, false);
$flink_id = $flink->insert();
diff --git a/plugins/TwitterBridge/actions/twittersettings.php b/plugins/TwitterBridge/actions/twittersettings.php
index ccdb44fcb9..1fb0e793c6 100644
--- a/plugins/TwitterBridge/actions/twittersettings.php
+++ b/plugins/TwitterBridge/actions/twittersettings.php
@@ -161,6 +161,12 @@ class TwittersettingsAction extends ProfileSettingsAction
$this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY);
$this->elementEnd('li');
$this->elementStart('li');
+ $this->checkbox('repeatsync',
+ // TRANS: Checkbox label.
+ _m('Send local repeats to Twitter.'),
+ $this->flink->noticesync & FOREIGN_NOTICE_SEND_REPEAT);
+ $this->elementEnd('li');
+ $this->elementStart('li');
$this->checkbox('friendsync',
// TRANS: Checkbox label.
_m('Subscribe to my Twitter friends here.'),
@@ -265,6 +271,7 @@ class TwittersettingsAction extends ProfileSettingsAction
$noticerecv = $this->boolean('noticerecv');
$friendsync = $this->boolean('friendsync');
$replysync = $this->boolean('replysync');
+ $repeatsync = $this->boolean('repeatsync');
if (!$this->flink instanceof Foreign_link) {
common_log_db_error($this->flink, 'SELECT', __FILE__);
@@ -274,7 +281,7 @@ class TwittersettingsAction extends ProfileSettingsAction
$original = clone($this->flink);
$wasReceiving = (bool)($original->noticesync & FOREIGN_NOTICE_RECV);
- $this->flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync);
+ $this->flink->set_flags($noticesend, $noticerecv, $replysync, $repeatsync, $friendsync);
$result = $this->flink->update($original);
if ($result === false) {
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 6b7e2179e6..ffdee72a97 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -111,7 +111,14 @@ function is_twitter_bound($notice, $flink) {
return false;
}
- $allowedVerbs = array(ActivityVerb::POST, ActivityVerb::SHARE);
+ $allowedVerbs = array(ActivityVerb::POST);
+
+ // Default behavior: always send repeats
+ if (empty($flink))
+ array_push($allowedVerbs, ActivityVerb::SHARE);
+ // Otherwise, check to see if repeats are allowed
+ else if (($flink->noticesync & FOREIGN_NOTICE_SEND_REPEAT) == FOREIGN_NOTICE_SEND_REPEAT)
+ array_push($allowedVerbs, ActivityVerb::SHARE);
// Don't send things that aren't posts or repeats (at least for now)
if (!in_array($notice->verb, $allowedVerbs)) {
From 86ce93b376af13ad3542d831da8053d671e68743 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 17:34:03 +0100
Subject: [PATCH 127/415] Notice->deleteRelated should be called from delete()
---
classes/Notice.php | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index ad589d786b..d7fb3cb966 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -165,6 +165,18 @@ class Notice extends Managed_DataObject
throw new AuthorizationException(_('You are not allowed to delete another user\'s notice.'));
}
+ $result = null;
+ if (!$delete_event || Event::handle('DeleteNoticeAsProfile', array($this, $actor, &$result))) {
+ // If $delete_event is true, we run the event. If the Event then
+ // returns false it is assumed everything was handled properly
+ // and the notice was deleted.
+ $result = $this->delete();
+ }
+ return $result;
+ }
+
+ protected function deleteRelated()
+ {
if (Event::handle('NoticeDeleteRelated', array($this))) {
// Clear related records
$this->clearReplies();
@@ -176,19 +188,12 @@ class Notice extends Managed_DataObject
$this->clearAttentions();
// NOTE: we don't clear queue items
}
-
- $result = null;
- if (!$delete_event || Event::handle('DeleteNoticeAsProfile', array($this, $actor, &$result))) {
- // If $delete_event is true, we run the event. If the Event then
- // returns false it is assumed everything was handled properly
- // and the notice was deleted.
- $result = $this->delete();
- }
- return $result;
}
public function delete($useWhere=false)
{
+ $this->deleteRelated();
+
$result = parent::delete($useWhere);
$this->blowOnDelete();
From 55544845db799231a907cf12def0d96cd42cde93 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 17:50:06 +0100
Subject: [PATCH 128/415] Just some comment clarification
---
plugins/ActivityModeration/ActivityModerationPlugin.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/ActivityModeration/ActivityModerationPlugin.php b/plugins/ActivityModeration/ActivityModerationPlugin.php
index 208a05449d..e89ae61d66 100644
--- a/plugins/ActivityModeration/ActivityModerationPlugin.php
+++ b/plugins/ActivityModeration/ActivityModerationPlugin.php
@@ -87,7 +87,8 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin
}
public function onDeleteNoticeAsProfile(Notice $stored, Profile $actor, &$result) {
- // By adding a new 'delete' verb we will eventually trigger $this->saveObjectFromActivity
+ // By adding a new object with the 'delete' verb we will trigger
+ // $this->saveObjectFromActivity that will do the actual ->delete()
if (false === Deleted_notice::addNew($stored, $actor)) {
// false is returned if we did not have an error, but did not create the object
// (i.e. the author is currently being deleted)
@@ -95,8 +96,8 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin
}
// We return false (to stop the event) if the deleted_notice entry was
- // added, which means we have run $this->saveObjectFromActivity which
- // in turn has called the delete function of the notice.
+ // added, which means we have already run $this->saveObjectFromActivity
+ // which in turn has called the delete function of the notice.
return false;
}
From 51840a66930cfbb9a11068475438f91d76021863 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 21 Mar 2016 18:07:29 +0100
Subject: [PATCH 129/415] doActionPost for delete should use deleteAs
---
plugins/ActivityModeration/ActivityModerationPlugin.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/ActivityModeration/ActivityModerationPlugin.php b/plugins/ActivityModeration/ActivityModerationPlugin.php
index e89ae61d66..ba53a13a8a 100644
--- a/plugins/ActivityModeration/ActivityModerationPlugin.php
+++ b/plugins/ActivityModeration/ActivityModerationPlugin.php
@@ -74,7 +74,7 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin
switch (true) {
case ActivityUtils::compareVerbs($verb, array(ActivityVerb::DELETE)):
// do whatever preparation is necessary to delete a verb
- $target->delete();
+ $target->deleteAs($scoped);
break;
default:
throw new ServerException('ActivityVerb POST not handled by plugin that was supposed to do it.');
From f3f619cc41f7e77e91f0c1b93cbec93425cb53e7 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 22 Mar 2016 00:03:22 +0100
Subject: [PATCH 130/415] entry attachment css
---
theme/base/css/display.css | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 19ff81407d..03cb4644ee 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -810,11 +810,14 @@ position:static;
}
.notice.h-entry .attachments {
- clear: both;
position: relative;
margin-bottom: 1em;
}
+.notice.h-entry .attachments > * {
+ clear: both;
+}
+
.notice.h-entry .attachments .inline-attachment > * {
height: auto;
max-width: 100%;
From 53c1750f0df75e7992339656a3f665b8ed29d61e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 22 Mar 2016 14:02:36 +0100
Subject: [PATCH 131/415] If the attachment is a photo, don't replace
representation in oEmbed
---
plugins/Oembed/OembedPlugin.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index 4497728c4c..56ce3cf098 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -238,6 +238,11 @@ class OembedPlugin extends Plugin
return true;
}
+ // Show thumbnail as usual if it's a photo.
+ if ($oembed->type === 'photo') {
+ return true;
+ }
+
$out->elementStart('article', ['class'=>'oembed-item']);
$out->elementStart('header');
try {
From dafe775ffaa4438cff38a930c7dba0d6348aa4bb Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 22 Mar 2016 22:31:01 +0100
Subject: [PATCH 132/415] Microsummaries had issues and were removed in Firefox
6.0 anyway
It is argued there are many better ways to get a "micro summary" of
a profile or site.
---
actions/microsummary.php | 82 ----------------------------------------
actions/showstream.php | 6 ---
lib/router.php | 2 +-
3 files changed, 1 insertion(+), 89 deletions(-)
delete mode 100644 actions/microsummary.php
diff --git a/actions/microsummary.php b/actions/microsummary.php
deleted file mode 100644
index 2742eb9a04..0000000000
--- a/actions/microsummary.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- * @author Robin Millette
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
- *
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
-
-/**
- * Microsummary action class.
- *
- * @category Action
- * @package StatusNet
- * @author Evan Prodromou
- * @author Robin Millette
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
- */
-class MicrosummaryAction extends Action
-{
- /**
- * Class handler.
- *
- * @param array $args array of arguments
- *
- * @return nothing
- */
- function handle($args)
- {
- parent::handle($args);
-
- $nickname = common_canonical_nickname($this->arg('nickname'));
- $user = User::getKV('nickname', $nickname);
-
- if (!$user) {
- // TRANS: Client error displayed trying to make a micro summary without providing a valid user.
- $this->clientError(_('No such user.'), 404);
- }
-
- $notice = $user->getCurrentNotice();
-
- if (!$notice) {
- // TRANS: Client error displayed trying to make a micro summary without providing a status.
- $this->clientError(_('No current status.'), 404);
- }
-
- header('Content-Type: text/plain');
-
- print $user->nickname . ': ' . $notice->content;
- }
-
- function isReadOnly($args)
- {
- return true;
- }
-}
diff --git a/actions/showstream.php b/actions/showstream.php
index dbe74197dc..ca901ce794 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -173,12 +173,6 @@ class ShowstreamAction extends NoticestreamAction
'content' => $this->target->getDescription()));
}
- // See https://wiki.mozilla.org/Microsummaries
-
- $this->element('link', array('rel' => 'microsummary',
- 'href' => common_local_url('microsummary',
- array('nickname' => $this->target->getNickname()))));
-
$rsd = common_local_url('rsd',
array('nickname' => $this->target->getNickname()));
diff --git a/lib/router.php b/lib/router.php
index f66d928bcd..dc6af1e863 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -832,7 +832,7 @@ class Router
foreach (array('subscriptions', 'subscribers',
'all', 'foaf', 'replies',
- 'microsummary') as $a) {
+ ) as $a) {
$m->connect($a,
array('action' => $a,
'nickname' => $nickname));
From 8933022edcf4851ac8feb08aca9de4a4fbabc1df Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 22 Mar 2016 22:37:59 +0100
Subject: [PATCH 133/415] Forgot a microsummary route in the latest commit
---
lib/router.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/router.php b/lib/router.php
index dc6af1e863..5a51f3d7d4 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -944,7 +944,7 @@ class Router
foreach (array('subscriptions', 'subscribers',
'nudge', 'all', 'foaf', 'replies',
- 'inbox', 'outbox', 'microsummary') as $a) {
+ 'inbox', 'outbox') as $a) {
$m->connect(':nickname/'.$a,
array('action' => $a),
array('nickname' => Nickname::DISPLAY_FMT));
From 250d99d997f6a34b90af943c5428eaffda3238cc Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 15:19:50 +0100
Subject: [PATCH 134/415] Allow actions to be performed on updateWithKeys
Avoids overloading and lets dataobject classes use onUpdateKeys()
to do special stuff, like if a key is made up of a hash of other fields etc.
---
classes/Managed_DataObject.php | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/classes/Managed_DataObject.php b/classes/Managed_DataObject.php
index 0857bb11f6..5b22672d7b 100644
--- a/classes/Managed_DataObject.php
+++ b/classes/Managed_DataObject.php
@@ -483,6 +483,8 @@ abstract class Managed_DataObject extends Memcached_DataObject
throw new ServerException('DataObject must be the result of a query (N>=1) before updateWithKeys()');
}
+ $this->onUpdateKeys($orig);
+
// do it in a transaction
$this->query('BEGIN');
@@ -580,6 +582,11 @@ abstract class Managed_DataObject extends Memcached_DataObject
// NOOP by default
}
+ protected function onUpdateKeys(Managed_DataObject $orig)
+ {
+ // NOOP by default
+ }
+
public function insert()
{
$this->onInsert();
From f83b81b8c476229e1488571b641fa314180d81aa Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 15:21:02 +0100
Subject: [PATCH 135/415] Change config webfinger/http_alias to fix/legacy_http
Set $config['fix']['legacy_http'] to perform some actions that are
needed if your site used to be served over http but now has upgraded
to https!
---
lib/default.php | 1 +
plugins/WebFinger/WebFingerPlugin.php | 7 -------
plugins/WebFinger/lib/webfingerresource.php | 2 +-
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/lib/default.php b/lib/default.php
index bf2d37d773..5c99d824dc 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -83,6 +83,7 @@ $default =
'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
'fix' =>
array('fancyurls' => true, // makes sure aliases in WebFinger etc. are not f'd by index.php/ URLs
+ 'legacy_http' => false, // set this to true if you have upgraded your site from http=>https
),
'syslog' =>
array('appname' => 'statusnet', # for syslog
diff --git a/plugins/WebFinger/WebFingerPlugin.php b/plugins/WebFinger/WebFingerPlugin.php
index d902947d93..5f686434f3 100644
--- a/plugins/WebFinger/WebFingerPlugin.php
+++ b/plugins/WebFinger/WebFingerPlugin.php
@@ -35,13 +35,6 @@ class WebFingerPlugin extends Plugin
const OAUTH_REQUEST_TOKEN_REL = 'http://apinamespace.org/oauth/request_token';
const OAUTH_AUTHORIZE_REL = 'http://apinamespace.org/oauth/authorize';
- public $http_alias = false;
-
- public function initialize()
- {
- common_config_set('webfinger', 'http_alias', $this->http_alias);
- }
-
public function onRouterInitialized($m)
{
$m->connect('.well-known/host-meta', array('action' => 'hostmeta'));
diff --git a/plugins/WebFinger/lib/webfingerresource.php b/plugins/WebFinger/lib/webfingerresource.php
index b7bace36d2..e4f14b13d5 100644
--- a/plugins/WebFinger/lib/webfingerresource.php
+++ b/plugins/WebFinger/lib/webfingerresource.php
@@ -37,7 +37,7 @@ abstract class WebFingerResource
// (because remote sites look for it) verify that they are still
// the same identity as they were on HTTP. Should NOT be used if
// you've run HTTPS all the time!
- if (common_config('webfinger', 'http_alias')) {
+ if (common_config('fix', 'legacy_http')) {
foreach ($aliases as $alias=>$id) {
if (!strtolower(parse_url($alias, PHP_URL_SCHEME)) === 'https') {
continue;
From 0767bf487e2bff3f071459e36e56802d5b07c416 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 15:22:34 +0100
Subject: [PATCH 136/415] Use the new onUpdateKeys in dataobject for tasks
on-update of keys
sets the hashkey column of the row to sha1(topic + '|' + callback)
---
plugins/OStatus/classes/HubSub.php | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php
index a2d6e2e51e..7b911d1d66 100644
--- a/plugins/OStatus/classes/HubSub.php
+++ b/plugins/OStatus/classes/HubSub.php
@@ -17,9 +17,7 @@
* along with this program. If not, see .
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* PuSH feed subscription record
@@ -202,16 +200,25 @@ class HubSub extends Managed_DataObject
}
}
- /**
- * Insert wrapper; transparently set the hash key from topic and callback columns.
- * @return mixed success
- */
- function insert()
+ // set the hashkey automagically on insert
+ protected function onInsert()
{
- $this->hashkey = self::hashkey($this->getTopic(), $this->callback);
+ $this->setHashkey();
$this->created = common_sql_now();
$this->modified = common_sql_now();
- return parent::insert();
+ }
+
+ // update the hashkey automagically if needed
+ protected function onUpdateKeys(Managed_DataObject $orig)
+ {
+ if ($this->topic !== $orig->topic || $this->callback !== $orig->callback) {
+ $this->setHashkey();
+ }
+ }
+
+ protected function setHashkey()
+ {
+ $this->hashkey = self::hashkey($this->topic, $this->callback);
}
/**
@@ -322,7 +329,7 @@ class HubSub extends Managed_DataObject
if ($response->isOk()) {
$orig = clone($this);
$this->callback = $httpscallback;
- $this->hashkey = self::hashkey($this->getTopic(), $this->callback);
+ // NOTE: hashkey will be set in $this->onUpdateKeys($orig) through updateWithKeys
$this->updateWithKeys($orig);
return true;
}
From 8c6d0759c7f10d87ab95b0a47a7ed96df49ade8d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 15:25:21 +0100
Subject: [PATCH 137/415] If upgraded from http to https, keep hubsub->topic up
to date too (thanks hannes2peer)
---
plugins/OStatus/lib/ostatusqueuehandler.php | 27 ++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php
index 2358176ec2..15e67d2077 100644
--- a/plugins/OStatus/lib/ostatusqueuehandler.php
+++ b/plugins/OStatus/lib/ostatusqueuehandler.php
@@ -183,11 +183,37 @@ class OStatusQueueHandler extends QueueHandler
*/
function pushFeed($feed, $callback)
{
+ // NOTE: external hub pings will not be fixed by
+ // our legacy_http thing!
$hub = common_config('ostatus', 'hub');
if ($hub) {
$this->pushFeedExternal($feed, $hub);
}
+ // If we used to be http but now are https, see if we find an http entry for this feed URL
+ // and then upgrade it. This self-healing feature needs to be enabled manually in config.
+ // This code is based on a patch by @hannes2peer@quitter.se
+ if (common_config('fix', 'legacy_http') && parse_url($feed, PHP_URL_SCHEME) === 'https') {
+ common_log(LOG_DEBUG, 'OSTATUS: Searching for http scheme instead for HubSub feed topic: '._ve($feed));
+ $http_feed = str_replace('https://', 'http://', $feed);
+ $sub = new HubSub();
+ $sub->topic = $http_feed;
+ // If we find it we upgrade the rows in the hubsub table.
+ if ($sub->find()) {
+ common_log(LOG_INFO, 'OSTATUS: Found topic with http scheme for '._ve($feed).', will update the rows to use https instead!');
+ // we found an http:// URL but we use https:// now
+ // so let's update the rows to reflect on this!
+ while ($sub->fetch()) {
+ common_debug('OSTATUS: Changing topic URL to https for feed callback '._ve($sub->callback));
+ $orig = clone($sub);
+ $sub->topic = $feed;
+ // hashkey column will be set automagically in HubSub->onUpdateKeys through updateWithKeys
+ $sub->updateWithKeys($orig);
+ unset($orig);
+ }
+ }
+ }
+
$sub = new HubSub();
$sub->topic = $feed;
if ($sub->find()) {
@@ -197,7 +223,6 @@ class OStatusQueueHandler extends QueueHandler
} else {
common_log(LOG_INFO, "No PuSH subscribers for $feed");
}
- return true;
}
/**
From e32f2b0a39042556d84dd3b12bff2dd226d8cfd2 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 17:51:13 +0100
Subject: [PATCH 138/415] Not really necessary in practice but makes better
queries
---
classes/Memcached_DataObject.php | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index 41ce715210..3de7c16d9b 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -67,10 +67,11 @@ class Memcached_DataObject extends Safe_DataObject
* @param string $cls Class to fetch
* @param string $keyCol name of column for key
* @param array $keyVals key values to fetch
+ * @param boolean $skipNulls skip provided null values
*
* @return array Array of objects, in order
*/
- static function multiGetClass($cls, $keyCol, array $keyVals)
+ static function multiGetClass($cls, $keyCol, array $keyVals, $skipNulls=true)
{
$obj = new $cls;
@@ -83,6 +84,14 @@ class Memcached_DataObject extends Safe_DataObject
throw new ServerException('Cannot do multiGet on anything but integer columns');
}
+ if ($skipNulls) {
+ foreach ($keyVals as $key=>$val) {
+ if (is_null($val)) {
+ unset($keyVals[$key]);
+ }
+ }
+ }
+
$obj->whereAddIn($keyCol, $keyVals, $colType);
// Since we're inputting straight to a query: format and escape
From 2759c3f0dba15957ad3d9307d5bc6f686bac9831 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 17:52:02 +0100
Subject: [PATCH 139/415] Debugging output in OStatus for easier
reading+greping
---
plugins/OStatus/OStatusPlugin.php | 4 ++--
plugins/OStatus/lib/ostatusqueuehandler.php | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 583ad8ef13..78ced64b5d 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -132,11 +132,11 @@ class OStatusPlugin extends Plugin
if ($notice->inScope(null) && $notice->getProfile()->hasRight(Right::PUBLICNOTICE)) {
// put our transport first, in case there's any conflict (like OMB)
array_unshift($transports, 'ostatus');
- $this->log(LOG_INFO, "Notice {$notice->id} queued for OStatus processing");
+ $this->log(LOG_INFO, "OSTATUS [{$notice->getID()}]: queued for OStatus processing");
} else {
// FIXME: we don't do privacy-controlled OStatus updates yet.
// once that happens, finer grain of control here.
- $this->log(LOG_NOTICE, "Not queueing notice {$notice->id} for OStatus because of privacy; scope = {$notice->scope}");
+ $this->log(LOG_NOTICE, "OSTATUS [{$notice->getID()}]: Not queueing because of privacy; scope = {$notice->scope}");
}
return true;
}
diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php
index 15e67d2077..ac56e142f4 100644
--- a/plugins/OStatus/lib/ostatusqueuehandler.php
+++ b/plugins/OStatus/lib/ostatusqueuehandler.php
@@ -194,17 +194,17 @@ class OStatusQueueHandler extends QueueHandler
// and then upgrade it. This self-healing feature needs to be enabled manually in config.
// This code is based on a patch by @hannes2peer@quitter.se
if (common_config('fix', 'legacy_http') && parse_url($feed, PHP_URL_SCHEME) === 'https') {
- common_log(LOG_DEBUG, 'OSTATUS: Searching for http scheme instead for HubSub feed topic: '._ve($feed));
+ common_log(LOG_DEBUG, "OSTATUS [{$this->notice->getID()}]: Searching for http scheme instead for HubSub feed topic: "._ve($feed));
$http_feed = str_replace('https://', 'http://', $feed);
$sub = new HubSub();
$sub->topic = $http_feed;
// If we find it we upgrade the rows in the hubsub table.
if ($sub->find()) {
- common_log(LOG_INFO, 'OSTATUS: Found topic with http scheme for '._ve($feed).', will update the rows to use https instead!');
+ common_log(LOG_INFO, "OSTATUS [{$this->notice->getID()}]: Found topic with http scheme for "._ve($feed).", will update the rows to use https instead!");
// we found an http:// URL but we use https:// now
// so let's update the rows to reflect on this!
while ($sub->fetch()) {
- common_debug('OSTATUS: Changing topic URL to https for feed callback '._ve($sub->callback));
+ common_debug("OSTATUS [{$this->notice->getID()}]: Changing topic URL to https for feed callback "._ve($sub->callback));
$orig = clone($sub);
$sub->topic = $feed;
// hashkey column will be set automagically in HubSub->onUpdateKeys through updateWithKeys
@@ -221,7 +221,7 @@ class OStatusQueueHandler extends QueueHandler
$atom = call_user_func_array($callback, $args);
$this->pushFeedInternal($atom, $sub);
} else {
- common_log(LOG_INFO, "No PuSH subscribers for $feed");
+ common_log(LOG_INFO, "OSTATUS [{$this->notice->getID()}]: No PuSH subscribers for $feed");
}
}
From 6b4c33106004caa287a906bd399f9430b6aa756b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Wed, 23 Mar 2016 17:53:38 +0100
Subject: [PATCH 140/415] Attachment and file handling since we could get NULL
instead of File
---
classes/Notice.php | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index d7fb3cb966..fe4cc80026 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1266,14 +1266,12 @@ class Notice extends Managed_DataObject
$ids[] = $f2p->file_id;
}
- $files = File::multiGet('id', $ids);
- $this->_attachments[$this->id] = $files->fetchAll();
- return $this->_attachments[$this->id];
+ return $this->_setAttachments(File::multiGet('id', $ids)->fetchAll());
}
- function _setAttachments($attachments)
+ public function _setAttachments(array $attachments)
{
- $this->_attachments[$this->id] = $attachments;
+ return $this->_attachments[$this->id] = $attachments;
}
static function publicStream($offset=0, $limit=20, $since_id=null, $max_id=null)
@@ -3024,6 +3022,19 @@ class Notice extends Managed_DataObject
$files = array();
$f2ps = $f2pMap[$notice->id];
foreach ($f2ps as $f2p) {
+ if (!isset($fileMap[$f2p->file_id])) {
+ // We have probably deleted value from fileMap since
+ // it as a NULL entry (see the following elseif).
+ continue;
+ } elseif (is_null($fileMap[$f2p->file_id])) {
+ // If the file id lookup returned a NULL value, it doesn't
+ // exist in our file table! So this is a remnant file_to_post
+ // entry that is no longer valid and should be removed.
+ common_debug('ATTACHMENT deleting f2p for post_id='.$f2p->post_id.' file_id='.$f2p->file_id);
+ $f2p->delete();
+ unset($fileMap[$f2p->file_id]);
+ continue;
+ }
$files[] = $fileMap[$f2p->file_id];
}
$notice->_setAttachments($files);
From f522c0843869bd49298e2de034dc79db9a733d5c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 24 Mar 2016 01:41:58 +0100
Subject: [PATCH 141/415] Stricter typing in Realtime plugin functions
---
plugins/Realtime/RealtimePlugin.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php
index 172e9272af..8b7767ac15 100644
--- a/plugins/Realtime/RealtimePlugin.php
+++ b/plugins/Realtime/RealtimePlugin.php
@@ -311,7 +311,7 @@ class RealtimePlugin extends Plugin
return false; // No default processing
}
- function noticeAsJson($notice)
+ function noticeAsJson(Notice $notice)
{
// FIXME: this code should be abstracted to a neutral third
// party, like Notice::asJson(). I'm not sure of the ethics
@@ -347,7 +347,7 @@ class RealtimePlugin extends Plugin
return $arr;
}
- function getNoticeTags($notice)
+ function getNoticeTags(Notice $notice)
{
$tags = null;
From 49a91885c925905c02a32997dbb3a02e7099c55c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 24 Mar 2016 01:54:33 +0100
Subject: [PATCH 142/415] Strictify Notice->isPublic()
---
classes/Notice.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index fe4cc80026..dceaf50b0d 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -2749,10 +2749,10 @@ class Notice extends Managed_DataObject
}
}
- function isPublic()
+ public function isPublic()
{
- return (($this->is_local != Notice::LOCAL_NONPUBLIC) &&
- ($this->is_local != Notice::GATEWAY));
+ $is_local = intval($this->is_local);
+ return !($is_local === Notice::LOCAL_NONPUBLIC || $is_local === Notice::GATEWAY);
}
/**
From be22886be87f34d7430c6aed5931aa343214ed71 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 24 Mar 2016 02:00:16 +0100
Subject: [PATCH 143/415] Catch some exceptions in Linkback
---
plugins/Linkback/LinkbackPlugin.php | 55 ++++++++++++++++-------------
1 file changed, 30 insertions(+), 25 deletions(-)
diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php
index 06c49b0809..5aeb4dc8f2 100644
--- a/plugins/Linkback/LinkbackPlugin.php
+++ b/plugins/Linkback/LinkbackPlugin.php
@@ -59,41 +59,46 @@ class LinkbackPlugin extends Plugin
parent::__construct();
}
- function onHandleQueuedNotice($notice)
+ function onHandleQueuedNotice(Notice $notice)
{
- if (intval($notice->is_local) === Notice::LOCAL_PUBLIC) {
- // Try to avoid actually mucking with the
- // notice content
- $c = $notice->content;
- $this->notice = $notice;
+ if (!$notice->isLocal() || !$notice->isPublic()) {
+ return true;
+ }
- if(!$notice->getProfile()->
- getPref("linkbackplugin", "disable_linkbacks")
- ) {
- // Ignoring results
- common_replace_urls_callback($c,
- array($this, 'linkbackUrl'));
- }
+ // Try to avoid actually mucking with the
+ // notice content
+ $c = $notice->content;
+ $this->notice = $notice;
- if($notice->isRepeat()) {
+ if (!$notice->getProfile()->getPref('linkbackplugin', 'disable_linkbacks')) {
+ // Ignoring results
+ common_replace_urls_callback($c, array($this, 'linkbackUrl'));
+ }
+
+ try {
+ if ($notice->isRepeat()) {
$repeat = Notice::getByID($notice->repeat_of);
$this->linkbackUrl($repeat->getUrl());
- } else if(!empty($notice->reply_to)) {
- try {
- $parent = $notice->getParent();
- $this->linkbackUrl($parent->getUrl());
- } catch (NoParentNoticeException $e) {
- // can't link back to what we don't know (apparently parent notice disappeared from our db)
- return true;
- }
+ } elseif (!empty($notice->reply_to)) {
+ $parent = $notice->getParent();
+ $this->linkbackUrl($parent->getUrl());
}
+ } catch (InvalidUrlException $e) {
+ // can't send linkback to notice if we don't have a remote HTTP(S) URL
+ // but we can still ping the attention-receivers below
+ } catch (NoParentNoticeException $e) {
+ // can't send linkback to non-existing parent URL
+ return true;
+ }
- // doubling up getReplies and getAttentionProfileIDs because we're not entirely migrated yet
- $replyProfiles = Profile::multiGet('id', array_unique(array_merge($notice->getReplies(), $notice->getAttentionProfileIDs())));
- foreach($replyProfiles->fetchAll('profileurl') as $profileurl) {
+ // doubling up getReplies and getAttentionProfileIDs because we're not entirely migrated yet
+ $replyProfiles = Profile::multiGet('id', array_unique(array_merge($notice->getReplies(), $notice->getAttentionProfileIDs())));
+ foreach ($replyProfiles->fetchAll('profileurl') as $profileurl) {
+ if (common_valid_http_url($profileurl)) {
$this->linkbackUrl($profileurl);
}
}
+
return true;
}
From 9fa18fa3669c6d15109b239f92f4166e4f1365f0 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 24 Mar 2016 02:44:11 +0100
Subject: [PATCH 144/415] HTTPClient::quickGet now supports headers as argument
They should be in a numeric array, already formatted as headers,
ready to go. (Header-Name: Content of the header)
---
lib/httpclient.php | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/lib/httpclient.php b/lib/httpclient.php
index ae2c7b0672..1e399bd83e 100644
--- a/lib/httpclient.php
+++ b/lib/httpclient.php
@@ -38,7 +38,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
*
* This extends the HTTP_Request2_Response class with methods to get info
* about any followed redirects.
- *
+ *
* Originally used the name 'HTTPResponse' to match earlier code, but
* this conflicts with a class in in the PECL HTTP extension.
*
@@ -119,7 +119,7 @@ class HTTPClient extends HTTP_Request2
$this->config['connect_timeout'] = common_config('http', 'connect_timeout') ?: $this->config['connect_timeout'];
$this->config['max_redirs'] = 10;
$this->config['follow_redirects'] = true;
-
+
// We've had some issues with keepalive breaking with
// HEAD requests, such as to youtube which seems to be
// emitting chunked encoding info for an empty body
@@ -151,7 +151,7 @@ class HTTPClient extends HTTP_Request2
foreach (array('host', 'port', 'user', 'password', 'auth_scheme') as $cf) {
$k = 'proxy_'.$cf;
- $v = common_config('http', $k);
+ $v = common_config('http', $k);
if (!empty($v)) {
$this->config[$k] = $v;
}
@@ -173,7 +173,7 @@ class HTTPClient extends HTTP_Request2
/**
* Quick static function to GET a URL
*/
- public static function quickGet($url, $accept=null, $params=array())
+ public static function quickGet($url, $accept=null, array $params=array(), array $headers=array())
{
if (!empty($params)) {
$params = http_build_query($params, null, '&');
@@ -188,7 +188,7 @@ class HTTPClient extends HTTP_Request2
if (!is_null($accept)) {
$client->setHeader('Accept', $accept);
}
- $response = $client->get($url);
+ $response = $client->get($url, $headers);
if (!$response->isOk()) {
// TRANS: Exception. %s is the URL we tried to GET.
throw new Exception(sprintf(_m('Could not GET URL %s.'), $url), $response->getStatus());
@@ -262,10 +262,16 @@ class HTTPClient extends HTTP_Request2
}
/**
+ * @param string $url The URL including possible querystring
+ * @param string $method The HTTP method to use
+ * @param array $headers List of already formatted strings
+ * (not an associative array, to allow
+ * multiple same-named headers)
+ *
* @return GNUsocial_HTTPResponse
* @throws HTTP_Request2_Exception
*/
- protected function doRequest($url, $method, $headers)
+ protected function doRequest($url, $method, array $headers=array())
{
$this->setUrl($url);
@@ -278,10 +284,8 @@ class HTTPClient extends HTTP_Request2
}
$this->setMethod($method);
- if ($headers) {
- foreach ($headers as $header) {
- $this->setHeader($header);
- }
+ foreach ($headers as $header) {
+ $this->setHeader($header);
}
$response = $this->send();
if (is_null($response)) {
@@ -290,7 +294,7 @@ class HTTPClient extends HTTP_Request2
}
return $response;
}
-
+
protected function log($level, $detail) {
$method = $this->getMethod();
$url = $this->getUrl();
@@ -334,8 +338,8 @@ class HTTPClient extends HTTP_Request2
throw $e;
}
$code = $response->getStatus();
- $effectiveUrl = $response->getEffectiveUrl();
- $redirUrls[] = $effectiveUrl;
+ $effectiveUrl = $response->getEffectiveUrl();
+ $redirUrls[] = $effectiveUrl;
$response->redirUrls = $redirUrls;
if ($code >= 200 && $code < 300) {
$reason = $response->getReasonPhrase();
@@ -343,7 +347,7 @@ class HTTPClient extends HTTP_Request2
} elseif ($code >= 300 && $code < 400) {
$url = $this->getUrl();
$target = $response->getHeader('Location');
-
+
if (++$redirs >= $maxRedirs) {
common_log(LOG_ERR, __CLASS__ . ": Too many redirects: skipping $code redirect from $url to $target");
break;
From 4d382a59d0da0b60c402ceb7b56c0207c1041bf2 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Thu, 24 Mar 2016 03:01:18 +0100
Subject: [PATCH 145/415] Use HTTPClient instead of Yadis HTTPFetcher in
Linkback plugin
---
plugins/Linkback/LinkbackPlugin.php | 92 ++++++++++++++---------------
1 file changed, 45 insertions(+), 47 deletions(-)
diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php
index 5aeb4dc8f2..701ca06fc5 100644
--- a/plugins/Linkback/LinkbackPlugin.php
+++ b/plugins/Linkback/LinkbackPlugin.php
@@ -31,7 +31,6 @@ if (!defined('STATUSNET')) {
exit(1);
}
-require_once('Auth/Yadis/Yadis.php');
require_once(__DIR__ . '/lib/util.php');
define('LINKBACKPLUGIN_VERSION', '0.1');
@@ -114,34 +113,36 @@ class LinkbackPlugin extends Plugin
}
// XXX: Do a HEAD first to save some time/bandwidth
+ try {
+ $httpclient = new HTTPClient();
+ $response = $httpclient->get($url, ["User-Agent: {$this->userAgent()}",
+ "Accept: application/html+xml,text/html"]);
- $fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
-
- $result = $fetcher->get($url,
- array('User-Agent: ' . $this->userAgent(),
- 'Accept: application/html+xml,text/html'));
-
- if (!in_array($result->status, array('200', '206'))) {
+ if (!in_array($response->getStatus(), array(200, 206))) {
+ throw new Exception('Invalid response code for GET request');
+ }
+ } catch (Exception $e) {
+ // something didn't work out in our GET request
return $orig;
}
// XXX: Should handle relative-URI resolution in these detections
- $wm = $this->getWebmention($result);
+ $wm = $this->getWebmention($response);
if(!empty($wm)) {
// It is the webmention receiver's job to resolve source
// Ref: https://github.com/converspace/webmention/issues/43
$this->webmention($url, $wm);
} else {
- $pb = $this->getPingback($result);
+ $pb = $this->getPingback($response);
if (!empty($pb)) {
// Pingback still looks for exact URL in our source, so we
// must send what we have
$this->pingback($url, $pb);
} else {
- $tb = $this->getTrackback($result);
+ $tb = $this->getTrackback($response);
if (!empty($tb)) {
- $this->trackback($result->final_url, $tb);
+ $this->trackback($response->getEffectiveUrl(), $tb);
}
}
}
@@ -151,22 +152,23 @@ class LinkbackPlugin extends Plugin
// Based on https://github.com/indieweb/mention-client-php
// which is licensed Apache 2.0
- function getWebmention($result) {
- if (isset($result->headers['Link'])) {
- // XXX: the fetcher only gives back one of each header, so this may fail on multiple Link headers
- if(preg_match('~<((?:https?://)?[^>]+)>; rel="webmention"~', $result->headers['Link'], $match)) {
+ function getWebmention(HTTP_Request2_Response $response) {
+ $link = $response->getHeader('Link');
+ if (!is_null($link)) {
+ // XXX: the fetcher gives back a comma-separated string of all Link headers, I hope the parsing works reliably
+ if (preg_match('~<((?:https?://)?[^>]+)>; rel="webmention"~', $link, $match)) {
return $match[1];
- } elseif(preg_match('~<((?:https?://)?[^>]+)>; rel="http://webmention.org/?"~', $result->headers['Link'], $match)) {
+ } elseif (preg_match('~<((?:https?://)?[^>]+)>; rel="http://webmention.org/?"~', $link, $match)) {
return $match[1];
}
}
// FIXME: Do proper DOM traversal
- if(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?webmention ?[^" ]*"[ ]*\/?>/i', $result->body, $match)
- || preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?webmention ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $result->body, $match)) {
+ if(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?webmention ?[^" ]*"[ ]*\/?>/i', $response->getBody(), $match)
+ || preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?webmention ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $response->getBody(), $match)) {
return $match[1];
- } elseif(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="http:\/\/webmention\.org\/?"[ ]*\/?>/i', $result->body, $match)
- || preg_match('/<(?:link|a)[ ]+rel="http:\/\/webmention\.org\/?"[ ]+href="([^"]+)"[ ]*\/?>/i', $result->body, $match)) {
+ } elseif (preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="http:\/\/webmention\.org\/?"[ ]*\/?>/i', $response->getBody(), $match)
+ || preg_match('/<(?:link|a)[ ]+rel="http:\/\/webmention\.org\/?"[ ]+href="([^"]+)"[ ]*\/?>/i', $response->getBody(), $match)) {
return $match[1];
}
}
@@ -198,11 +200,11 @@ class LinkbackPlugin extends Plugin
}
}
- function getPingback($result) {
- if (array_key_exists('X-Pingback', $result->headers)) {
- return $result->headers['X-Pingback'];
- } else if(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]*\/?>/i', $result->body, $match)
- || preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $result->body, $match)) {
+ function getPingback(HTTP_Request2_Response $response) {
+ if ($response->getHeader('X-Pingback')) {
+ return $response->getHeader('X-Pingback');
+ } elseif (preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]*\/?>/i', $response->getBody(), $match)
+ || preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $response->getBody(), $match)) {
return $match[1];
}
}
@@ -242,10 +244,10 @@ class LinkbackPlugin extends Plugin
// Largely cadged from trackback_cls.php by
// Ran Aroussi , GPL2 or any later version
// http://phptrackback.sourceforge.net/
- function getTrackback($result)
+ function getTrackback(HTTP_Request2_Response $response)
{
- $text = $result->body;
- $url = $result->final_url;
+ $text = $response->getBody();
+ $url = $response->getEffectiveUrl();
if (preg_match_all('/()/sm', $text, $match, PREG_SET_ORDER)) {
for ($i = 0; $i < count($match); $i++) {
@@ -296,26 +298,22 @@ class LinkbackPlugin extends Plugin
// TRANS: Trackback title.
// TRANS: %1$s is a profile nickname, %2$s is a timestamp.
$args = array('title' => sprintf(_m('%1$s\'s status on %2$s'),
- $profile->nickname,
- common_exact_date($this->notice->created)),
- 'excerpt' => $this->notice->content,
+ $profile->getNickname(),
+ common_exact_date($this->notice->getCreated())),
+ 'excerpt' => $this->notice->getContent(),
'url' => $this->notice->getUrl(),
- 'blog_name' => $profile->nickname);
+ 'blog_name' => $profile->getNickname());
- $fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
-
- $result = $fetcher->post($endpoint,
- http_build_query($args),
- array('User-Agent: ' . $this->userAgent()));
-
- if ($result->status != '200') {
- common_log(LOG_WARNING,
- "Trackback error for '$url' ($endpoint): ".
- "$result->body");
- } else {
- common_log(LOG_INFO,
- "Trackback success for '$url' ($endpoint): ".
- "'$result->body'");
+ try {
+ $httpclient = new HTTPClient(null, HTTPClient::METHOD_POST);
+ $response = $httpclient->post($endpoint, ["User-Agent: {$this->userAgent()}"], $args);
+ if ($response->getStatus() === 200) {
+ common_log(LOG_INFO, "Trackback success for '$url' ($endpoint): "._ve($response->getBody()));
+ } else {
+ common_log(LOG_WARNING, "Trackback error for '$url' ($endpoint): "._ve($response->getBody()));
+ }
+ } catch (Exception $e) {
+ common_log(LOG_INFO, "Trackback error for '$url' ($endpoint): "._ve($e->getMessage()));
}
}
From 4790db348d3c377d5e5247b34204257025f7f690 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 14:00:05 +0200
Subject: [PATCH 146/415] FetchRemoteNotice event call in Notice (not effective
yet)
---
classes/Notice.php | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/classes/Notice.php b/classes/Notice.php
index dceaf50b0d..256eb61663 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -839,7 +839,7 @@ class Notice extends Managed_DataObject
}
}
- $stored->profile_id = $actor->id;
+ $stored->profile_id = $actor->getID();
$stored->source = $source;
$stored->uri = $uri;
$stored->url = $url;
@@ -857,6 +857,7 @@ class Notice extends Managed_DataObject
// TRANS: Error message when the plain text content of a notice has zero length.
throw new ClientException(_('Empty notice content, will not save this.'));
}
+ unset($content); // garbage collect
// Maybe a missing act-time should be fatal if the actor is not local?
if (!empty($act->time)) {
@@ -865,13 +866,31 @@ class Notice extends Managed_DataObject
$stored->created = common_sql_now();
}
- $reply = null;
+ $reply = null; // this will store the in-reply-to Notice if found
+ $replyUris = []; // this keeps a list of possible URIs to look up
if ($act->context instanceof ActivityContext && !empty($act->context->replyToID)) {
- $reply = self::getKV('uri', $act->context->replyToID);
+ $replyUris[] = $act->context->replyToID;
}
- if (!$reply instanceof Notice && $act->target instanceof ActivityObject) {
- $reply = self::getKV('uri', $act->target->id);
+ if ($act->target instanceof ActivityObject && !empty($act->target->id)) {
+ $replyUris[] = $act->target->id;
}
+ foreach (array_unique($replyUris) as $replyUri) {
+ $reply = self::getKV('uri', $replyUri);
+ // Only do remote fetching if we're not a private site
+ if (!common_config('site', 'private') && !$reply instanceof Notice) {
+ // the URI is the object we're looking for, $actor is a
+ // Profile that surely knows of it and &$reply where it
+ // will be stored when fetched
+ Event::handle('FetchRemoteNotice', array($replyUri, $actor, &$reply));
+ }
+ // we got what we're in-reply-to now, so let's move on
+ if ($reply instanceof Notice) {
+ break;
+ }
+ // otherwise reset whatever we might've gotten from the event
+ $reply = null;
+ }
+ unset($replyUris); // garbage collect
if ($reply instanceof Notice) {
if (!$reply->inScope($actor)) {
@@ -915,6 +934,7 @@ class Notice extends Managed_DataObject
unset($conv);
}
}
+ unset($reply); // garbage collect
// If it's not part of a conversation, it's the beginning of a new conversation.
if (empty($stored->conversation)) {
@@ -985,6 +1005,7 @@ class Notice extends Managed_DataObject
if (empty($object)) {
throw new NoticeSaveException('Unsuccessful call to StoreActivityObject '._ve($stored->getUri()) . ': '._ve($act->asString()));
}
+ unset($object);
// If something changed in the Notice during StoreActivityObject
$stored->update($orig);
@@ -998,6 +1019,8 @@ class Notice extends Managed_DataObject
throw $e;
}
}
+ unset($notloc); // garbage collect
+
if (!$stored instanceof Notice) {
throw new ServerException('StartNoticeSave did not give back a Notice.');
} elseif (empty($stored->id)) {
From 7be46410409d7c30b0a3bd5eb6d9492298726c92 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 14:54:14 +0200
Subject: [PATCH 147/415] Actually return an Ostatus_profile
---
plugins/OStatus/classes/Ostatus_profile.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 2b1ab8ddd9..5673d51457 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -80,12 +80,13 @@ class Ostatus_profile extends Managed_DataObject
return $this->uri;
}
- public function fromProfile(Profile $profile)
+ static function fromProfile(Profile $profile)
{
- $oprofile = Ostatus_profile::getKV('profile_id', $profile->id);
+ $oprofile = Ostatus_profile::getKV('profile_id', $profile->getID());
if (!$oprofile instanceof Ostatus_profile) {
- throw new Exception('No Ostatus_profile for Profile ID: '.$profile->id);
+ throw new Exception('No Ostatus_profile for Profile ID: '.$profile->getID());
}
+ return $oprofile;
}
/**
From 2d0153195e59facc8890f50b0547528bf021b161 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 14:56:27 +0200
Subject: [PATCH 148/415] Output proper remote info on WebFinger notice
resources
---
plugins/OStatus/OStatusPlugin.php | 21 +++++++++++++++----
.../lib/webfingerresource/notice.php | 14 +++++++++++--
2 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 78ced64b5d..72f246d68f 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -1307,10 +1307,23 @@ class OStatusPlugin extends Plugin
function onEndWebFingerNoticeLinks(XML_XRD $xrd, Notice $target)
{
- $author = $target->getProfile();
- $profiletype = $this->profileTypeString($author);
- $salmon_url = common_local_url("{$profiletype}salmon", array('id' => $author->id));
- $xrd->links[] = new XML_XRD_Element_Link(Salmon::REL_SALMON, $salmon_url);
+ $salmon_url = null;
+ $actor = $target->getProfile();
+ if ($actor->isLocal()) {
+ $profiletype = $this->profileTypeString($actor);
+ $salmon_url = common_local_url("{$profiletype}salmon", array('id' => $actor->getID()));
+ } else {
+ try {
+ $oprofile = Ostatus_profile::fromProfile($actor);
+ $salmon_url = $oprofile->salmonuri;
+ } catch (Exception $e) {
+ // Even though it's not a local user, we couldn't get an Ostatus_profile?!
+ }
+ }
+ // Ostatus_profile salmon URL may be empty
+ if (!empty($salmon_url)) {
+ $xrd->links[] = new XML_XRD_Element_Link(Salmon::REL_SALMON, $salmon_url);
+ }
return true;
}
diff --git a/plugins/WebFinger/lib/webfingerresource/notice.php b/plugins/WebFinger/lib/webfingerresource/notice.php
index b967bd9e1c..295a856f36 100644
--- a/plugins/WebFinger/lib/webfingerresource/notice.php
+++ b/plugins/WebFinger/lib/webfingerresource/notice.php
@@ -20,17 +20,27 @@ class WebFingerResource_Notice extends WebFingerResource
public function updateXRD(XML_XRD $xrd)
{
if (Event::handle('StartWebFingerNoticeLinks', array($xrd, $this->object))) {
- $xrd->links[] = new XML_XRD_Element_Link('alternate',
+ if ($this->object->isLocal()) {
+ $xrd->links[] = new XML_XRD_Element_Link('alternate',
common_local_url('ApiStatusesShow',
array('id'=>$this->object->id,
'format'=>'atom')),
'application/atom+xml');
- $xrd->links[] = new XML_XRD_Element_Link('alternate',
+ $xrd->links[] = new XML_XRD_Element_Link('alternate',
common_local_url('ApiStatusesShow',
array('id'=>$this->object->id,
'format'=>'json')),
'application/json');
+ } else {
+ try {
+ $xrd->links[] = new XML_XRD_Element_Link('alternate',
+ $this->object->getUrl(),
+ 'text/html');
+ } catch (InvalidUrlException $e) {
+ // don't do a fallback in webfinger
+ }
+ }
Event::handle('EndWebFingerNoticeLinks', array($xrd, $this->object));
}
}
From 97d177f42ab1e02eebb0d2ea436f09438ffc1128 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 15:01:08 +0200
Subject: [PATCH 149/415] Matching inherited function definition
---
actions/selftag.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/actions/selftag.php b/actions/selftag.php
index b886c3d9f7..2df1a29253 100644
--- a/actions/selftag.php
+++ b/actions/selftag.php
@@ -158,9 +158,9 @@ class SelftagAction extends Action
class SelfTagProfileList extends ProfileList
{
- function newListItem($profile)
+ function newListItem(Profile $target)
{
- return new SelfTagProfileListItem($profile, $this->action);
+ return new SelfTagProfileListItem($target, $this->action);
}
}
From 327b8c863e84387ee9dde7bc497defd64ad3e9fe Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 15:01:44 +0200
Subject: [PATCH 150/415] Initial (not yet working) fetch remote plugin
---
plugins/FetchRemote/FetchRemotePlugin.php | 119 ++++++++++++++++++++++
1 file changed, 119 insertions(+)
create mode 100644 plugins/FetchRemote/FetchRemotePlugin.php
diff --git a/plugins/FetchRemote/FetchRemotePlugin.php b/plugins/FetchRemote/FetchRemotePlugin.php
new file mode 100644
index 0000000000..40d7550c58
--- /dev/null
+++ b/plugins/FetchRemote/FetchRemotePlugin.php
@@ -0,0 +1,119 @@
+.
+ */
+
+/**
+ * Uses WebFinger to implement remote notice retrieval for GNU social.
+ *
+ * Depends on: WebFinger plugin
+ *
+ * @package GNUsocial
+ * @author Mikael Nordfeldth
+ */
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+class FetchRemotePlugin extends Plugin
+{
+ static function fetchNoticeFromUrl($url)
+ {
+ if (!common_valid_http_url($url)) {
+ throw new InvalidUrlException($url);
+ }
+ $host = parse_url($url, PHP_URL_HOST);
+
+ // TODO: try to fetch directly, either by requesting Atom or
+ // Link headers/ elements with rel=alternate and compare
+ // the remote domain name with the notice URL's.
+
+ if (!$stored instanceof Notice) {
+ common_log(LOG_INFO, 'Could not fetch remote notice from URL: '._ve($url));
+ throw new ServerException('Could not fetch remote notice.');
+ }
+ return $stored;
+ }
+
+ public function onFetchRemoteNoticeWithSource($uri, Profile $source, &$stored)
+ {
+ if (common_valid_http_url($uri) && !Event::handle('FetchRemoteNoticeFromUrl', array($url, &$stored))) {
+ // Woopi, we got it straight from a URL-formatted URI!
+ return false;
+ }
+
+ // Let's assume we can only do this over HTTPS and a proper
+ // WebFinger (RFC7033) endpoint on /.well-known/webfinger
+ try {
+ $source_url = parse_url($source->getUrl());
+ } catch (InvalidUrlException $e) {
+ return true;
+ }
+ if ($source_url['scheme'] !== 'https') {
+ common_debug('Will not try to fetch remote notice from non-HTTPS capable profile source');
+ return true;
+ }
+
+ try {
+ $port = isset($source_url['port']) ? ":{$source_url['port']}" : '';
+ $rfc7033 = "https://{$source_url['host']}{$port}/.well-known/webfinger";
+ $params = ['resource' => $uri];
+ common_debug(__METHOD__ . ": getting json data about notice from: {$rfc7033}?resource=$uri");
+ $json = HTTPClient::quickGetJson($rfc7033, $params);
+ } catch (Exception $e) {
+ // NOPE NOPE NOPE NOPE
+ // couldn't get remote data about this notice's URI
+ // FIXME: try later?
+ return true;
+ }
+
+ if (!isset($json->aliases)) {
+ // FIXME: malformed json for our current use, but maybe we could find rel="alternate" type="text/html"?
+ return true;
+ }
+
+ common_debug(__METHOD__ . ": Found these aliases: "._ve($json->aliases));
+ foreach ($json->aliases as $alias) {
+ try {
+ $stored = self::fetchNoticeFromUrl($url);
+ if ($stored instanceof Notice) {
+ // we're done here! all good, let's get back to business
+ return false;
+ }
+ } catch (InvalidUrlException $e) {
+ /// mmmmye, aliases might not always be HTTP(S) URLs.
+ } catch (Exception $e) {
+ // oh well, try the next one and see if it works better.
+ common_debug(__METHOD__ . ": {$e->getMessage()}");
+ }
+ }
+
+ // Nothing found, return true to continue processing the event
+ return true;
+ }
+
+ public function onPluginVersion(array &$versions)
+ {
+ $versions[] = array('name' => 'FetchRemote',
+ 'version' => GNUSOCIAL_VERSION,
+ 'author' => 'Mikael Nordfeldth',
+ 'homepage' => 'http://www.gnu.org/software/social/',
+ // TRANS: Plugin description.
+ 'rawdescription' => _m('Retrieves remote notices (and serves local) via WebFinger'));
+
+ return true;
+ }
+}
From 97f7e6632d895fa30afd03d75b505c44fa9bb505 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 16:21:43 +0200
Subject: [PATCH 151/415] Embed attachments marked up as microformats2 (I think
rather properly)
---
plugins/Oembed/OembedPlugin.php | 14 +++++++-------
plugins/Oembed/css/oembed.css | 9 +++++----
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php
index 56ce3cf098..6950fb0a9a 100644
--- a/plugins/Oembed/OembedPlugin.php
+++ b/plugins/Oembed/OembedPlugin.php
@@ -243,24 +243,24 @@ class OembedPlugin extends Plugin
return true;
}
- $out->elementStart('article', ['class'=>'oembed-item']);
+ $out->elementStart('article', ['class'=>'h-entry oembed']);
$out->elementStart('header');
try {
$thumb = $file->getThumbnail(128, 128);
- $out->element('img', $thumb->getHtmlAttrs(['class'=>'oembed-thumb']));
+ $out->element('img', $thumb->getHtmlAttrs(['class'=>'u-photo oembed']));
unset($thumb);
} catch (Exception $e) {
$out->element('div', ['class'=>'error'], $e->getMessage());
}
- $out->elementStart('h5', ['class'=>'oembed-title']);
- $out->element('a', ['href'=>$file->getUrl()], common_strip_html($oembed->title));
+ $out->elementStart('h5', ['class'=>'p-name oembed']);
+ $out->element('a', ['class'=>'u-url', 'href'=>$file->getUrl()], common_strip_html($oembed->title));
$out->elementEnd('h5');
- $out->elementStart('div', ['class'=>'oembed-source']);
+ $out->elementStart('div', ['class'=>'p-author oembed']);
if (!empty($oembed->author_name)) {
// TRANS: text before the author name of oEmbed attachment representation
// FIXME: The whole "By x from y" should be i18n because of different language constructions.
$out->text(_('By '));
- $attrs = ['class'=>'h-card'];
+ $attrs = ['class'=>'h-card p-author'];
if (!empty($oembed->author_url)) {
$attrs['href'] = $oembed->author_url;
$tag = 'a';
@@ -284,7 +284,7 @@ class OembedPlugin extends Plugin
}
$out->elementEnd('div');
$out->elementEnd('header');
- $out->elementStart('div', ['class'=>'oembed-html']);
+ $out->elementStart('div', ['class'=>'p-summary oembed']);
$out->raw(common_purify($oembed->html));
$out->elementEnd('div');
$out->elementStart('footer');
diff --git a/plugins/Oembed/css/oembed.css b/plugins/Oembed/css/oembed.css
index ad7b3fb9b0..68227e5dab 100644
--- a/plugins/Oembed/css/oembed.css
+++ b/plugins/Oembed/css/oembed.css
@@ -1,15 +1,16 @@
-.oembed-thumb {
+.u-photo.oembed {
float: left;
margin-bottom: 1ex;
margin-right: 1em;
padding-bottom: 1ex;
}
-.oembed-source {
+.p-author.oembed {
font-style: italic;
}
-.oembed-html {
- max-height: 100px;
+.p-summary.oembed {
+ line-height: 1.25em;
+ max-height: 5em;
overflow: auto;
}
From f134a423f6a9e7bb61d069c4d6281c05417bbd45 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Sun, 27 Mar 2016 16:36:45 +0200
Subject: [PATCH 152/415] rename config option site/logdebug to log/debugtrace
---
index.php | 4 ++--
lib/default.php | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/index.php b/index.php
index eef894effc..d96f2396e4 100644
--- a/index.php
+++ b/index.php
@@ -94,7 +94,7 @@ function handleError($error)
}
$logmsg = "Exception thrown: " . _ve($error->getMessage());
- if ($error instanceof PEAR_Exception && common_config('site', 'logdebug')) {
+ if ($error instanceof PEAR_Exception && common_config('log', 'debugtrace')) {
$logmsg .= " PEAR: ". $error->toText();
}
// DB queries often end up with a lot of newlines; merge to a single line
@@ -103,7 +103,7 @@ function handleError($error)
common_log(LOG_ERR, $logmsg);
// @fixme backtrace output should be consistent with exception handling
- if (common_config('site', 'logdebug')) {
+ if (common_config('log', 'debugtrace')) {
$bt = $error->getTrace();
foreach ($bt as $n => $line) {
common_log(LOG_ERR, formatBacktraceLine($n, $line));
diff --git a/lib/default.php b/lib/default.php
index 5c99d824dc..12e194f549 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -38,7 +38,6 @@ $default =
'logfile' => null,
'logo' => null,
'ssllogo' => null,
- 'logdebug' => false,
'logperf' => false, // Enable to dump performance counters to syslog
'logperf_detail' => false, // Enable to dump every counter hit
'fancy' => false,
@@ -85,6 +84,9 @@ $default =
array('fancyurls' => true, // makes sure aliases in WebFinger etc. are not f'd by index.php/ URLs
'legacy_http' => false, // set this to true if you have upgraded your site from http=>https
),
+ 'log' => [
+ 'debugtrace' => false, // index.php handleError function, whether to include exception backtrace in log
+ ],
'syslog' =>
array('appname' => 'statusnet', # for syslog
'priority' => 'debug', # XXX: currently ignored
From 2e327dfcd7ea079dbd0855ce0f53e51197cc1f6b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 11:33:52 +0200
Subject: [PATCH 153/415] Probably fixes issue with looping XMPP queue items
---
plugins/Xmpp/XmppPlugin.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php
index f8476cd8f2..da20504329 100644
--- a/plugins/Xmpp/XmppPlugin.php
+++ b/plugins/Xmpp/XmppPlugin.php
@@ -315,9 +315,13 @@ class XmppPlugin extends ImPlugin
function sendNotice($screenname, Notice $notice)
{
- $msg = $this->formatNotice($notice);
- $entry = $this->format_entry($notice);
-
+ try {
+ $msg = $this->formatNotice($notice);
+ $entry = $this->format_entry($notice);
+ } catch (Exception $e) {
+ common_log(LOG_ERR, __METHOD__ . ": Discarding outgoing stanza because of exception: {$e->getMessage()}");
+ return false; // return value of sendNotice is never actually used as of now
+ }
$this->queuedConnection()->message($screenname, $msg, 'chat', null, $entry);
return true;
}
From a93c69d150612cb30a86f0a21303ab828a675eab Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 15:42:41 +0200
Subject: [PATCH 154/415] OStatus update profile data script fixes
---
.../OStatus/scripts/update-profile-data.php | 32 ++++++++-----------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/plugins/OStatus/scripts/update-profile-data.php b/plugins/OStatus/scripts/update-profile-data.php
index 97d44e3842..e713ee36fe 100755
--- a/plugins/OStatus/scripts/update-profile-data.php
+++ b/plugins/OStatus/scripts/update-profile-data.php
@@ -44,30 +44,19 @@ function showProfileInfo(Ostatus_profile $oprofile) {
echo "group\n";
} else {
$profile = $oprofile->localProfile();
- try {
- foreach (array('nickname', 'fullname', 'bio', 'homepage', 'location') as $field) {
- print " $field: {$profile->$field}\n";
- }
- } catch (NoProfileException $e) {
- print "local profile not found";
+ foreach (array('nickname', 'fullname', 'bio', 'homepage', 'location') as $field) {
+ print " $field: {$profile->$field}\n";
}
}
echo "\n";
}
-function fixProfile($uri) {
- $oprofile = Ostatus_profile::getKV('uri', $uri);
-
- if (!$oprofile) {
- print "No OStatus remote profile known for URI $uri\n";
- return false;
- }
-
+function fixProfile(Ostatus_profile $oprofile) {
echo "Before:\n";
showProfileInfo($oprofile);
$feedurl = $oprofile->feeduri;
- $client = new HttpClient();
+ $client = new HTTPClient();
$response = $client->get($feedurl);
if ($response->isOk()) {
echo "Updating profile from feed: $feedurl\n";
@@ -106,7 +95,7 @@ if (have_option('all')) {
echo "Found $oprofile->N profiles:\n\n";
while ($oprofile->fetch()) {
try {
- $ok = fixProfile($oprofile->uri) && $ok;
+ $ok = fixProfile($oprofile) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
@@ -120,7 +109,7 @@ if (have_option('all')) {
echo "Found $oprofile->N matching profiles:\n\n";
while ($oprofile->fetch()) {
try {
- $ok = fixProfile($oprofile->uri) && $ok;
+ $ok = fixProfile($oprofile) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
@@ -128,8 +117,15 @@ if (have_option('all')) {
}
} else if (!empty($args[0]) && $validate->uri($args[0])) {
$uri = $args[0];
+ $oprofile = Ostatus_profile::getKV('uri', $uri);
+
+ if (!$oprofile instanceof Ostatus_profile) {
+ print "No OStatus remote profile known for URI $uri\n";
+ return false;
+ }
+
try {
- $ok = fixProfile($oprofile->uri) && $ok;
+ $ok = fixProfile($oprofile) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
From 7bef2ad4ccb10a319dde1e62460d34f7ebf3242c Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 16:19:47 +0200
Subject: [PATCH 155/415] Update Profile Data script fixes, might work for
groups too now
---
lib/activityutils.php | 2 +-
plugins/OStatus/classes/Ostatus_profile.php | 6 ++++++
plugins/OStatus/scripts/update-profile-data.php | 15 ++++++++-------
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/lib/activityutils.php b/lib/activityutils.php
index b86dd65909..dcccbb8d87 100644
--- a/lib/activityutils.php
+++ b/lib/activityutils.php
@@ -301,7 +301,7 @@ class ActivityUtils
return false;
}
- static function getFeedAuthor($feedEl)
+ static function getFeedAuthor(DOMDocument $feedEl)
{
// Try old and deprecated activity:subject
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 5673d51457..e8ac16fb1d 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1281,6 +1281,12 @@ class Ostatus_profile extends Managed_DataObject
*/
public function updateFromActivityObject(ActivityObject $object, array $hints=array())
{
+ if (self::getActivityObjectProfileURI($actorObj) !== $this->getUri()) {
+ common_log(LOG_ERR, 'Trying to update profile with URI '._ve($this->getUri()).' from ActivityObject with URI: '._ve(self::getActivityObjectProfileURI($actorObj)));
+ // FIXME: Maybe not AuthorizationException?
+ throw new AuthorizationException('Trying to update profile from ActivityObject with different URI.');
+ }
+
if ($this->isGroup()) {
$group = $this->localGroup();
self::updateGroup($group, $object, $hints);
diff --git a/plugins/OStatus/scripts/update-profile-data.php b/plugins/OStatus/scripts/update-profile-data.php
index e713ee36fe..5b3e00e9fc 100755
--- a/plugins/OStatus/scripts/update-profile-data.php
+++ b/plugins/OStatus/scripts/update-profile-data.php
@@ -62,15 +62,16 @@ function fixProfile(Ostatus_profile $oprofile) {
echo "Updating profile from feed: $feedurl\n";
$dom = new DOMDocument();
if ($dom->loadXML($response->getBody())) {
- $feed = $dom->documentElement;
- $entries = $dom->getElementsByTagNameNS(Activity::ATOM, 'entry');
- if ($entries->length) {
- $entry = $entries->item(0);
- $activity = new Activity($entry, $feed);
- $oprofile->checkAuthorship($activity);
+ if ($dom->documentElement->tagName !== 'feed') {
+ echo " (no element in feed URL response; skipping)\n";
+ return false;
+ }
+ $actorObj = ActivityUtils::getFeedAuthor($dom->documentElement);
+ if ($actorObj) {
+ $oprofile->updateFromActivityObject($actorObj);
echo " (ok)\n";
} else {
- echo " (no entry; skipping)\n";
+ echo " (no author on feed; skipping)\n";
return false;
}
} else {
From 88e2f739a94f14286dde6efe004289124426cd69 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 16:23:15 +0200
Subject: [PATCH 156/415] DOMElement not DOMDocument
---
lib/activityutils.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/activityutils.php b/lib/activityutils.php
index dcccbb8d87..4f31648ead 100644
--- a/lib/activityutils.php
+++ b/lib/activityutils.php
@@ -301,7 +301,7 @@ class ActivityUtils
return false;
}
- static function getFeedAuthor(DOMDocument $feedEl)
+ static function getFeedAuthor(DOMElement $feedEl)
{
// Try old and deprecated activity:subject
From 16517f019a1b8db25d5b0fea7502b9ce09d404ae Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 16:25:29 +0200
Subject: [PATCH 157/415] Embarrasing copy-paste gone too fast
---
plugins/OStatus/classes/Ostatus_profile.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index e8ac16fb1d..c370462685 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1281,8 +1281,8 @@ class Ostatus_profile extends Managed_DataObject
*/
public function updateFromActivityObject(ActivityObject $object, array $hints=array())
{
- if (self::getActivityObjectProfileURI($actorObj) !== $this->getUri()) {
- common_log(LOG_ERR, 'Trying to update profile with URI '._ve($this->getUri()).' from ActivityObject with URI: '._ve(self::getActivityObjectProfileURI($actorObj)));
+ if (self::getActivityObjectProfileURI($object) !== $this->getUri()) {
+ common_log(LOG_ERR, 'Trying to update profile with URI '._ve($this->getUri()).' from ActivityObject with URI: '._ve(self::getActivityObjectProfileURI($object)));
// FIXME: Maybe not AuthorizationException?
throw new AuthorizationException('Trying to update profile from ActivityObject with different URI.');
}
From d4041a4a1fe610d0466f7af6f14177348754d430 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Mon, 28 Mar 2016 16:41:29 +0200
Subject: [PATCH 158/415] a little bit more explicit logging
---
plugins/OStatus/classes/Ostatus_profile.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index c370462685..d84611ec16 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1302,8 +1302,8 @@ class Ostatus_profile extends Managed_DataObject
if ($avatar && !isset($ptag)) {
try {
$this->updateAvatar($avatar);
- } catch (Exception $ex) {
- common_log(LOG_WARNING, "Exception updating OStatus profile avatar: " . $ex->getMessage());
+ } catch (Exception $e) {
+ common_log(LOG_WARNING, 'Exception ('.get_class($e).') updating OStatus profile avatar: ' . $e->getMessage());
}
}
}
From 23bb45b845025c3715bd291798601657b97a29eb Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:13:23 +0200
Subject: [PATCH 159/415] Upgrade info from Bookmark plugin
---
plugins/Bookmark/BookmarkPlugin.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php
index 904c7ee9c9..780acfcbbc 100644
--- a/plugins/Bookmark/BookmarkPlugin.php
+++ b/plugins/Bookmark/BookmarkPlugin.php
@@ -347,6 +347,8 @@ class BookmarkPlugin extends MicroAppPlugin
function onEndUpgrade()
{
+ printfnq('Making sure Bookmark notices have correct verb and object_type...');
+
// Version 0.9.x of the plugin didn't stamp notices
// with verb and object-type (for obvious reasons). Update
// those notices here.
@@ -364,6 +366,8 @@ class BookmarkPlugin extends MicroAppPlugin
$notice->object_type = ActivityObject::BOOKMARK;
$notice->update($original);
}
+
+ printfnq("DONE.\n");
}
public function activityObjectOutputJson(ActivityObject $obj, array &$out)
From 4e2be07234bc0c8fcda47b7a18f9b3b43a7372f3 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:13:33 +0200
Subject: [PATCH 160/415] Better indexing for Notice (performance++)
---
classes/Notice.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/classes/Notice.php b/classes/Notice.php
index 256eb61663..6a747e5f5f 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -111,6 +111,8 @@ class Notice extends Managed_DataObject
'notice_repeat_of_created_id_idx' => array('repeat_of', 'created', 'id'),
'notice_conversation_created_id_idx' => array('conversation', 'created', 'id'),
'notice_verb_idx' => array('verb'),
+ 'notice_profile_id_verb_idx' => array('profile_id', 'verb'),
+ 'notice_url_idx' => array('url'), // Qvitter wants this
'notice_replyto_idx' => array('reply_to')
)
);
From dcffe5d992979a7ecd5ff7a83e8de3ececfb1b89 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:13:53 +0200
Subject: [PATCH 161/415] Forgotten File::getByUrl conversations
(performance++)
---
lib/action.php | 12 ++++++++----
plugins/Oembed/classes/File_oembed.php | 6 +++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/lib/action.php b/lib/action.php
index 6d6efb1cbc..86b4908b3d 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -661,10 +661,14 @@ class Action extends HTMLOutputter // lawsuit
// if logo is an uploaded file, try to fall back to HTTPS file URL
$httpUrl = common_config('site', 'logo');
if (!empty($httpUrl)) {
- $f = File::getKV('url', $httpUrl);
- if (!empty($f) && !empty($f->filename)) {
- // this will handle the HTTPS case
- $logoUrl = File::url($f->filename);
+ try {
+ $f = File::getByUrl('url', $httpUrl);
+ if (!empty($f->filename)) {
+ // this will handle the HTTPS case
+ $logoUrl = File::url($f->filename);
+ }
+ } catch (NoResultException $e) {
+ // no match
}
}
}
diff --git a/plugins/Oembed/classes/File_oembed.php b/plugins/Oembed/classes/File_oembed.php
index 246a74fea0..95aa91ff4c 100644
--- a/plugins/Oembed/classes/File_oembed.php
+++ b/plugins/Oembed/classes/File_oembed.php
@@ -120,10 +120,10 @@ class File_oembed extends Managed_DataObject
$file_oembed->url = $data->url;
$given_url = File_redirection::_canonUrl($file_oembed->url);
if (! empty($given_url)){
- $file = File::getKV('url', $given_url);
- if ($file instanceof File) {
+ try {
+ $file = File::getByUrl($given_url);
$file_oembed->mimetype = $file->mimetype;
- } else {
+ } catch (NoResultException $e) {
$redir = File_redirection::where($given_url);
if (empty($redir->file_id)) {
$f = $redir->getFile();
From f8765c6166601811a60cc6dbea43f654d594fe4d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:48:00 +0200
Subject: [PATCH 162/415] Upgrade script for Bookmark uses joins instead of
exists (performance++)
---
plugins/Bookmark/BookmarkPlugin.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php
index 780acfcbbc..050e529e0d 100644
--- a/plugins/Bookmark/BookmarkPlugin.php
+++ b/plugins/Bookmark/BookmarkPlugin.php
@@ -355,8 +355,8 @@ class BookmarkPlugin extends MicroAppPlugin
$notice = new Notice();
- $notice->whereAdd('exists (select uri from bookmark where bookmark.uri = notice.uri)');
- $notice->whereAdd('((object_type is null) or (object_type = "' .ActivityObject::NOTE.'"))');
+ $notice->joinAdd(array('uri', 'bookmark:uri'));
+ $notice->whereAdd('object_type IS NULL OR object_type = '.$notice->escape(ActivityObject::NOTE));
$notice->find();
From 72cafe03e9331d97307aebab69e07f0294ddfc58 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:48:25 +0200
Subject: [PATCH 163/415] Index object_type too...
---
classes/Notice.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/classes/Notice.php b/classes/Notice.php
index 6a747e5f5f..b387b627bf 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -110,6 +110,7 @@ class Notice extends Managed_DataObject
'notice_profile_id_idx' => array('profile_id', 'created', 'id'),
'notice_repeat_of_created_id_idx' => array('repeat_of', 'created', 'id'),
'notice_conversation_created_id_idx' => array('conversation', 'created', 'id'),
+ 'notice_object_type_idx' => array('object_type'),
'notice_verb_idx' => array('verb'),
'notice_profile_id_verb_idx' => array('profile_id', 'verb'),
'notice_url_idx' => array('url'), // Qvitter wants this
From cb212ba41c20412aabab5e7077f308bf8bfe3c07 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:55:50 +0200
Subject: [PATCH 164/415] Gah, bad syntax
---
plugins/Bookmark/BookmarkPlugin.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php
index 050e529e0d..e6afa0b6da 100644
--- a/plugins/Bookmark/BookmarkPlugin.php
+++ b/plugins/Bookmark/BookmarkPlugin.php
@@ -356,7 +356,7 @@ class BookmarkPlugin extends MicroAppPlugin
$notice = new Notice();
$notice->joinAdd(array('uri', 'bookmark:uri'));
- $notice->whereAdd('object_type IS NULL OR object_type = '.$notice->escape(ActivityObject::NOTE));
+ $notice->whereAdd('object_type IS NULL OR object_type = '.$notice->_quote(ActivityObject::NOTE));
$notice->find();
From 2f91cb0df7de37fd62588c6484b9f94bcd227c1d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 12:57:52 +0200
Subject: [PATCH 165/415] We should assume all verbs and such are their full
URIs in our db
---
classes/Profile.php | 6 ++----
lib/noticestream.php | 4 ++--
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 87168ace4a..fb6a621273 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -841,10 +841,8 @@ class Profile extends Managed_DataObject
$notices = new Notice();
$notices->profile_id = $this->getID();
- $notices->whereAddIn('verb',
- [ActivityUtils::resolveUri(ActivityVerb::POST, true), ActivityVerb::POST],
- $notices->columnType('verb'));
- $cnt = (int) $notices->count(); // we don't have to provide anything as Notice is key'd
+ $notices->verb = ActivityVerb::POST;
+ $cnt = (int) $notices->count('id'); // Not sure if I imagine this, but 'id' was faster than the defaulting 'uri'?
if (!empty($c)) {
$c->set(Cache::key('profile:notice_count:'.$this->getID()), $cnt);
diff --git a/lib/noticestream.php b/lib/noticestream.php
index 2b04a89ca4..72325a0fe4 100644
--- a/lib/noticestream.php
+++ b/lib/noticestream.php
@@ -48,9 +48,9 @@ abstract class NoticeStream
public function __construct()
{
foreach ($this->selectVerbs as $key=>$val) {
- // to avoid database inconsistency issues we select both relative and absolute verbs
$this->selectVerbs[ActivityUtils::resolveUri($key)] = $val;
- $this->selectVerbs[ActivityUtils::resolveUri($key, true)] = $val;
+ // to avoid database inconsistency issues we can select both relative and absolute verbs
+ //$this->selectVerbs[ActivityUtils::resolveUri($key, true)] = $val;
}
}
From 4ea79bc396a16a5687f017ee5f4ebe442bdcf8f6 Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 14:33:40 +0200
Subject: [PATCH 166/415] I was too quick to save that file (File::getByUrl
takes 1 arg)
---
lib/action.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/action.php b/lib/action.php
index 86b4908b3d..bab8a6dbcc 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -662,7 +662,7 @@ class Action extends HTMLOutputter // lawsuit
$httpUrl = common_config('site', 'logo');
if (!empty($httpUrl)) {
try {
- $f = File::getByUrl('url', $httpUrl);
+ $f = File::getByUrl($httpUrl);
if (!empty($f->filename)) {
// this will handle the HTTPS case
$logoUrl = File::url($f->filename);
From 0177c8f1cf5550a57e1ed3a29aff1660fdf6627d Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth
Date: Tue, 29 Mar 2016 14:36:27 +0200
Subject: [PATCH 167/415] Use join instead of exists in SQL
---
scripts/upgrade.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/scripts/upgrade.php b/scripts/upgrade.php
index fa55cfc206..f29c9f10bf 100755
--- a/scripts/upgrade.php
+++ b/scripts/upgrade.php
@@ -171,9 +171,14 @@ function initConversation()
printfnq("Ensuring all conversations have a row in conversation table...");
$notice = new Notice();
- $notice->query('select distinct notice.conversation from notice '.
- 'where notice.conversation is not null '.
- 'and not exists (select conversation.id from conversation where id = notice.conversation)');
+ $notice->selectAdd();
+ $notice->selectAdd('DISTINCT conversation');
+ $notice->joinAdd(['conversation', 'conversation:id'], 'LEFT'); // LEFT to get the null values for conversation.id
+ $notice->whereAdd('conversation.id IS NULL');
+
+ if ($notice->find()) {
+ printfnq(" fixing {$notice->N} missing conversation entries...");
+ }
while ($notice->fetch()) {
From df3bcbb6cb1f129b60b69a5b8fe63e57e539e17e Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth