Commit Graph

478 Commits

Author SHA1 Message Date
Gary Pendergast
a97462e755 Emoji: Rename the email and feed filter functions to be _ prefixed, and @ignore-d in the PHPDocs.
See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-16 10:46:26 +00:00
Sergey Biryukov
756e445a53 Fix typo in a comment in [31752].
see #31242.
Built from https://develop.svn.wordpress.org/trunk@31790


git-svn-id: http://core.svn.wordpress.org/trunk@31770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-16 01:56:27 +00:00
Drew Jaynes
f50307c5d8 Clean up some inline documentation for emoji functionality, including a missing @since for mail_emoji(), and a changelog entry for wp_insert_post().
See #31242.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-16 01:43:28 +00:00
Andrew Ozz
a7fd4a3774 Emoji:
- Add the styling for the replacement images to the admin CSS.
- Revert to using `.emoji` as replacement image class.
- When pasting in the editor, convert emoji images to our format so we can replace them with chars on saving.
- Some more clean up of both the plugin and wp-emoji.js.
See #31242.
Built from https://develop.svn.wordpress.org/trunk@31786


git-svn-id: http://core.svn.wordpress.org/trunk@31766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-15 23:16:29 +00:00
Gary Pendergast
ac61ac62cd Smilies: The new smilies added in [31733] and [31745] are larger than the old smilies. While this is taken care of by the CSS on normal pages, it means they're disproportionally large when seen in RSS and email.
By adding a little bit of inline style to them, we get pleasingly sized smilies everywhere. :-)

See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-15 11:41:27 +00:00
Sergey Biryukov
ac90f66250 Emoji and smiley images should be displayed inline.
see #31242.
Built from https://develop.svn.wordpress.org/trunk@31771


git-svn-id: http://core.svn.wordpress.org/trunk@31751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-13 18:45:27 +00:00
Gary Pendergast
351ea2d6f8 Emoji: There's a little tear in my eye as I remove DOMDocument from the Emoji staticizer. It was a beautiful dream, but it wasn't to be.
Instead, let's use the tried and trusted smiley replacement algorithm, which has stood the test of time.

See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-12 13:17:26 +00:00
Gary Pendergast
03ade8c011 Add emoji URL support, and Twemoji fallback for displaying slugs in wp-admin, when the browser doesn't natively support emoji.
Props pento, SergeyBiryukov and boonebgorges.

Fixes #31328


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


git-svn-id: http://core.svn.wordpress.org/trunk@31715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:55:28 +00:00
Gary Pendergast
46e2a65cf1 Add emoji support, with Twemoji fallback.
Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.

Props batmoo, joen and mkaz for the original plugin upon which this is based.

Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.

See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:49:28 +00:00
Scott Taylor
b4869ed42f Avoid function calls on each iteration of a for loop.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-08 23:01:26 +00:00
Scott Taylor
7cb45f2402 Don't call the size function count() as part of a test condition in loops. Compute the size beforehand, and not on each iteration.
Scrutinizer added a Performance label: these are the only violations.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-26 05:48:24 +00:00
Gary Pendergast
109d87363d Texturize: Add "em" as a cockney term, so that "'em" is texturized with an apostrophe, instead of an open quote.
Fixes #29813.

Props miqrogroove.


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


git-svn-id: http://core.svn.wordpress.org/trunk@31230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-20 18:44:26 +00:00
Gary Pendergast
d0c327443c When a hyphen - or double hyphen -- was at the start or the end of a string, it wasn't texturized correctly.
Fixes #31030


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


git-svn-id: http://core.svn.wordpress.org/trunk@31180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 03:54:24 +00:00
Scott Taylor
6b84df3bbd Ensure that <figcaption> is not autop'd.
Fixes #29219.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 00:27:21 +00:00
Scott Taylor
5547115dc2 Fix some @param docs that have chars too close them.
Add `@property` annotations to `WP_User` and `WP_Post`.
Remove erroneous `@param`s from image editor class methods.
Officially add the property `$_column_headers` to `WP_List_Table`.	

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 06:57: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
ac4e67b82e Perl-style comments should not be used
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 05:52:24 +00:00
Gary Pendergast
c20f6afb05 Options: When updating options, make sure the user isn't trying to insert characters that aren't supported by the database character set.
See #30361.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-07 04:15:23 +00:00
Scott Taylor
5eb5afac34 For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 22:47:22 +00:00
Dion Hulse
e0ac8c0386 In the links_add_base() callback, use a HTTP-aware URL joining function, rather than a filesystem joining function to avoid PHP warnings on certain systems.
Fixes #29950

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


