Opened 12 years ago
Closed 11 years ago
#30827 closed defect (bug) (fixed)
wp_can_install_language_pack(): Direct access to $upgrader->fs_connect() can produce undefined index notices
| Reported by: | ocean90 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | low | Milestone: | 4.2 |
| Component: | Filesystem API | Version: | 4.0 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Example: Notice: Undefined index: fs_no_content_dir in /src/wp-admin/includes/class-wp-upgrader.php on line 182
That's because the init() method isn't called here, which sets up the strings. We should either do $upgrader->init() or $upgrader->generic_strings().
Attachments (1)
Change History (8)
#2
@
12 years ago
@ocean90 What are the steps to reproduce the notices? I want to test your patch but am having trouble getting PHP to throw a notice during language pack installation.
This ticket was mentioned in Slack in #core by jorbin. View the logs.
12 years ago
#6
@
11 years ago
I'm so-so on including this in 4.1.1, I could go either way, unless someone feels strongly, lets close it on 4.2.
Realistically, it's only a PHP notice, and none of the strings missing should be needed during a translation install, it's also unlikely any other alterations will be made to this file in 4.1.1 (meaning one less file in a 4.1 -> 4.1.1 update).
Worst case, as @ocean90 hit here, the upgrade can't find the wp-content directory and it emits a PHP notice + fs_no_content_dir instead of a human-readable message.. a case that should be exceedingly rare.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I see no harm in fixing or not fixing this in 4.1.1.