Changeset 9073 for trunk/src/bp-core/bp-core-filters.php
- Timestamp:
- 10/08/2014 02:14:29 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-filters.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-filters.php
r9001 r9073 604 604 */ 605 605 function bp_filter_metaid_column_name( $q ) { 606 return str_replace( 'meta_id', 'id', $q ); 606 /* 607 * Replace quoted content with __QUOTE__ to avoid false positives. 608 * This regular expression will match nested quotes. 609 */ 610 $quoted_regex = "/'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'/s"; 611 preg_match_all( $quoted_regex, $q, $quoted_matches ); 612 $q = preg_replace( $quoted_regex, '__QUOTE__', $q ); 613 614 $q = str_replace( 'meta_id', 'id', $q ); 615 616 // Put quoted content back into the string. 617 if ( ! empty( $quoted_matches[0] ) ) { 618 for ( $i = 0; $i < count( $quoted_matches[0] ); $i++ ) { 619 $quote_pos = strpos( $q, '__QUOTE__' ); 620 $q = substr_replace( $q, $quoted_matches[0][ $i ], $quote_pos, 9 ); 621 } 622 } 623 624 return $q; 607 625 } 608 626
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)