git-svn-id: http://core.svn.wordpress.org/trunk@30756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-07 03:19:23 +00:00
Mark Jaquith
14b0899e57 Revert [28719] and no longer math-process multiplication of negative numbers
see #19308
fixes #30445
props rmccue
Built from https://develop.svn.wordpress.org/trunk@30752


git-svn-id: http://core.svn.wordpress.org/trunk@30742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-06 21:24:23 +00:00
Scott Taylor
e619abda6e Improve various @param docs for src/wp-includes/*.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 01:34:24 +00:00
Dion Hulse
aba2a6bcfd Fix the PHPDoc example for _split_str_by_whitespace().
Props voldemortensen. Fixes #30504

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


git-svn-id: http://core.svn.wordpress.org/trunk@30565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-26 03:52:22 +00:00
Drew Jaynes
39da8dd15e 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 in wp-includes/formatting.php:
* Markdown-indent code snippets in the description for `wptexturize()`
* Backtick-escape inline code in a parameter description for `_wptexturize_pushpop_element()`
* Backtick-escape inline code in the description for `shortcode_unautop()`
* Backtick-escape HTML tags in the description for `convert_chars()`
* Markdown-indent a code snippet in the description for `_split_str_by_whitespace()`
* Backtick-escape an `<img>` tag in the description for `translate_smiley()`
* Add markdown formatting to the description for `links_add_target()`
* Backtick-escape HTML tags in the description for `wp_strip_all_tags()`

Props rarst.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:30:25 +00:00
Drew Jaynes
2fda44cb77 Add an entry to the changelog for wp_make_link_relative() noting that intentional support was added for relative URLs.
See #30373.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 03:44:23 +00:00
Andrew Nacin
6e2f41a2a3 Anchor texturize to shortcodes to improve regex efficiency.
props miqrogroove.
see #29557 for segfault issues.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-20 14:28:23 +00:00
Boone Gorges
d95b5196cc Improvements to wp_make_link_relative().
* Support relative URL input.
* When the URL being made relative has another URL as a parameter, don't make the second URL relative.

Props voldemortensen.
Fixes #30373.
Built from https://develop.svn.wordpress.org/trunk@30383


git-svn-id: http://core.svn.wordpress.org/trunk@30380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-19 01:53:24 +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
Sergey Biryukov
20cfcbf86d Fix whitespace issues in [29781]. Remove a redundant comment.
props miqrogroove.
see #29557.
Built from https://develop.svn.wordpress.org/trunk@29873


git-svn-id: http://core.svn.wordpress.org/trunk@29632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-11 02:33:18 +00:00
Scott Taylor
37a0c36d38 The joys of wptexturize():
* Revert parts of [28773] and [28727] and [29748].
* Do not crash PHP. Make the shortcode quantifier possessive to avoid backtracks.
* Reduce backtracking in long HTML comments by 100x.
* Do not ignore unclosed HTML comments.
* Do not break unregistered shortcodes, e.g. `[hello attr="value"]`.
* Do not break HTML in shortcode attributes, e.g. `[hello attr="<"]`.
* Do not match for shortcodes when there is extra whitespace, e.g. `[ hello ]`.
* Add unit tests to show #12690 was not fully resolved.
* Tested PHP 5.2.4, 5.2.13, 5.4.32, and 5.5.8.

Adds/modifies unit tests.

Props miqrogroove.
See #29557.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 04:07:15 +00:00
Scott Taylor
0a848a6171 wptexturize() improvements:
* Expand the `wptexturize()` RegEx to include the list of registered shortcodes.
* Avoid backtracking after `[` chars by not filtering params in registered shortcodes. This will cause escaped shortcodes and their params to become texturized if not registered.
* Registered shortcode params will never be texturized, even when escaped.
* Move all tests involving unregistered shortcodes to a new and improved unit.
* Update one test involving HTML within shortcode params.

Props miqrogroove.
See #29557.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-17 15:14:17 +00:00
Sergey Biryukov
93903a2a81 Check for [\r\n\t ] instead of \s in sanitize_file_name() to avoid UTF-8 issues.
props p_enrique.
fixes #26094.
Built from https://develop.svn.wordpress.org/trunk@29715


git-svn-id: http://core.svn.wordpress.org/trunk@29489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-07 08:33:16 +00:00
Andrew Nacin
f7392ef917 Pinking shears.
Built from https://develop.svn.wordpress.org/trunk@29707


git-svn-id: http://core.svn.wordpress.org/trunk@29481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-04 15:23:16 +00:00
Andrew Nacin
9db108dbe0 Allow language specified by the WPLANG constant (but not installed) to be chosen.
fixes #29456.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-03 08:03:16 +00:00
Drew Jaynes
d33c807723 Fix some documentation typos in various core files.
Props vlajos.
Fixes #29199.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-13 03:56:17 +00:00
Scott Taylor
6b3251e931 wptexturize: After [28727], leverage RegeEx possessives (++) to improve performance and avoid libpcre segfaults.
Props kovshenin.
Fixes #12690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 19:11:18 +00:00
Andrew Ozz
004da2f6ba Formatting: make the removal of white space around <option> greedy, see #28217.
Built from https://develop.svn.wordpress.org/trunk@29316


git-svn-id: http://core.svn.wordpress.org/trunk@29097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-28 19:55:16 +00:00
Andrew Ozz
ad0f539621 Formatting: no <p> or <br> around <option> tags in both flavours of wpautop, make "selects" easier to read in the Text editor. Fixes #28217.
Built from https://develop.svn.wordpress.org/trunk@29315


git-svn-id: http://core.svn.wordpress.org/trunk@29096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-28 19:44:18 +00:00
Scott Taylor
a14f5b97d5 In sanitize_file_name(), replace %20 and + with dashes. Remove unnecessary code from _wp_handle_upload().
Adds unit tests.

Props ericmann.
Fixes #16330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 22:09:16 +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
Sergey Biryukov
8d358a16c3 Exclude a newline between delimeters from further checks in wptexturize() for better performance.
props miqrogroove.
fixes #28724.
Built from https://develop.svn.wordpress.org/trunk@29008


git-svn-id: http://core.svn.wordpress.org/trunk@28796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-06 08:50:18 +00:00
Scott Taylor
5eb23f8e3c Optimize regexp usage in wptexturize() for a "3x Performance Boost."
Props miqrogroove.
See #28724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-04 01:15:15 +00:00
John Blackbourn
fd2d2ebb2e Correct typo in sanitize_html_class() docblock.
Built from https://develop.svn.wordpress.org/trunk@28973


git-svn-id: http://core.svn.wordpress.org/trunk@28762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-03 16:58:16 +00:00
Sergey Biryukov
c6c1f56d60 Fix texturization of quotes when enclosed by angle brackets.
props miqrogroove.
fixes #28718.
Built from https://develop.svn.wordpress.org/trunk@28971


git-svn-id: http://core.svn.wordpress.org/trunk@28760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-03 16:22:14 +00:00
Scott Taylor
a71d57da0a Remove obsolete comment in wptexturize().
http://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2014-06-30&sort=asc#m879104

See [28831].

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


git-svn-id: http://core.svn.wordpress.org/trunk@28727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 17:59:14 +00:00
Scott Taylor
9997f77d7f Use less greedy regex in wptexturize(). Adds unit tests.
Props miqrogroove.
See #28564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 17:15:14 +00:00
Scott Taylor
8c39368644 Optimize the wptexturize() loop:
* Take the ampersand pattern out of the loop for speed.
* Fix old bugs in the ampersand pattern.
* Refactor `_wptexturize_pushpop_element()` without PCRE for speed.
* Update unit tests.

Props miqrogroove.
Fixes #28623.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-25 17:49:14 +00:00
Scott Taylor
856e5ef55e Remove noscript from wpautop()'s list of block elements.
Props mdawaffe.
Fixes #27268.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-24 00:54:17 +00:00
Sergey Biryukov
8b272f4379 Remove mbstring_binary_safe_strlen(). Use mbstring_binary_safe_encoding() and reset_mbstring_encoding() directly.
fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28808


git-svn-id: http://core.svn.wordpress.org/trunk@28617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 22:21:15 +00:00
Sergey Biryukov
9ceb642b2a Introduce a binary-safe wrapper for strlen() and use it in seems_utf8(), utf8_uri_encode(), and wp_read_image_metadata().
Use binary-safe POMO_Reader::strlen() in MO::export_to_file_handle().

fixes #28162.
Built from https://develop.svn.wordpress.org/trunk@28806


git-svn-id: http://core.svn.wordpress.org/trunk@28615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-23 14:48:14 +00:00