WP Db Abstraction
[resolved] Fix problems with Backslash Usage (3 posts)

  1. mauridb
    Posted 3 years ago #

    If you try to use Backslash in a post, it will skrew up the query rewriting and as a result your post won't be saved.

    In order to fix this I've used this patch that needs to be applied to the \wp-content\mu-plugins\wp-db-abstraction\translations\sqlsrv file at the function "translate":

    After the line 208

    $this->preg_original = $query = trim($query);

    insert the following code

    // Remove backslash in order to avoid problems with rewriting
    $query = str_replace('\\', '& # 9 2;', $query);

    and before the line

    // debug code
    // file_put_contents[...];
    return $query;

    insert the following code

    // Add backslash again
    $query = str_replace('& # 9 2;', '\\', $query);

    Please note that the spaces in the replace string has been added only to prevent this forum to turn the encoded value into the HTML equivalent (the backslash), so you should remove it in your code.


  2. Runner73
    Posted 3 years ago #

    this is a very usefull fix. With this fix I resolved the problem of pagination on different theme.
    Very regards.

  3. seefeld
    Posted 3 years ago #

    Great tip for those of use using WordPress on SQL! Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Db Abstraction
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic