summaryrefslogtreecommitdiff
path: root/lib/util.php
AgeCommit message (Collapse)Author
2010-12-24Add a more robust plugin config system.Luke Shumaker
2010-11-20: Luke Shumaker <lukeshu@sbcglobal.net> Add a more robust (but backward compatible) plugin config system * lib/util.php: add common_config_section($main), as a companion to common_config($main,$sub) * lib/statusnet.php: Functions for other Places: - add public static pluginFiles($name) which returns a list of all possible filenames a plugin with $name could be defined in. - addPlugin(...): use self::pluginFiles(...) instead of a hard-coded list. Actual Functionality: - add public static getPlugins() which returns array_merge( common_config('plugins','default'), common_config_section('plugin-list') ) - use self::getPlugins() instead of common_config('plugins','default') Robustness: - handle plugins that have a type other than "array" or "null" for parameters without bugging out * actions/pluginenable.php: (in order of in the file): - use StatusNet::getPlugins() instead of common_config('plugins','default') - check if a plugin exists, not whether it is loaded (uses newly added StatusNet::pluginFiles(...)) - Also save to 'plugin-list' (the new plugin system), in addition to 'plugins' (the old plugin system)
2010-12-07Merge branch '0.9.x' into mergeBrion Vibber
Conflicts: README actions/hostmeta.php classes/File_redirection.php lib/common.php lib/designsettings.php lib/router.php lib/util.php lib/xmppmanager.php plugins/OStatus/OStatusPlugin.php
2010-12-06Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.xBrion Vibber
Conflicts: classes/User.php
2010-12-06Added User::singleUserNickname() as (temporary?) fallback for single-user ↵Brion Vibber
lookup as a workaround for site setup of 1user sites. We found that an external tool attempting to spin up StatusNet and then register the user would fail because StatusNet's router setup dies on being unable to find its single-user account, since the nickname is needed in setting up routing entries. This tweak will let it survive, using the configured setting as a fallback if it can't actually find the user account.
2010-12-02Fix for tickets #2917, #2262: user URL shortening options not being applied ↵Brion Vibber
in non-web channels common_shorten_links() can only access the web session's logged-in user, so never properly took user options into effect for posting via XMPP, API, mail, etc. Adds an optional $user parameter on common_shorten_links(), and a $user->shortenLinks() as a clearer interface for that. Tweaked some lower-level functions so $user gets passed down -- making the $notice_id param previously there for saving URLs at notice save time generalized a little. Note also ticket #2919: there's a lot of duplicate code calling the shortening, checking the length, and reporting near-identical error messages. These should be consolidated to aid in code and translation maintenance.
2010-11-29General code safety: validate input and escape SQL strings in ↵Brion Vibber
common_relative_profile()
2010-11-29Add Nickname test cases for @-reply regexes in common_find_mentionsBrion Vibber
2010-11-29Work in progress on nickname validation changes. lib/nickname.php appears to ↵Brion Vibber
have been destroyed by NetBeans and will be rewritten shortly. Sigh.
2010-11-29Add some doc comments on nickname-related stuff in util.phpBrion Vibber
2010-11-17Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.xZach Copley
2010-11-17Add $config['attachments']['process_links'] to allow disabling processing of ↵Brion Vibber
mentioned URL links for attachment info (oEmbed lookups) and dereferencing of redirects that we didn't have shortened ourselves. This option may be useful for intranet sites that don't have direct access to the internet, as they may be unable to successfully fetch those resources.
2010-11-16Merge branch '0.9.x' into facebook-upgradeZach Copley
2010-11-09Merge branch '0.9.x' into facebook-upgradeZach Copley
2010-11-08Avoid marking files as attachments that are not locally uploaded, unless ↵Brion Vibber
they're really oembedable. HTML-y things now excluded properly.
2010-11-03Merge branch '0.9.x' into 1.0.xBrion Vibber
2010-11-03General cleanup & part of ticket #2864: use User_group->getFancyName() ↵Brion Vibber
instead of replicating the logic in various places. Encapsulates and allows for localization of parens.
2010-11-02Output filename in log msg if one is suppliedZach Copley
2010-10-28Merge branch '0.9.x' into 1.0.xBrion Vibber
2010-10-26Set cookies with "secure" flag on SSL sites. Improves security.testingCraig Andrews
2010-10-25Merge branch '0.9.x' into 1.0.xBrion Vibber
Conflicts: actions/subscriptions.php lib/router.php lib/xmppmanager.php lib/xmppoutqueuehandler.php
2010-10-25Forgot to add the OAuth verifier pin page to sensitive arrayZach Copley
2010-10-25We don't need to have editapplication (only showapplication) in theZach Copley
sensitive array because it doesn't expose the consumer keypair
2010-10-25Add OAuth token exchange endpoint to 'sensitive' array; i.e.: use SSL ifZach Copley
available
2010-10-20Fix for ticket #2845: singleuser nickname configuration was being overridden ↵Brion Vibber
by site owner in router setup. I've consolidated the checks for which user to use for single-user mode into User::singleUser(), which now uses the configured nickname by preference, falling back to the site owner if it's unset. This is now called consistently from the places that needed to use the primary user's nickname in routing setup. Setting $config['singleuser']['nickname'] should now work again as expected.
2010-10-18Merge branch '0.9.x' into 1.0.xBrion Vibber
Conflicts: README lib/default.php
2010-10-18options to nofollow external links in noticesEvan Prodromou
2010-10-07Merge branch '0.9.x' into 1.0.xBrion Vibber
2010-10-07Workaround for regression in input validation due to more PCRE oddities. ↵Brion Vibber
Recommend redoing common_validate_utf8() using something more reliable, perhaps. :P
2010-10-06Merge branch '0.9.x' into 1.0.xBrion Vibber
2010-10-06Basic validation of UTF-8 input via GET/POST vars: invalid UTF-8 sequences ↵Brion Vibber
will cause the string to drop. Not necessarily super-thorough; should be improved in future to drop individual bad sequences, do normalization of combining forms, etc. General input validation (for ints, types of strings, etc) still would be good to have!
2010-10-04Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.xBrion Vibber
Conflicts: actions/hostmeta.php actions/imsettings.php classes/User.php lib/adminpanelaction.php lib/channel.php lib/default.php lib/router.php lib/util.php
2010-09-20Don't spew a notice warning to output while processing logging for PEAR DB ↵Brion Vibber
errors
2010-09-20Ticket #2750: fixes to HTTP caching behavior across login/logout boundariesBrion Vibber
* now ignoring if-modified-since if we failed an etag if-none-match comparison, per spec * now including a hash of user id/nickname in most etags, so we'll update the view properly after login/logout For API methods, checking the API-auth'ed user. (Many change results to include things like 'you're subscribed to this user' or 'this is one of your favorites', so user info is again needed) There'll still be some last-modified stamps that aren't including user info properly, probably.
2010-09-16Add plural support for minutes/hours/days/months ago.Siebrand Mazeland
Reapply of revised b27882c9166191de4aaea298ba1b1a524cfe9ac7 that was reverted by Brion Vibber in 2d4c0f9a47f6534c578a37abe79670cec699caae.
2010-09-15Revert "Add plural support for minutes/hours/days/months ago." -- currently ↵Brion Vibber
doesn't work and spews error messages This reverts commit b27882c9166191de4aaea298ba1b1a524cfe9ac7.
2010-09-13Remove trailing whitespace and update comment consistency on methods.Siebrand Mazeland
2010-09-13Add plural support for minutes/hours/days/months ago.Siebrand Mazeland
2010-09-06common_cache_key() -> Cache::key()Evan Prodromou
2010-09-06common_keyize() -> Cache::keyize()Evan Prodromou
2010-09-06remove NOOP function common_broadcast_notice()Evan Prodromou
2010-09-06common_memcache() => Cache::instance()Evan Prodromou
2010-09-02Merge branch '0.9.x' into 1.0.xBrion Vibber
Conflicts: lib/command.php
2010-09-02Fix for #2635: use ssl-sometimes settings for Twitter settings & auth pagesBrion Vibber
2010-08-13Merge branch 'master' into 1.0.xEvan Prodromou
2010-08-12Fix for ticket 2513: "Can't linkify" error when some links are shortenedBrion Vibber
When bogus SSL sites etc were hit through a shortening redirect, sometimes link resolution kinda blew up and the user would get a "Can't linkify" error, aborting their post. Now catching this case and just passing through the URL without attempting to resolve it. Could benefit from an overall scrubbing of the freaky link/attachment code though...! :) http://status.net/open-source/issues/2513
2010-08-03Merge branch '0.9.x' into 1.0.xEvan Prodromou
2010-07-12Ticket 2433: Skip locale fallback list check on Windows ('locale -a' ↵Brion Vibber
shell-out doesn't work there)
2010-06-10Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.xBrion Vibber
Conflicts: lib/default.php lib/util.php plugins/UrlShortener/UrlShortenerPlugin.php (has been removed?)
2010-06-07Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.xBrion Vibber
Conflicts: plugins/OpenID/openid.php
2010-06-03Skip enqueueing to outgoing bridges on incoming remote messages. Twitter, ↵Brion Vibber
Facebook, RSSCloud, and OStatus checks were enqueued on these when they'd never do anything but churn the queue servers. Notice::isLocal() can replace a number of manual checks for $notice->is_local being LOCAL_PUBLIC or LOCAL_NONPUBLIC.