Commit Graph

45 Commits

Author SHA1 Message Date
Drew Jaynes (DrewAPicture)
a22e8b5354 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:
* Backtick-escape code snippets in the description for `get_object_taxonomies()`
* Backtick-escape inline code in a markdown-formatted unordered list in the description for `get_taxonomy_labels()`
* Remove an HTML tag from the summary for the `Walker_Category_Checklist` class
* Remove an HTML tag from the summary for `wp_category_checklist()`, various formatting
* Remove an HTML tag from the summary for `wp_terms_checklist()`
* Backtick-escape an HTML tag in the description for `wp_popular_terms_checklist()`
* Remove HTML tags from the summaries for `page_template_dropdown()`, `parent_dropdown()`, and `wp_dropdown_roles()`
* Backtick-escape HTML tags in a parameter description for `add_settings_error()`
* Various formatting in the description and summary for `settings_errors()`
* Markdown-indent code snippets in the descriptions for `wpdb::prepare()`, `wpdb::insert()`, `wpdb::replace()`, `wpdb::update()`, and `wpdb::delete()`
* Backtick-escape an HTML tag in a parameter description for `login_header()`
* Remove HTML tags from the summaries for the `lostpassword_form` and `signup_header` hooks

Props rarst.
See #30473.


git-svn-id: https://develop.svn.wordpress.org/trunk@30546 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-24 06:30:19 +00:00
Gary Pendergast
cabcace53c WPDB: Force STRICT_ALL_TABLES to be enabled as soon as we connect to the MySQL server.
This improves data integrity when inserting and updating rows in the database, particularly when trying to insert emoji into posts stored with character sets that don't support emoji.

See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30400 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 01:45:10 +00:00
Gary Pendergast
de33d35d1f WPDB: When a db.php drop-in is being used, and it doesn't explicitly define itself as connecting to MySQL, skip the character set checks. This ensures that existing drop-ins won't accidentally run checks that they don't support.
See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30375 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-18 03:37:23 +00:00
Gary Pendergast
54b2f32180 WPDB: When removing invalid characters from utf8 strings in older versions of PHP, the regex was too large to be compiled.
See #21212


git-svn-id: https://develop.svn.wordpress.org/trunk@30366 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-17 11:57:46 +00:00
Gary Pendergast
6df14c1612 When creating a post containing emoji, the post can be saved incorrectly if MySQL isn't using a character set that supports emoji.
This change prevents the save from occurring, so it can be handled correctly in the UI.

See #21212.


git-svn-id: https://develop.svn.wordpress.org/trunk@30345 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-14 21:27:17 +00:00
Gary Pendergast
c2fb136b47 wpdb: When flushing results on a mysqli connection, make sure that wpdb::$dbh is a valid mysqli connection handle.
Fixes a unit test failure introduced in [30297].

Fixes #28155.

Props soulseekah.



git-svn-id: https://develop.svn.wordpress.org/trunk@30299 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 02:16:19 +00:00
Gary Pendergast
4b1aa89206 wpdb::flush() was not flushing results correctly when using mysqli.
This change also allows stored procedures or queries made with `mysqli_multi_query()` to be flushed.

Includes unit tests.

Fixes #28155.

Props soulseekah.


git-svn-id: https://develop.svn.wordpress.org/trunk@30297 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 05:39:50 +00:00
Gary Pendergast
3b3a33b583 WPDB's __get() function should perform strict comparisons against member names
git-svn-id: https://develop.svn.wordpress.org/trunk@30292 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-09 12:03:31 +00:00
Drew Jaynes (DrewAPicture)
3cc10d77a0 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@30105 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-30 01:04:55 +00:00
Sergey Biryukov
937d5cdd11 Translate some previously untranslated _doing_it_wrong() messages.
props georgestephanis.
fixes #25614.

git-svn-id: https://develop.svn.wordpress.org/trunk@29840 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-05 21:05:54 +00:00
Mark Jaquith
7063377539 Use HTTPS URLs for core.trac.wordpress.org
see #27115

git-svn-id: https://develop.svn.wordpress.org/trunk@29788 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-29 13:27:55 +00:00
Sergey Biryukov
2a050d1e6f Remove unnecessary semicolon.
props ixkaito.
fixes #29784.

git-svn-id: https://develop.svn.wordpress.org/trunk@29784 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-29 10:29:16 +00:00
Andrew Nacin
1cde8312b6 DB: Revert [28814] and require a WHERE for wpdb::update().
see #26106.


