gnu-social/actions
Brion Vibber 820dd293c9 Fix for ticket #3007: .bmp avatar uploads weren't being properly converted to PNG in all cases
Part of the reported issue was previuosly fixed by dc497ed0 (smaller size images being blanked).
This commit fixes the remaining bug with original-size avatars being left as BMP (which could include the 96px size for instance, which could cause problems in browsers not supporting BMP natively)

Added ImageFile::copyTo() as a convenient alias for resizeTo() when not resizing; this performs the BMP/XPM/XBM->PNG conversion if needed, or copies the original file.
Copying instead of using move_uploaded_file() is fine here since:
a) the files are cleaned up on script completion anyway (vs moving to remove it)
b) we're already performing getimagesize() and possibly load/resize on the file before this point (vs needing to move the file into a usable area to work with open_basedir restrictions that prevent working directly with uploaded files in the temp dir; since this would fail anyway, we lose nothing)

ImageFile::preferredType() now works on $this->type instead of asking for one, to make it handier to use from outside. (This is still needed in order for calling code to generate a target filename.)

Recommended for future:
* additional consolidation between the various ways of uploading avatars (touched avatarsettings, grouplogo, and apiaccountupdateprofileimage with similar minor changes)
* consolidate type checks and file naming into Avatar class
2011-01-24 12:22:47 -08:00
..
accessadminpanel.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
accesstoken.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
all.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
allrss.php Fix missing close of comment block 2010-11-11 10:39:05 -08:00
apiaccountratelimitstatus.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiaccountupdatedeliverydevice.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiaccountupdateprofile.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiaccountupdateprofilebackgroundimage.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiaccountupdateprofilecolors.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiaccountupdateprofileimage.php Fix for ticket #3007: .bmp avatar uploads weren't being properly converted to PNG in all cases 2011-01-24 12:22:47 -08:00
apiaccountverifycredentials.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apiatomservice.php Update translator documentation 2011-01-20 18:40:20 +01:00
apiblockcreate.php Update translator documentation 2011-01-20 18:40:20 +01:00
apiblockdestroy.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apidirectmessage.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apidirectmessagenew.php Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels 2010-12-02 13:41:56 -08:00
apifavoritecreate.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apifavoritedestroy.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apifriendshipscreate.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apifriendshipsdestroy.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apifriendshipsexists.php screen_name -> nick names. Spotted by The Evil IP address. 2010-11-07 22:31:02 +01:00
apifriendshipsshow.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigroupcreate.php Work in progress on nickname validation changes. lib/nickname.php appears to have been destroyed by NetBeans and will be rewritten shortly. Sigh. 2010-11-29 14:15:25 -08:00
apigroupismember.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigroupjoin.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigroupleave.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigrouplist.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigrouplistall.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apigroupmembership.php Fix error handling for missing group in apigroupmembership -- was trying to call methods on the variable before we checked it, which triggers PHP fatal error 2011-01-07 16:25:58 -08:00
apigroupshow.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apihelptest.php * i18n/L10n fixes. 2010-10-28 01:21:09 +02:00
apimediaupload.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apioauthaccesstoken.php OAuth: Fix rare problem in which request tokens were sometimes being 2011-01-19 23:00:24 -08:00
apioauthauthorize.php Update translator documentation. 2010-11-07 22:32:52 +01:00
apioauthpin.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apioauthrequesttoken.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apisearchatom.php Ticket #1987: support since_id on API notice search methods. 2010-11-19 14:00:22 -08:00
apisearchjson.php Ticket #1987: support since_id on API notice search methods. 2010-11-19 14:00:22 -08:00
apistatusesdestroy.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apistatusesretweet.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apistatusesretweets.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apistatusesshow.php Update translator documentation 2011-01-20 18:40:20 +01:00
apistatusesupdate.php allow group join/leave commands in api posting, at least for the moment (no other way to do remote subscribe without a preexisting local id number via api) 2011-01-06 13:46:39 -08:00
apistatusnetconfig.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apistatusnetversion.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apisubscriptions.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinefavorites.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinefriends.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinegroup.php Stop using <activity:subject> for atom feeds 2010-12-27 10:03:34 -08:00
apitimelinehome.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinementions.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinepublic.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelineretweetedbyme.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelineretweetedtome.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelineretweetsofme.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelinetag.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apitimelineuser.php Merge branch '0.9.x' into testing 2011-01-20 15:12:57 -08:00
apitrends.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apiuserfollowers.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apiuserfriends.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
apiuserprofileimage.php Ticket #2959: implement api/users/profile_image endpoint in Twitter-compat API 2010-12-17 17:10:52 -08:00
apiusershow.php * i18n/L10n fixes. 2010-10-28 01:21:21 +02:00
atompubfavoritefeed.php Translator comments added 2011-01-20 20:00:45 +01:00
atompubmembershipfeed.php Translator comments added 2011-01-20 20:00:45 +01:00
atompubshowfavorite.php Translator comments added 2011-01-20 20:00:45 +01:00
atompubshowmembership.php Translator comments added 2011-01-20 20:00:45 +01:00
atompubshowsubscription.php Translator comments added 2011-01-20 20:00:45 +01:00
atompubsubscriptionfeed.php Merge branch '0.9.x' into testing 2011-01-20 15:12:57 -08:00
attachment.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
attachment_ajax.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
attachment_thumbnail.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
avatarbynickname.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
avatarsettings.php Fix for ticket #3007: .bmp avatar uploads weren't being properly converted to PNG in all cases 2011-01-24 12:22:47 -08:00
backupaccount.php fix notice error 2010-12-22 11:06:45 -08:00
block.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
blockedfromgroup.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
bookmarklet.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
confirmaddress.php Translator comments added 2011-01-20 20:00:45 +01:00
conversation.php * i18n/L10n updates. 2010-10-31 00:58:35 +02:00
deleteaccount.php Add a scary 'experimental feture' warning & are-you-sure prompt on moveuser.php 2011-01-19 15:13:46 -08:00
deleteapplication.php Update translator documentation. 2010-11-01 16:49:36 +01:00
deletegroup.php Update translator documentation. 2010-11-01 16:49:36 +01:00
deletenotice.php Update translator documentation 2011-01-20 18:40:20 +01:00
deleteuser.php Merge branch 'testing' into 0.9.x 2010-05-21 13:15:08 -07:00
designadminpanel.php i18n/L10n consistency updates. 2010-10-21 13:20:21 +02:00
disfavor.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
doc.php Allow site-specific doc files 2010-03-10 22:27:28 +00:00
editapplication.php * i18n/L10n updates. 2010-11-01 16:49:35 +01:00
editgroup.php Work in progress on nickname validation changes. lib/nickname.php appears to have been destroyed by NetBeans and will be rewritten shortly. Sigh. 2010-11-29 14:15:25 -08:00
emailsettings.php Translator comments added 2011-01-20 20:00:45 +01:00
favor.php Make some messages gender neutral. 2010-07-19 21:09:09 -05:00
favorited.php Prep for ticket #2895: consolidate common code from PopularNoticeList and FavoritedAction for fetching popular notice lists 2010-11-16 11:10:32 -08:00
favoritesrss.php Implement since_id and max_id param handling for /api/favorites 2010-05-05 14:46:36 -07:00
featured.php Remove pleonasm in UI text 2009-12-20 20:20:35 +01:00
file.php (Puctuation) consistency in clientError() calls. 2009-12-13 18:55:17 +01:00
finishremotesubscribe.php Make some messages gender neutral. 2010-07-19 21:09:09 -05:00
foaf.php Ticket #2350: fix for incorrect FOAF sioc:follows entries for users who are followed by, but don't themselves follow the user whose FOAF we're displaying. 2010-06-10 11:42:58 -07:00
foafgroup.php Avoid E_NOTICE spew when listing group members who aren't admins 2010-04-09 08:38:42 -07:00
geocode.php Assigning my copyrights to the Free Software Foundation 2010-05-27 18:27:33 -04:00
getfile.php Improve name validation checks on local File references 2010-02-01 08:49:59 -08:00
grantrole.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
groupblock.php Merge branch 'testing' into 0.9.x 2010-05-21 13:15:08 -07:00
groupbyid.php Lots of tiny message changes. 2010-01-10 12:26:24 +01:00
groupdesignsettings.php Translator comments added 2011-01-20 20:00:45 +01:00
grouplogo.php Fix for ticket #3007: .bmp avatar uploads weren't being properly converted to PNG in all cases 2011-01-24 12:22:47 -08:00
groupmembers.php Fix PHP syntax errors introduced during localization fixups in a few files. 2010-09-25 12:10:36 -07:00
grouprss.php Document messages for which clarification was requested. 2010-04-10 01:48:16 +02:00
groups.php modify group actions so they use Local_group to look up by nickname 2010-02-25 08:44:15 -05:00
groupsearch.php Merge remote branch 'statusnet/0.8.x' into 0.9.x 2009-10-11 13:39:10 -04:00
groupunblock.php * translator documentation updated. 2010-10-31 01:16:59 +02:00
hcard.php Add an hcard action 2010-02-25 18:39:55 -05:00
hostmeta.php Make userxrd part of the default hostmeta 2010-11-26 21:46:51 -05:00
imsettings.php Translator comments added 2011-01-20 20:00:45 +01:00
inbox.php fix interpolation of positional arguments to sprintf in inbox 2010-01-24 22:54:25 -05:00
invite.php Add context for different uses of "%1$s (%2$s)" 2010-11-02 23:08:59 +01:00
joingroup.php OStatus: fix remote groups to work with new user_groups/local_groups split. 2010-02-25 13:02:08 -08:00
leavegroup.php OStatus: fix remote groups to work with new user_groups/local_groups split. 2010-02-25 13:02:08 -08:00
licenseadminpanel.php Translator comments added 2011-01-20 20:00:45 +01:00
login.php Redirect non-SSL hits to login & register actions to SSL if 'always' or 'sometimes' SSL modes are kicked in. 2010-05-18 21:52:17 +00:00
logout.php Revert "Remove more contractions" 2009-11-09 20:01:46 +01:00
makeadmin.php Fix for ticket #2837: white screen when hitting 'make admin' button on group members list. 2010-10-15 15:33:54 -07:00
microsummary.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
newapplication.php * i18n/L10n updates. 2010-11-01 16:49:35 +01:00
newgroup.php Fix for PHP notice spew in group creation via API: set default 'mainpage' in User_group::register() rather than forcing all callers to do it manually. 2011-01-06 13:22:44 -08:00
newmessage.php Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels 2010-12-02 13:41:56 -08:00
newnotice.php Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels 2010-12-02 13:41:56 -08:00
noticesearch.php * L10n updates: consistent puctuation 2010-01-10 01:45:58 +01:00
noticesearchrss.php Fix bug 1997: notice search rss utter failure 2009-11-20 14:54:59 -08:00
nudge.php Add missing "address" 2010-10-20 00:49:12 +02:00
oauthappssettings.php * translator documentation added. 2010-10-23 19:20:51 +02:00
oauthconnectionssettings.php Move getConnectedApps() from Profile to User, where it belongs 2010-12-12 17:37:42 -08:00
oembed.php Mark OembedAction, XrdAction, and (plugin) AutocompleteAction as read-only. Tweaked ApiStatusesShow and ApiTimelineUser to still claim read-only when hit with a HEAD request (usually link checkers or a precursor to a GET, and should be semantically equivalent to a GET without actually transferring data) 2010-12-14 16:14:15 -08:00
opensearch.php Revert "Remove more contractions" 2009-11-09 20:01:46 +01:00
othersettings.php Translator comments added 2011-01-20 20:00:45 +01:00
otp.php an otp is a real login 2010-03-08 18:06:21 -05:00
outbox.php fix interpolation of positional arguments to sprintf in outbox 2010-01-24 22:53:29 -05:00
passwordsettings.php Fix regression in password settings: users have been unable to change their passwords since introduction of ChangePassword event (later StartChangePassword) November 5 in commit d6ddb84132 2009-12-01 15:44:07 -08:00
pathsadminpanel.php Consistent punctuation. 2010-10-20 20:29:59 +02:00
peoplesearch.php Bringing Sphinx search support up to code: broken out to a plugin, now supports multiple sites on a single server. 2009-11-10 13:44:40 -08:00
peopletag.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
postnotice.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
profilesettings.php Merge branch '0.9.x' into testing 2011-01-20 15:12:57 -08:00
public.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
publicrss.php Output If-Modified-Since header for all RSS 1.0 feeds (again) 2009-09-24 15:10:55 -07:00
publictagcloud.php Many i18n/L10n updates and lots of descriptions for translators added. 2010-10-20 00:35:39 +02:00
publicxrds.php Assigning my copyrights to the Free Software Foundation 2010-05-27 18:27:33 -04:00
recoverpassword.php * i18n/L10n updates. 2010-11-01 16:49:35 +01:00
register.php Work in progress on nickname validation changes. lib/nickname.php appears to have been destroyed by NetBeans and will be rewritten shortly. Sigh. 2010-11-29 14:15:25 -08:00
remotesubscribe.php Translator comments added 2011-01-20 20:00:45 +01:00
repeat.php Translator comments added 2011-01-20 20:00:45 +01:00
replies.php Tweak message per suggestion of The Evil IP Address[1]. 2010-08-01 00:16:39 +02:00
repliesrss.php Output If-Modified-Since header for all RSS 1.0 feeds (again) 2009-09-24 15:10:55 -07:00
requesttoken.php Response for request token doesn't contain omb_version 2009-09-13 00:01:23 -04:00
restoreaccount.php * remove i18n for debug message. 2011-01-14 21:25:46 +01:00
revokerole.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
robotstxt.php Add a robots.txt URL to the site root 2010-01-31 10:12:26 -05:00
rsd.php Atom Service Document 2010-10-24 23:43:26 -04:00
sandbox.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
sessionsadminpanel.php Removed periods from instructions on some admin panels for consistency 2010-09-17 14:32:18 -07:00
showapplication.php Re-camelcase ApiOauthAuthorizeAction so it will be accessible when 2010-10-21 18:15:11 -07:00
showfavorites.php options to nofollow external links in notices 2010-10-18 11:29:52 -04:00
showgroup.php General cleanup & part of ticket #2864: use User_group->getFancyName() instead of replicating the logic in various places. Encapsulates and allows for localization of parens. 2010-11-03 12:59:19 -07:00
showmessage.php * translator documentation updated. 2010-10-31 01:16:59 +02:00
shownotice.php split out InlineAttachmentList from AttachmentList 2010-11-09 10:45:19 -08:00
showstream.php fix typo in showstream 2010-12-17 16:21:33 -08:00
silence.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
siteadminpanel.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
sitenoticeadminpanel.php * i18n/L10n updates. 2010-11-01 16:49:35 +01:00
smssettings.php Translator comments added 2011-01-20 20:00:45 +01:00
snapshotadminpanel.php Lower case "Web" 2010-04-11 01:03:06 +02:00
subedit.php * translator documentation updated. 2010-10-31 01:16:59 +02:00
subscribe.php Fix bug on subscribe/unsubscribe in profile lists. Bogus call to nonexisting profile->getProfile() was masked by DB_DataObject 2010-02-25 15:22:23 -08:00
subscribers.php Fix warning in subscribers/subscriptions list pages where we attempted to call free() an ArrayWrapper after it was used up, thus trying to forward the call to a nonexistent object. 2011-01-07 15:29:30 -08:00
subscriptions.php Fix warning in subscribers/subscriptions list pages where we attempted to call free() an ArrayWrapper after it was used up, thus trying to forward the call to a nonexistent object. 2011-01-07 15:29:30 -08:00
sup.php Performance fix for FriendFeed sup interface: MySQL query optimizer was doing a table scan on notice; explicit subquery makes it run much more efficiently, only scanning items within the period under consideration. Standard subquery should be PostgreSQL-compatible. 2010-02-21 15:21:18 -08:00
tag.php Update message formatting for serverError to use a starting capital and a leading period. 2010-04-09 15:29:41 -07:00
tagother.php Lots of tiny message changes. 2010-01-10 12:26:24 +01:00
tagrss.php Fix for blank RSS1 tag feeds 2010-03-05 16:23:28 -08:00
unblock.php add events for unblocking a profile 2009-12-28 10:50:12 -08:00
unsandbox.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
unsilence.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
unsubscribe.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
updateprofile.php remove strict check on OMB exception strings 2010-03-01 18:03:18 -05:00
useradminpanel.php * i18n/L10n updates. 2010-11-01 16:49:35 +01:00
userauthorization.php Fix inconsistencies in clientError() messages 2010-04-09 16:11:20 -07:00
userbyid.php (Puctuation) consistency in clientError() calls. 2009-12-13 18:55:17 +01:00
userdesignsettings.php Translator comments added 2011-01-20 20:00:45 +01:00
usergroups.php Document messages for which clarification was requested. 2010-04-10 01:48:16 +02:00
userrss.php Document messages for which clarification was requested. 2010-04-10 01:48:16 +02:00
userxrd.php Make userxrd work without OStatus enabled 2010-11-26 22:09:51 -05:00
version.php Assigning my copyrights to the Free Software Foundation 2010-05-27 18:27:33 -04:00
xrds.php A further change to the XRDS is required if 0.9.x is to be able to remote sub to a 0.8.x account, with the OpenID plugin enabled. 2009-11-12 20:57:09 +00:00