Commit Graph

1320 Commits

Author SHA1 Message Date
Scott Taylor
ac654632fe Use PHP_SAPI constant instead of php_sapi_name() in iis7_supports_permalinks(), wp_fix_server_vars(), and wp_redirect().
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31120


git-svn-id: http://core.svn.wordpress.org/trunk@31101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 04:59:22 +00:00
Scott Taylor
60b0cd7943 The keyword elseif should be used instead of else if so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31090


git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Scott Taylor
29cd3fa5bf PHP keywords and constants "true", "false", "null" should be in lower case - there was one lingering capitalized false in _http_build_query().
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31086


git-svn-id: http://core.svn.wordpress.org/trunk@31067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 06:14:23 +00:00
Gary Pendergast
e6a74136f9 size_format() incorrectly included a trailing space for B values: less than 1024 bytes.
Also add a unit test to check for this, so we don't do it again.

Fixes #30908.

Props tillkruess.
 

Built from https://develop.svn.wordpress.org/trunk@31052


git-svn-id: http://core.svn.wordpress.org/trunk@31033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-05 13:13:23 +00:00
Scott Taylor
be59efcfbf ImageMagick expects TIFF files to have .tiff as an extension, so the key in wp_get_mime_types() should be 'tiff|tif' not 'tif|tiff' so the proper extension is returned in WP_Image_Editor->get_extension() subclass invocations.
Fixes #30211.

Built from https://develop.svn.wordpress.org/trunk@31044


git-svn-id: http://core.svn.wordpress.org/trunk@31025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-04 03:09:22 +00:00
Scott Taylor
a0df295f5c Improve various @param docs.
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30674