git-svn-id: https://develop.svn.wordpress.org/trunk@29664 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-02 04:55:17 +00:00
Drew Jaynes (DrewAPicture)
7ad77d58ee Add periods to short descriptions for magic methods added in [28501], [28521], and [28524].
See #22234 and #28885.


git-svn-id: https://develop.svn.wordpress.org/trunk@29165 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-14 01:11:55 +00:00
Drew Jaynes (DrewAPicture)
551f829c55 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@29163 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-14 01:01:22 +00:00
Andrew Nacin
a7c3b23f1c Simplify the setup-config.php UI flow and load process.
When no configuration file is detected, we now redirect to setup-config.php. This process now uses the WordPress bootstrap, rather than a set of fragile hacks.

fixes #28740.


git-svn-id: https://develop.svn.wordpress.org/trunk@28978 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 19:56:37 +00:00
Scott Taylor
220fda0095 In $wpdb->update(), prevent explosions when $where is empty.
Adds unit tests.

Props UmeshSingla, wonderboymusic.
Fixes #26106


git-svn-id: https://develop.svn.wordpress.org/trunk@28814 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-24 00:23:09 +00:00
Scott Taylor
2a551f57a4 LIKE escape sanity:
* Deprecate `like_escape()`
* Add a method to `$wpdb`, `->esc_like()`, and add unit tests

`$wpdb::esc_like()` is not used yet. As such, many unit tests will throw `Unexpected deprecated notice for like_escape`. Subsequent commits will alleviate this.

Props miqrogroove.
See #10041.


git-svn-id: https://develop.svn.wordpress.org/trunk@28711 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-10 00:29:35 +00:00
Drew Jaynes (DrewAPicture)
85961d28df Mark the MYSQL_NEW_LINK constant as deprecated in 3.9+ as no equivalent to the $new_link parameter exists in mysqli_* functions.
Fixes #27933.


git-svn-id: https://develop.svn.wordpress.org/trunk@28657 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-04 05:00:00 +00:00
Scott Taylor
02a28ec4e9 In wpdb, make some things explicitly public. Do not set anything to private. This would instantly blow up hyperdb in the wild.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28526 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 15:35:29 +00:00
Scott Taylor
4bddd84276 In wpdb, remove dead code:
* In `->tables()`, `break` is unreachable after `return`
* In `->query()`, `$return` is always set, so doesn't need an initial value of `0`
* In `->delete()`, `$bits` is unused

See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28339 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-07 03:55:32 +00:00
Drew Jaynes (DrewAPicture)
5ad1751132 Improve inline documentation for the wpdb::$show_errors property.
Note that SQL/DB errors are displayed by default if both WP_DEBUG and WP_DEBUG_DISPLAY evaluate to true.

Props ericlewis.
Fixes #16615.


git-svn-id: https://develop.svn.wordpress.org/trunk@28243 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-02 12:18:07 +00:00
Andrew Nacin
82bc9c1142 Rename USE_EXT_MYSQL to WP_USE_EXT_MYSQL. see #21663.
git-svn-id: https://develop.svn.wordpress.org/trunk@28022 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-07 22:26:19 +00:00
Drew Jaynes (DrewAPicture)
aba414af7e PHPDoc fixes for functionality in wp-includes/wp-db.php added in 3.9.
See #27700.


git-svn-id: https://develop.svn.wordpress.org/trunk@28016 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-07 22:01:37 +00:00
Andrew Nacin
f9e150c068 wpdb: Don't pass a second argument to mysqli_fetch_field().
props pento.
fixes #27693.


git-svn-id: https://develop.svn.wordpress.org/trunk@28002 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-07 20:21:16 +00:00
Andrew Nacin
ccb4f3714a Database: Fall back from ext/mysqli to ext/mysql if the connection fails.
This allows us to avoid breaking a site that works under ext/mysql but is misconfigured for ext/mysqli.

props pento.
see #21663.


git-svn-id: https://develop.svn.wordpress.org/trunk@27935 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-03 21:57:22 +00:00
Andrew Nacin
0faaacc7c8 Database: Add $allow_bail argument to wpdb::check_connection() to match the connect method.
props DrProtocols, pento.
fixes #27240.


git-svn-id: https://develop.svn.wordpress.org/trunk@27925 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-03 04:05:31 +00:00
Sergey Biryukov
28dd458547 Avoid a warning in wpdb::db_connect(). before_needle parameter of strstr() was added in PHP 5.3.
props klihelp, pento.
fixes #27277.

git-svn-id: https://develop.svn.wordpress.org/trunk@27503 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-11 19:26:02 +00:00
Andrew Nacin
79143bfed1 Make OBJECT a case sensitive constant, for HHVM compatibility and general sanity.
Support `object` explicitly, and other forms using a fallback in wpdb.

