Ryan Boren
6d8bce688f
Pinking shears
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22634 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-17 15:11:29 +00:00
Andrew Nacin
9c33c30f5b
Account for unfiltered_upload cap in wp_upload_bits(). see #21292 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22471 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-08 20:41:34 +00:00
Dion Hulse
499f18d2c2
Prevent an issue on windows systems which can cause the temporary directory from get_temp_dir() from returning a path containing \/. Props to SergeyBiryukov for the initial patch. Fixes #20778
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22331 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-30 20:58:35 +00:00
Andrew Ozz
c71700c7b4
Buttons:
...
- Update the install/initial configuration/repair screens buttons, props DrewAPicture
- Fix the welcome screen buttons and fine-tune the buttons css, props lessbloat
fixes #21598
git-svn-id: https://develop.svn.wordpress.org/trunk@22314 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-26 19:40:39 +00:00
Andrew Nacin
8e674037bc
Avoid 'headers already sent' messages for header_remove() the same way we currently do with header(). props ryan. fixes #22258 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22303 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-25 20:38:55 +00:00
Andrew Nacin
08dafbce51
Do not issue a Last-Modified header when issuing no-cache headers to avoid aggressive (webkit) caching. Serve a blank header when header_remove() is not available (PHP < 5.3). props andy. fixes #22258 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22283 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-23 15:45:44 +00:00
Ryan Boren
abd1718828
A more generic message for wp_upload_dir(). Props nacin. fixes #21796
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22276 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-23 13:49:00 +00:00
Andrew Nacin
217c37b516
Have wp_upload_dir() account for blog switching, ms-files rewriting, and the UPLOADS constant properly. This type of logic needs a lot of code comments.
...
Prevents wp_upload_dir() from obeying the UPLOADS constant when ms-files rewriting is enabled and a blog is switched.
Reverts [22106] thanks to [22108].
see #19235 .
git-svn-id: https://develop.svn.wordpress.org/trunk@22222 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-12 22:05:02 +00:00
Ryan Boren
1b3f54d73d
Reduce use of global. Use get_blog_details() instead. fixes #22090
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22108 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-04 12:40:09 +00:00
Andrew Nacin
cce2ddd29c
Pass the current blog id to is_main_site() in wp_upload_dir(), because is_main_site() without arguments does not respond correctly on switch. see #19235 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22106 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-03 18:57:36 +00:00
Ryan Boren
7790af3154
Introduce WP_Image_Editor, WP_Image_Editor_Imagick, and WP_Image_Editor_GD. Abstracts image editing API and adds support for ImageMagick.
...
Props DH-Shredder, kurtpayne, markoheijnen
see #6821
git-svn-id: https://develop.svn.wordpress.org/trunk@22094 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-01 20:59:06 +00:00
Dion Hulse
693fccb99c
Silence a PHP Warning in Safe Mode from get_temp_dir(). Props ocean90. Fixes #20778
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22082 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-29 01:22:25 +00:00
Andrew Nacin
53cbfca362
If a pre-3.0 (MU era) network disables ms-files manually, they don't need /sites/ in their wp-content/uploads directory. see #19235 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22038 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-27 04:56:58 +00:00
Dion Hulse
45d9a3e5f7
Move win_is_writable() from wp-admin/includes to wp-includes so that it's always available for get_temp_dir(). Fixes #20778
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22009 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-26 05:08:26 +00:00
Dion Hulse
2e9dc20515
Rearrange the order that we check for temporary directories in get_temp_dir(). This change causes us to use System temporary directories in preference to WP_CONTENT_DIR, for better windows compatibility, we use win_is_writable() as well. Props simonwheatley and kurtpayne for initial patches, See #20778
...
git-svn-id: https://develop.svn.wordpress.org/trunk@22008 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-26 05:02:58 +00:00
Andrew Nacin
774a12be83
Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21996 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-25 05:26:19 +00:00
Peter Westwood
d86f9f140f
Posting: Improve the invalid date protection code based on feedback from nacin.
...
* Introduce a wp_checkdate() function with a single filter to centralise the code that validates dates.
* Improve the error message
* Correctly handle the return value of wp_insert_post which is not always a WP_Error on failure
Fixes #17180
git-svn-id: https://develop.svn.wordpress.org/trunk@21922 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-20 10:46:50 +00:00
Andrew Nacin
9447d32ef4
Simplify protocol stripping in add_query_arg() by avoiding a regular expression. Don't cast a known array to an array. fixes #21332 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21865 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-16 16:16:26 +00:00
Andrew Nacin
c6fa13adc9
Add xmpp to allowed protocols. props ethitter, fixes #21604 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21826 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-12 15:47:34 +00:00
Andrew Nacin
5d3c3fcfba
Don't show Appearance > Widgets if the theme has no sidebars defined. props SergeyBiryukov for the initial patch. fixes #21761 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21825 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-12 02:16:46 +00:00
Andrew Nacin
7f29924c6a
Remove ms-files.php rewriting from WordPress multisite. fixes #19235 .
...
Keep existing networks compatible with a ms_files_rewriting network option.
git-svn-id: https://develop.svn.wordpress.org/trunk@21823 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-11 22:22:20 +00:00
Andrew Nacin
c1eaaf31b8
Always return upload directory information from wp_upload_dir(), even if there is an error. Append the error to the array. see #19235 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21822 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-11 22:06:49 +00:00
Andrew Nacin
dfac91464f
Remove AtomPub from core.
...
* Will be replaced with http://wordpress.org/extend/plugins/atom-publishing-protocol/ .
* Introduces an action, xmlrpc_rsd_apis, to add APIs to xmlrpc.php?rsd.
* Introduces support for 'error' being 403 and 50x in class-wp.php.
* Removes 'Remote Publishing' from Writing Settings (see [21804]). Keeps the remote_publishing settings section.
DB version is bumped to generate the new wp-app rewrite rule and remove the old enable_app option.
props wonderboymusic.
fixes #21509 .
git-svn-id: https://develop.svn.wordpress.org/trunk@21818 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-11 20:11:39 +00:00
Ryan Boren
fdc3e8caee
Don't use set_url_scheme() in wp_guess_url(). wp_guess_url() is used during install before set_url_scheme() is loaded. Props SergeyBiryukov. fixes #20759
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21797 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-10 19:37:08 +00:00
Andrew Nacin
215be466c3
Add get-attachment and query-attachments Ajax handlers. props koopersmith. see #21390 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21681 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-31 02:58:51 +00:00
Andrew Nacin
0599fd010f
Introduce wp_send_json() to json-encode a variable, print it, and die, for Ajax requests. Effectively replaces WP_Ajax_Response, which was an XML-based response.
...
Introduce wp_send_json_success() and wp_send_json_error(), which will allow us to fire appropriate done() or fail() callbacks in JS.
props koopersmith. see #21390 .
git-svn-id: https://develop.svn.wordpress.org/trunk@21679 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-31 01:56:00 +00:00
Ryan Boren
92ea34f6a2
Use set_url_scheme(). Props johnbillion, MarcusPope. see #19037 #20759
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21664 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-30 13:33:00 +00:00
Ryan Boren
ee8cf061f8
Introduce wp_get_mime_types() for fetching the complete list of mime types. Remove the static caching of the types so that filters other than the first filter work. Use wp_get_mime_types() in do_enclose(). fixes #21299 #21594
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21541 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-17 17:25:19 +00:00
Ryan Boren
c4efcb4def
Fix MS Office mime types. Group the mime list in get_allowed_mime_types() by type. Props hebbet, markel, SergeyBiryukov. fixes #17117
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21527 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-15 16:48:36 +00:00
Ryan Boren
20a1def1c0
switch_to_blog() and restore_current_blog() housekeeping.
...
wp-includes/admin-bar.php:
* Replace get_admin_url() and get_home_url() with admin_url() and home_url() and place them inside a switch/restore. Likewise replace current_user_can_for_blog() with current_user_can(). This avoids doing multiple switch restores.
wp-includes/ms-blogs.php:
* Deprecate the $validate argument to switch_to_blog(). This avoids a not very necessary call to get_blog_details(), possibly saving a few queries.
* Use $_wp_switched and $_wp_switched_stack instead of $switched and $switched_stack to make it less likely these globals will be stomped.
* Use GLOBALS to access blog_id and other globals. I've preferred this style lately since it makes it obvious a global is being used and avoids global blog_id being stomped by a local variable.
* Lose some is_object() checks. wp_get_current_user() always returns an object, for example.
* Call the new WP_Roles::reinit() method.
wp-includes/class-wp-xmlrpc-server.php:
* Replace current_user_can_for_blog() with current_user_can() and move it inside the switch/restore pair. This eliminates a switch/restore.
wp-includes/capabilities.php:
* Use array_keys() instead of $role => $data since $data is unused. I *think* this is a bit faster.
* Introduce WP_Roles::reinit(). This reinitializes WP_Roles and is used after switch_to_blog() has already update the blog ID in the wpdb object. If a global roles array is being used instead of the db, reinit is skipped.
* current_user_can_for_blog() now does a switch/restore. It didn't before meaning it could be reinitializing the user with the wrong role information for the current blog.
wp-includes/ms-settings.php:
* Define $_wp_switched_stack and $_wp_switched. This way switch_to_blog() and restore_current_blog() can rely on it being set.
wp-settings.php:
* Instantiate the WP_Roles global. This was it is always defined during init. To remove the WP_Roles checks from WP_Role and WP_User this would probably have to move before plugins are loaded, which might not be a good thing.
wp-includes/functions.php:
* Update wp_upload_dir() to reference _wp_switched.
git-svn-id: https://develop.svn.wordpress.org/trunk@21485 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-09 16:28:15 +00:00
Ryan Boren
872ba2c28f
Call func_get_args() once in add_query_arg(). Props SergeyBiryukov. see #21332
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21373 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-31 15:28:10 +00:00
Andrew Nacin
6de675bd6a
Remove unnecessary error suppression operators from func_get_arg() and func_num_args(). see #21332 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21298 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-21 06:07:39 +00:00
Andrew Nacin
96f9446e11
Check if array key exists in wp_list_filter(). props wpsmith. fixes #20929 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21184 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-29 19:42:27 +00:00
Andrew Nacin
42c8c7b5fe
Add back an empty line removed in [21180].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21181 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-29 15:16:36 +00:00
Andrew Nacin
9283b786be
Add note to get_allowed_mime_types() about the upload_mimes filter. props JustinSainton. fixes #20990 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21180 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-29 15:13:53 +00:00
Mark Jaquith
bfd2e57437
Allow tel: and fax: protocols. Wrangle the last hardcoded protocol enumeration so that it uses wp_allowed_protocols(). fixes #21081
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21170 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-28 20:30:10 +00:00
Andrew Nacin
4c406cc8ad
Add initial support for browser-based uploads in iOS 6. see #20923 for trunk.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21141 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-26 20:39:04 +00:00
Andrew Nacin
5b9214124c
Deprecate wp_explain_nonce(). fixes #21076 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21133 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-26 06:10:07 +00:00
Andrew Nacin
9e30b38e96
Don't call debug_backtrace() with an argument for PHP 5.2.4, which is currently the lowest version we support. props swekitsune, kurtpayne. fixes #20953 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21113 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-25 20:41:37 +00:00
Ryan Boren
8c50f982ea
Pinking shears
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20715 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-03 16:41:59 +00:00
Andrew Nacin
199f9adec2
Properly extract file headers via get_file_data() when CR line endings are used. props solarissmoke for the initial patch. fixes #19854 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20640 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-30 01:25:29 +00:00
Andrew Nacin
f107d5e049
Fix typo in filter name for wp_die() APP request handler. props benbalter, fixes #20457 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20480 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-16 16:15:18 +00:00
Ryan Boren
d1100bacb4
Schedule auto-draft deletion from post-new.php instead of from admin.php. This provides better throttling for large multisite installs and reduces the risk of a delete avalanche.
...
fixes #19663
git-svn-id: https://develop.svn.wordpress.org/trunk@20453 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-12 18:49:48 +00:00
Andrew Ozz
e032e94c4f
Don't hide links to the upload form and show an error for mobile devices that cannot upload, see #20410
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20449 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-12 00:16:37 +00:00
Ryan Boren
03512f97e8
Move deletion of auto-draft posts to the wp_scheduled_delete cron function. Props mgolawala. fixes #19663
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20440 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-11 20:39:09 +00:00
Andrew Nacin
1909f3fbeb
Use the metadata API rather than raw queries and direct do_action calls. see #20417 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20435 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-11 20:02:39 +00:00
Dion Hulse
cc9bcf724b
Restore the h1 styling for wp_die(), primarily affects database down messages. See #17975
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20209 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-18 11:51:25 +00:00
Andrew Nacin
69485d4803
Use array_combine() in get_file_data() and avoid variable variables when an array is just fine. fixes #20126 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20088 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-02 21:07:31 +00:00
Andrew Nacin
339251c75c
New wp_die_app_handler context in wp_die() for APP requests. Introduces _scalar_wp_die_handler() as a generic handler that wraps die(), for use by plugins. Move deprecated function to the end of the wp-app.php file (same as xmlrpc.php). see #20042 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20063 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-01 21:35:15 +00:00
Ryan Boren
89e9bcc1d6
Pinking shears 6-20000
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20000 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-27 19:46:52 +00:00