git-svn-id: http://core.svn.wordpress.org/trunk@30664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 23:24:25 +00:00
Drew Jaynes
bffe95d34c Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`

See #30552.

Built from https://develop.svn.wordpress.org/trunk@30656


git-svn-id: http://core.svn.wordpress.org/trunk@30646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 12:10:23 +00:00
Scott Taylor
4718bf4f76 Adjust the RegEx in wp_check_filetype() to be aware that query strings are thing that exist sometimes in URLs.
Adds unit tests.

Props voldemortensen.
Fixes #30377.

Built from https://develop.svn.wordpress.org/trunk@30640


git-svn-id: http://core.svn.wordpress.org/trunk@30630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 06:33:23 +00:00
Drew Jaynes
a1f244d454 Improve line-wrapping and formatting in the DocBlock for wp_send_json_error().
See #30469.

Built from https://develop.svn.wordpress.org/trunk@30614


git-svn-id: http://core.svn.wordpress.org/trunk@30604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 11:39:22 +00:00
Drew Jaynes
68432b0cd1 4.1 Docs Audit: Ensure optional arguments in wp_json_encode() are properly documented as such.
See #30469.

Built from https://develop.svn.wordpress.org/trunk@30613


git-svn-id: http://core.svn.wordpress.org/trunk@30603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 11:36:23 +00:00
Gary Pendergast
a62fc4e4e5 When json_encode() returns a JSON string containing 'null' in PHP 5.4 or earlier, wp_json_encode() will now sanity check the data, as older versions of PHP failed to encode non UTF-8 characters correctly, instead returning 'null'.
Fixes #30471.

Built from https://develop.svn.wordpress.org/trunk@30561


git-svn-id: http://core.svn.wordpress.org/trunk@30550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-25 05:01:23 +00:00
Drew Jaynes
07c58f5cca Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Markdown-indent a code snippet in the description for `_deprecated_argument()`
* Markdown-indent a code snippet in the description for `wp_localize_script()`
* Backtick-escape HTML tags in two parameter descriptions for `wp_register()`
* Various DocBlock formatting in the description for `get_bloginfo()`
* Remove HTML tag from the summary for `_wp_render_title_tag()`
* Backtick-escape a HTML tag in the description for `get_archives_link()`
* Markdown-indent a code snippet in the description for `wp_admin_css_color()`
* Markdown-indent a code snippet in the description for the `welcome_panel` hook

Props rarst.
See #30473.

Built from https://develop.svn.wordpress.org/trunk@30541


git-svn-id: http://core.svn.wordpress.org/trunk@30530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:39:22 +00:00
Drew Jaynes
0fb8811fb6 Improve return description for get_file_data() documentation.
Also convert an incorrect use of `@see` to `@link`.

Props 5um17 for the initial patch.
Fixes #30466.

Built from https://develop.svn.wordpress.org/trunk@30532


git-svn-id: http://core.svn.wordpress.org/trunk@30521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-23 17:57:22 +00:00
John Blackbourn
b66c58f76a Update the inline docs for wp_die() to reflect parameter changes made in r30355
See #10551

Built from https://develop.svn.wordpress.org/trunk@30507


git-svn-id: http://core.svn.wordpress.org/trunk@30496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 17:08:23 +00:00
John Blackbourn
53a9e3b420 Add support for WP_Error objects passed to wp_send_json_error(). The error object gets output as an array of error codes and messages, rather than as an empty object.
Fixes #28978
Props paulschreiber

Built from https://develop.svn.wordpress.org/trunk@30506


git-svn-id: http://core.svn.wordpress.org/trunk@30495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 16:56:23 +00:00
Drew Jaynes
5943966b69 Ensure the mixed type of string|int is reflected on the $title parameter in wp_die().
The ability to pass an error code as short-hand to the `$title` and `$args` parameters was added in r30355. Changes also include cleaned-up formatting and line-wraps for other documentation in the DocBlock.

See [30355]. Fixes #10551.

Built from https://develop.svn.wordpress.org/trunk@30379


git-svn-id: http://core.svn.wordpress.org/trunk@30376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-18 16:47:23 +00:00
John Blackbourn
d88ed475b0 Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors.
Fixes #10551
Props nacin

Built from https://develop.svn.wordpress.org/trunk@30356


git-svn-id: http://core.svn.wordpress.org/trunk@30355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-16 06:16:22 +00:00
John Blackbourn
5f30f13780 Allow the response code to be passed as a shorthand to the $title or $args parameter of wp_die(), for brevity.
See #10551 and #11286
Props nacin

Built from https://develop.svn.wordpress.org/trunk@30355


git-svn-id: http://core.svn.wordpress.org/trunk@30354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-16 06:11:22 +00:00
Boone Gorges
89526ca7f1 Ignore case when checking string 'false' in wp_validate_boolean().
Props TobiasBg, kitchin.
Fixes #30238.
Built from https://develop.svn.wordpress.org/trunk@30207


git-svn-id: http://core.svn.wordpress.org/trunk@30207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 15:55:23 +00:00
Scott Taylor
3e4ca28eb9 Correct the @param type for the $query arg for remove_query_arg().
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30191


git-svn-id: http://core.svn.wordpress.org/trunk@30191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:29:22 +00:00
Scott Taylor
fbd6efdfb8 In _wp_json_convert_string(), when $use_mb is false, perhaps pass a variable that actually exists to wp_check_invalid_utf8().
Introduced in [30055].
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30162


git-svn-id: http://core.svn.wordpress.org/trunk@30162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 22:00:24 +00:00
Drew Jaynes
66c47f29bb Correct references of @uses $wpdb in core documentation to use @global.
See #30191, [30105].
Fixes #30217.

Built from https://develop.svn.wordpress.org/trunk@30122


git-svn-id: http://core.svn.wordpress.org/trunk@30122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-31 17:56:22 +00:00
Drew Jaynes
f8657d5890 Remove redundant and erroneous @uses tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

Built from https://develop.svn.wordpress.org/trunk@30105


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Mark Jaquith
a81a321f9a Docs and code standards cleanup for [30055] (wp_json_encode() & friends)
fixes #28786
props TobiasBg
Built from https://develop.svn.wordpress.org/trunk@30078


git-svn-id: http://core.svn.wordpress.org/trunk@30078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:29:23 +00:00
Scott Taylor
315612a96b Adjust caching for get_term_by() calls:
* Remove md5 hashes for term name cache keys
* Remove the namespace for the keys for `names` and `slugs` and add them to the group names
* Remove `wp_get_last_changed()`, which @nacin hated
 
Props tollmanz.
Fixes #21760.

Built from https://develop.svn.wordpress.org/trunk@30073


git-svn-id: http://core.svn.wordpress.org/trunk@30073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:05:23 +00:00
Gary Pendergast
3495fa40df Fix a PHPDoc typo for wp_json_encode().
Props JustinSainton.

See #28786.

Built from https://develop.svn.wordpress.org/trunk@30058


git-svn-id: http://core.svn.wordpress.org/trunk@30058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:54:18 +00:00
Gary Pendergast
007ec52958 Add wp_json_encode(), a wrapper for json_encode() that ensures everything is converted to UTF-8.
Change all core calls from `json_encode()` to `wp_json_encode()`.

Fixes #28786.


Built from https://develop.svn.wordpress.org/trunk@30055


git-svn-id: http://core.svn.wordpress.org/trunk@30055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:35:19 +00:00
Scott Taylor
84a26a78a8 Cache get_term_by() calls:
* Add a helper function, `wp_get_last_changed()`, to retrieve a last-modified timestamp by cache group
* When caching a term, also make cache entries for slug and name via `slug:{$term_id}` and `name:{$term_id}` keys in the `$taxonomy:$last_changed` bucket that reference the term_id
* In `clean_term_cache()` and `update_term_cache()`, respect `$_wp_suspend_cache_invalidation`
* Original term cache entries maintain BC

Adds unit tests.

Props wonderboymusic, tollmanz, boonebgorges.
Fixes #21760.

Built from https://develop.svn.wordpress.org/trunk@29915


git-svn-id: http://core.svn.wordpress.org/trunk@29668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-16 04:45:17 +00:00
Scott Taylor
b98f03669c Allow PSDs (Photoshop documents) to be uploaded.
Props michalzuber, ccprice.
Fixes #28805.

Built from https://develop.svn.wordpress.org/trunk@29833


git-svn-id: http://core.svn.wordpress.org/trunk@29597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-03 19:52:17 +00:00
Mark Jaquith
0d3b83551f Use HTTPS URLs for core.trac.wordpress.org
see #27115
Built from https://develop.svn.wordpress.org/trunk@29788


git-svn-id: http://core.svn.wordpress.org/trunk@29560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 13:28:16 +00:00
Scott Taylor
491c91196f wp_extract_urls() needs to also grab URLs with query strings and hashes.
Updates unit test.

Props hauvong, dlh.
Fixes #29314.

Built from https://develop.svn.wordpress.org/trunk@29756


git-svn-id: http://core.svn.wordpress.org/trunk@29528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-23 02:50:19 +00:00
Scott Taylor
69dbf4f5df Clarify that get_the_date(), get_the_time(), get_post_time() and get_post_modified_time() should return false when get_post() is null.
Adds unit tests.

Props GaryJ, SergeyBiryukov, tollmanz.
Fixes #28310.

Built from https://develop.svn.wordpress.org/trunk@29344


git-svn-id: http://core.svn.wordpress.org/trunk@29122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-01 18:40:16 +00:00
Sergey Biryukov
aca4a37c1d Make sure phpinfo() is not disabled before calling it in apache_mod_loaded().
props rohan013, harmr.
fixes #26772.
Built from https://develop.svn.wordpress.org/trunk@29330


git-svn-id: http://core.svn.wordpress.org/trunk@29110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-30 17:28:17 +00:00
Dominik Schilling
241addd9ab Revert [28894] as it's currently unused in core.
see #28487.
Built from https://develop.svn.wordpress.org/trunk@29309


git-svn-id: http://core.svn.wordpress.org/trunk@29091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-27 17:16:17 +00:00
Drew Jaynes
c5a59037f1 Inline documentation cleanup for 4.0 audit.
Various improvements:
* Adds `@see` reference for `wp_list_comments()` in 'wp_list_comments_args' filter docs, added in [28285]
* Various phpDoc tweaks for the 'run_wptexturize' filter docs, added in [28715]
* Sentence and wrapping changes for `is_https_url()`, added in [28894]
* Documents the `$args` parameter for `wp_dropdown_languages()`, added in [29007]
* Adds a period to the parameter description for `_update_posts_count_on_delete()`, added in [28835]
* Documents a global in `is_customize_preview()`, added in [28999]
* phpDoc tweaks, adds an access modifier for `wpdb::esc_like()`, added in [28711]

See #28885.

Built from https://develop.svn.wordpress.org/trunk@29163


git-svn-id: http://core.svn.wordpress.org/trunk@28947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-14 01:02:15 +00:00
Drew Jaynes
f5b5b89e66 Fix inconsistent language in two function descriptions in wp-includes/functions.php.
Also adds correct coding standards to a code sample in `_deprecated_argument()`.

Props TobiasBg.
Fixes #26185.

Built from https://develop.svn.wordpress.org/trunk@29013


git-svn-id: http://core.svn.wordpress.org/trunk@28801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-07 07:08:15 +00:00
Drew Jaynes
9f8ddaa627 General inline documentation improvements in wp-includes/functions.php.
Final run. Fixes #26185.

Built from https://develop.svn.wordpress.org/trunk@29011


git-svn-id: http://core.svn.wordpress.org/trunk@28799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-07 06:19:14 +00:00
Sergey Biryukov
440c78d405 Some fixes for get_weekstartend() docs.
see #26185.
Built from https://develop.svn.wordpress.org/trunk@28937


git-svn-id: http://core.svn.wordpress.org/trunk@28735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-01 14:59:15 +00:00
Drew Jaynes
300c53e6fe General inline documentation improvements in wp-includes/functions.php.
Second run. See #26185.

Built from https://develop.svn.wordpress.org/trunk@28936


git-svn-id: http://core.svn.wordpress.org/trunk@28734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-01 01:44:15 +00:00
Sergey Biryukov
f7703c03d3 Remove free-spacing modifier and extra spaces from wp_extract_urls() pattern.
fixes #28222.
Built from https://develop.svn.wordpress.org/trunk@28933


git-svn-id: http://core.svn.wordpress.org/trunk@28731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 23:09:16 +00:00
Drew Jaynes
c97a364b79 General inline documentation improvements in wp-includes/functions.php.
First run. See #26185.

Built from https://develop.svn.wordpress.org/trunk@28918


git-svn-id: http://core.svn.wordpress.org/trunk@28717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 03:56:15 +00:00
Drew Jaynes
36be4e5703 Improve inline documentation for date_i18n(), _http_build_query(), wp_checkdate(), and wp_auth_check().
Props morganestes.
See #26185.

Built from https://develop.svn.wordpress.org/trunk@28917


git-svn-id: http://core.svn.wordpress.org/trunk@28716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 03:47:16 +00:00
Andrew Nacin
708f73ccc9 Add index key support for wp_list_pluck(), à la array_column().
props trepmal.
fixes #28666.

Built from https://develop.svn.wordpress.org/trunk@28900


git-svn-id: http://core.svn.wordpress.org/trunk@28699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 21:26:17 +00:00
John Blackbourn
de664966b0 Introduce is_https_url() for testing whether the scheme for a given URL is https. See #28487.
Built from https://develop.svn.wordpress.org/trunk@28894


git-svn-id: http://core.svn.wordpress.org/trunk@28693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 11:32:15 +00:00
Scott Taylor
0e3c4450cb wp_extract_urls() should not match dates.
Updates unit tests.

Props hinnerk, sergej.mueller.
Fixes #28222.

Built from https://develop.svn.wordpress.org/trunk@28882


git-svn-id: http://core.svn.wordpress.org/trunk@28681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 04:16:14 +00:00
Scott Taylor
a21d9cdacf Do not touch absint(). Reverts [28855].
Built from https://develop.svn.wordpress.org/trunk@28858


git-svn-id: http://core.svn.wordpress.org/trunk@28661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:45:14 +00:00
Scott Taylor
ff8e9774ae Revert [28856] at nacin's behest. See #23383.
Built from https://develop.svn.wordpress.org/trunk@28857


git-svn-id: http://core.svn.wordpress.org/trunk@28660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:34:15 +00:00
Scott Taylor
cd93bc05e5 absint() should always return PHP_INT_MAX if the resulting value exceeds it.
See [28855].
Fixes #23383.

Built from https://develop.svn.wordpress.org/trunk@28856


git-svn-id: http://core.svn.wordpress.org/trunk@28659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 18:24:15 +00:00
Scott Taylor
bae2b054ad Add a second optional parameter to absint() to limit the result to PHP_INT_MAX.
See #23383.

Built from https://develop.svn.wordpress.org/trunk@28855


git-svn-id: http://core.svn.wordpress.org/trunk@28658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 17:52:15 +00:00
Scott Taylor
4bcf6b2d6a Add mime support for 3gp, 3g2 and 3gpp video formats. These are not supported by MediaElement or the WP media shortcodes, just an FYI.
Props azaozz, m_uysl.
Fixes #23380.

Built from https://develop.svn.wordpress.org/trunk@28841


git-svn-id: http://core.svn.wordpress.org/trunk@28645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 01:43:15 +00:00