fixes #27231.


git-svn-id: https://develop.svn.wordpress.org/trunk@27377 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 17:35:12 +00:00
Andrew Nacin
f3a23fb43f Reference https://wordpress.org rather than http://wordpress.org in strings, links, comments, etc.
props Ipstenu, markjaquith.
see #27115.


git-svn-id: https://develop.svn.wordpress.org/trunk@27369 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 02:33:24 +00:00
Andrew Nacin
544b73ec4c When failing to reconnect to a server that has gone away, simply fail the query once we've passed template_redirect, rather than wp_die().
props pento.
see #5932.


git-svn-id: https://develop.svn.wordpress.org/trunk@27279 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 04:53:21 +00:00
Andrew Nacin
73ad0a310a Add a constant to disable mysqli for testing purposes. see #21663.
git-svn-id: https://develop.svn.wordpress.org/trunk@27278 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 04:19:45 +00:00
Andrew Nacin
b84ed60fa9 wpdb: set dbh to null when the mysqli connection fails. see #21663.
git-svn-id: https://develop.svn.wordpress.org/trunk@27277 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 04:14:54 +00:00
Andrew Nacin
19d7d1dd09 Use mysqli for WordPress development versions, regardless of PHP version, to increase testing footprint.
Allow the lack of ext/mysql to pass wp_check_php_mysql_versions().

see #21663.


git-svn-id: https://develop.svn.wordpress.org/trunk@27257 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 15:52:48 +00:00
Andrew Nacin
f8af178264 Use ext/mysqli in PHP 5.5 or greater. Expect minor explosions.
props aaroncampbell, pento.
see #21663.


git-svn-id: https://develop.svn.wordpress.org/trunk@27250 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 00:39:28 +00:00
Andrew Nacin
c61accb146 Declare $wpdb->base_prefix.
props DavidAnderson.
fixes #16762.


git-svn-id: https://develop.svn.wordpress.org/trunk@27249 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 00:29:01 +00:00
Drew Jaynes
b013aaf4c9 Fixes for hooks documentation in wp-includes/wp-db.php.
See #26869, #25229 and [25284].


git-svn-id: https://develop.svn.wordpress.org/trunk@27147 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-09 20:50:42 +00:00
Andrew Nacin
194d6a94b7 When the MySQL server has "gone away," attempt to reconnect and retry the query.
props pento.
see #5932.


git-svn-id: https://develop.svn.wordpress.org/trunk@27075 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 22:06:42 +00:00
Andrew Nacin
e993ef0249 Add a comment for [27073] as someone will inevitably complain it is tricked by % in a string. see #25604.
git-svn-id: https://develop.svn.wordpress.org/trunk@27074 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 21:47:58 +00:00
Andrew Nacin
435df55864 Throw an incorrect usage notice when the query argument of wpdb::prepare() does not include a placeholder.
props ounziw.
fixes #25604.


git-svn-id: https://develop.svn.wordpress.org/trunk@27073 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 21:46:07 +00:00
Andrew Nacin
0558df56ce Ensure compatibility with MySQL 5.6 which has stricter SQL modes by default.
Disables NO_ZERO_DATE, ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, STRICT_ALL_TABLES, TRADITIONAL. Introduces wpdb::set_sql_mode() with an incompatible_sql_modes filter so a plugin can alter the set mode after the fact.

props pento.
fixes #26847.


git-svn-id: https://develop.svn.wordpress.org/trunk@27072 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-02 21:38:34 +00:00
Scott Taylor
62b57d8899 In wpdb::db_connect(), allow the loading of a custom database error template - this is already allowed in dead_db().
In `dead_db()`, move the call to `wp_load_translations_early()` before the inclusion of the `db-error.php` file to allow translation in both locations before the template is loaded.

Props sbruner, kovshenin.
Fixes #25703.



git-svn-id: https://develop.svn.wordpress.org/trunk@27056 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-29 05:27:24 +00:00
Scott Taylor
50edc63cc9 When WP_DEBUG is set to true, suppress deprecated errors from firing when calling mysql_connect(), which is officially deprecated in PHP 5.5. We will remove this shameful code as soon as is humanly possible.
Props wonderboymusic. Extra love to tierra and nacin.
Fixes #26322.



git-svn-id: https://develop.svn.wordpress.org/trunk@26512 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-02 00:08:57 +00:00
Andrew Nacin
8a0ac73f60 Document the 'query' filter in wp-db.
props natejacobs.
see #25229.


git-svn-id: https://develop.svn.wordpress.org/trunk@25284 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 17:07:00 +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