WordPress.org

Make WordPress Core

Changeset 1093 in tests


Ignore:
Timestamp:
10/25/12 20:47:00 (18 months ago)
Author:
nacin
Message:

Tests for an escaped %%f in a query string. props kurtpayne. see #WP19861.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/db.php

    r978 r1093  
    109109        $this->assertNull( $wpdb->nonexistent_property ); 
    110110    } 
     111 
     112    /** 
     113     * Test that an escaped %%f is not altered 
     114     * @ticket 19861 
     115     */ 
     116    public function test_double_escaped_placeholders() { 
     117        global $wpdb; 
     118        $sql = $wpdb->prepare( "UPDATE test_table SET string_column = '%%f is a float and %%d is an int and %%s is a string'" ); 
     119        $this->assertEquals( "UPDATE test_table SET string_column = '%f is a float and %d is an int and %s is a string'", $sql ); 
     120    } 
    111121} 
Note: See TracChangeset for help on using the changeset viewer.