Commit Graph

24 Commits

Author SHA1 Message Date
Gary Pendergast 9dfde992ee Comments: Show the "awaiting moderation" message when comment cookies are disabled.
The "Your comment is awaiting moderation." message relied upon the comment author cookie being set. However, since it's now possible to opt-out of that cookie, submitting a comment won't show the comment preview when the comment is placed in moderation.

To avoid this issue, we now include a hash in the redirect URL, allowing the site to identify that a preview of the moderated comment should be displayed.

Props imath, tomdxw, birgire, lakenh, azaozz, pento.
Fixes #43857.



git-svn-id: https://develop.svn.wordpress.org/trunk@44659 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-21 01:33:50 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
John Blackbourn 37916c2a5f Comments: Update the inline docs following [42772].
See #43436


git-svn-id: https://develop.svn.wordpress.org/trunk@43042 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 13:09:21 +00:00
Andrew Ozz 65d8fe578a Add a checkbox to the comment form so logged out users can opt-out of commenter cookies.
Props lakenh, xkon, birgire, azaozz.
See #43436.

git-svn-id: https://develop.svn.wordpress.org/trunk@42772 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 16:40:43 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn 6b23bbb92b Comments: Add support for all HTTP protocol versions when returning a 405 from `wp-comments-post.php`.
Fixes #37863
Props tnash


git-svn-id: https://develop.svn.wordpress.org/trunk@38432 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-29 11:59:45 +00:00
Drew Jaynes a1ee08a6db Docs: Standardize filter docs in root folder files to use third-person singular verbs per the inline documentation standards for PHP.
Fixes #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37535 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-23 16:43:20 +00:00
Rachel Baker d95233cce9 Comments: Add a back link to `wp_die()` comment form submission error display.
Fixes #4332.

Props wonderboymusic, westonruter, shamess, rachelbaker.

git-svn-id: https://develop.svn.wordpress.org/trunk@36424 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-30 21:55:32 +00:00
Sergey Biryukov fb6b3313c7 Abstract functionality from `wp-comments-post.php` into a function, `wp_handle_comment_submission()`.
Add unit tests.

Props johnbillion.
Fixes #34059.

git-svn-id: https://develop.svn.wordpress.org/trunk@34799 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 14:46:09 +00:00
John Blackbourn 644632bec5 Revert the introduction of validation of the comment author's email address when sanity checking input in `wp-comments-post.php` (introduced in r34274). This allows a problematic email address to fall through to the correct validation routine and show the "Please enter a valid email address" as expected.
Fixes #23416


git-svn-id: https://develop.svn.wordpress.org/trunk@34693 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 17:26:44 +00:00
Scott Taylor c5963b8760 In `wp-comments-post.php`, sanity check a few of the comment inputs that are expected to be a string beford calling string-only functions on them.
Props Kloon.
Fixes #23416.


git-svn-id: https://develop.svn.wordpress.org/trunk@34274 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 22:21:06 +00:00
Scott Taylor 5cce4a3262 After [33961], pass `$comment` to `get_comment_link()` where possible to avoid extra cache/db lookups.
See #33638.


git-svn-id: https://develop.svn.wordpress.org/trunk@34042 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-11 06:20:56 +00:00
Scott Taylor 60ba8b05e4 Introduce `WP_Comment` class to model/strongly-type rows from the comments database table. Inclusion of this class is a pre-req for some more general comment cleanup and sanity.
* Takes inspiration from `WP_Post` and adds sanity to comment caching. 
* Clarifies when the current global value for `$comment` is returned. The current implementation in `get_comment()` introduces side effects and an occasion stale global value for `$comment` when comment caches are cleaned.
* Strongly-types `@param` docs
* This class is marked `final` for now

Props wonderboymusic, nacin.

See #32619.


git-svn-id: https://develop.svn.wordpress.org/trunk@33891 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-03 18:16:35 +00:00
Scott Taylor 6fd11624d1 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31090 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 07:04:40 +00:00
Dominik Schilling (ocean90) fb8588f115 Comments: Use proper HTTP response codes for validation errors.
props miqrogroove, solarissmoke, mackensen.
fixes #11286.

git-svn-id: https://develop.svn.wordpress.org/trunk@30579 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-26 20:16:47 +00:00
Sergey Biryukov c556e74943 wp_insert_comment() and wp_new_comment() should check if the comment was successfully inserted into the database.
props pento.
fixes #28254.

git-svn-id: https://develop.svn.wordpress.org/trunk@28672 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-05 04:37:02 +00:00
Sergey Biryukov 47510a2092 Correct @since value. see #26869.
git-svn-id: https://develop.svn.wordpress.org/trunk@27192 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-18 21:44:14 +00:00
Drew Jaynes 1fcb6036ca Fixes for inline documentation for hooks in wp-comments-post.php.
Adds missing `@since` versions, spacing, and language tweaks.

See #26869, #25229, [25249].


git-svn-id: https://develop.svn.wordpress.org/trunk@27144 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-09 20:11:34 +00:00
Andrew Nacin 37d92f4851 Short descriptions for inline docs should end with a period, per the vast majority of core. see #25229.
git-svn-id: https://develop.svn.wordpress.org/trunk@25273 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 01:37:59 +00:00
Andrew Nacin 48a9274146 Fixes for hook inline docs in wp-comments-post.php. see #25229.
git-svn-id: https://develop.svn.wordpress.org/trunk@25251 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-05 16:11:34 +00:00
Andrew Nacin 7a5e1a598f Inline documentation for hooks in wp-comments-post.php.
props rzen.
see #25229.


git-svn-id: https://develop.svn.wordpress.org/trunk@25249 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-05 16:04:17 +00:00
Jon Cave 8d72fd31d4 Initialize kses filters if _wp_unfiltered_html_comment nonce isn't set.
See #24752.


git-svn-id: https://develop.svn.wordpress.org/trunk@25137 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-27 13:56:17 +00:00
Sergey Biryukov 5615aef0bf Avoid an undefined index notice when submitting a comment with JavaScript disabled. fixes #24752.
git-svn-id: https://develop.svn.wordpress.org/trunk@25121 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-26 15:39:12 +00:00
Andrew Nacin b43712e0f7 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.



git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00