Ticket #3367 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Single quote around double quote mysql string breaks on OpenVMS HP-PHP

Reported by: WillemGrooters Assigned to: anonymous
Priority: normal Milestone: 2.0.6
Component: Optimization Version: 2.0.5
Severity: normal Keywords: has-patch
Cc:

Description

For having Wordpress run under OpenVMS, I would like to suggest a change to classes.php. lines 600-616: These lines contain a mixture of single and double quotes that the HP-PHP engine cannot handle. It's the only place where strings are delimited by single quotes, and values with double, like this (line 600)

if ( $this->is_attachment ) { $where .= ' AND (post_status = "attachment")';

This causes errors in accessing MySQL via PHP; the very same problem arises when the SQL-command is issues within PHPMyAdmin, though MYSQL itself has no trouble with it.

If this is changed so strings are delimited by double quotes and the values with single:

if ( $this->is_attachment ) { $where .= " AND (post_status = 'attachment')";

the problems are over. Secondly, this is more consistent to the rest of the code, for what I have examined.

Attachments

3367-patch.txt (1.1 kB) - added by foolswisdom on 11/17/06 22:28:14.
3367.diff (1.1 kB) - added by foolswisdom on 11/17/06 22:31:47.
Attaching again b/c .txt don't get the fancy diff when viewing attach

Change History

11/17/06 22:08:34 changed by foolswisdom

  • summary changed from Proposed change to Single quote around double quote mysql string breaks on OpenVMS HP-PHP.
  • milestone set to 2.1.

Hi Willem, thank you for participating in WordPress!

"Proposed change" is a really lousy bug Summary.

Next time please attach a patch (preferably also against trunk). I am working on patch now.

11/17/06 22:27:32 changed by foolswisdom

  • milestone changed from 2.1 to 2.0.5.

Problem does not exist in trunk, function is now in wp-includes/query.php and looks like the quotes have been fixed.

No milestone 2.0.6, putting ms to 2.0.5 for now.

11/17/06 22:28:14 changed by foolswisdom

  • attachment 3367-patch.txt added.

11/17/06 22:31:47 changed by foolswisdom

  • attachment 3367.diff added.

Attaching again b/c .txt don't get the fancy diff when viewing attach

11/17/06 22:32:48 changed by foolswisdom

  • keywords set to has-patch maint-candidate.

11/17/06 22:43:24 changed by foolswisdom

  • keywords changed from has-patch maint-candidate to has-patch.
  • milestone changed from 2.0.5 to 2.0.6.

11/19/06 07:41:13 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [4493]) Quote strings in SQL with single quotes instead of double quotes to be more correct and consistent. Props WillemGrooters?. fixes #3367