Commit Graph

22 Commits

Author SHA1 Message Date
Sergey Biryukov 7ef97cfb10 Mail: Make the check for empty post title in `wp-mail.php` more resilient.
This addresses a regression in [47054], which caused posts sent via email to published with an empty title.

Props whyisjake, Otto42, MarkRH, MattyRob, mukesh27, afragen, pikamander2.
Fixes #49853.

git-svn-id: https://develop.svn.wordpress.org/trunk@47580 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-14 11:30:35 +00:00
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov f243dc38c0 Coding Standards: Use strict comparison and Yoda conditions in the root directory files.
Props pikamander2.
Fixes #48965.

git-svn-id: https://develop.svn.wordpress.org/trunk@47054 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-09 00:53:29 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Gary Pendergast 6b61c34ded Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45599 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 01:44:41 +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
Jeremy Felt 3cc0ac5f37 Mail: Disable wp-mail.php when `mailserver_url` is mail.example.com.
git-svn-id: https://develop.svn.wordpress.org/trunk@39772 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 05:12:01 +00:00
John Blackbourn 347040745d I18n: Introduce more translator comments for strings that contain placeholders but don't have an accompanying translator comment.
See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39326 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 02:45:53 +00:00
Scott Taylor cba0e2c8f7 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38470 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 16:30:48 +00:00
Scott Taylor 4225e71a6b Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38411 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 22:31:11 +00:00
Dion Hulse e353179ce5 Bootstrap: Revert [38399] as it's broken `/build/` and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335


git-svn-id: https://develop.svn.wordpress.org/trunk@38402 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 14:36:42 +00:00
Scott Taylor 388690382c Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38399 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 09:15:01 +00:00
Sergey Biryukov c913fc4c23 WP Mail: If post-by-email functionality is disabled, `wp-mail.php` should return a `403 Forbidden` status code instead if `500 Internal Server Error`.
Props Presskopp, tomdxw.
Fixes #37572.

git-svn-id: https://develop.svn.wordpress.org/trunk@38332 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 14:01:16 +00:00
Dominik Schilling 2f89742973 WP Mail: Remove an unused variable.
Unused since [34864].

Props vishalkakadiya.
Fixes #37346.

git-svn-id: https://develop.svn.wordpress.org/trunk@38045 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-13 12:36:22 +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
Scott Taylor f8b7bba8f6 WP Mail: replace logic that was mimicking `strtotime()` with `strtotime()`. Without this, the date parsing wasn't accounting for half-hour and quarter-hour timezones.
Props neoscrib, solarissmoke.
Fixes #16993.


git-svn-id: https://develop.svn.wordpress.org/trunk@34864 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-06 14:06:26 +00:00
Scott Taylor 2161a20a68 WP Mail: Avoid using HTML tags in translation strings, add translator strings.
Props ramiy.	
Fixes #31871.


git-svn-id: https://develop.svn.wordpress.org/trunk@34343 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-20 02:52:49 +00:00
Drew Jaynes (DrewAPicture) 161266c17d Fix syntax for single- and multi-line comments in root-directory files.
See #28931.


git-svn-id: https://develop.svn.wordpress.org/trunk@29205 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-17 09:11:46 +00:00
Sergey Biryukov 4006e4a233 Inline documentation for hooks in wp-mail.php.
props kpdesign, radices.
fixes #25551.

git-svn-id: https://develop.svn.wordpress.org/trunk@26129 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 11:57:11 +00:00
Andrew Nacin c87ad6023d Spell out duplicate hook locations.
props DrewAPicture.
fixes #25658.


git-svn-id: https://develop.svn.wordpress.org/trunk@25868 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-22 17:21:32 +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