Skip to content

Instantly share code, notes, and snippets.

@dingzj
Created July 25, 2015 04:13
Show Gist options
  • Save dingzj/67262a0ea3a3e519ef2f to your computer and use it in GitHub Desktop.
Save dingzj/67262a0ea3a3e519ef2f to your computer and use it in GitHub Desktop.
diff -r qtranslate-x/qtranslate_core.php /home/deployer/tmp/qtranslate-x/qtranslate_core.php
12a13
>
499c500
< return trailingslashit(content_url()).$q_config['flag_location'];
---
> return trailingslashit(WP_CONTENT_URL).$q_config['flag_location'];
diff -r qtranslate-x/qtranslate_utils.php /home/deployer/tmp/qtranslate-x/qtranslate_utils.php
219,232c219
< // PATCH for redirection in nginx for rule like location / {try_files $uri /index.php?q=$uri&$args; }
< // where such rule can lead to infinite loop
< // because different uri_orig (e.g. SERVER[REQUEST_URI]) vs url_lang(E.G. SERVER[QUERY_STRING])
< if(!empty($urlinfo['query'])) {
< if(!empty($urlinfo['wp-path'])) {
< $match = "q=".$urlinfo['wp-path'];
< $len_match = strlen($match);
< // replace q=uri with emptry from query
< if ( substr($urlinfo['query'], 0, $len_match) == $match )
< $urlinfo['query'] = substr($urlinfo['query'], $len_match);
< }
< $urlinfo['query'] = preg_replace('/^[#?&]/', '', $urlinfo['query']);
< $url .= '?'.$urlinfo['query'];
< }
---
> if(!empty($urlinfo['query'])) $url .= '?'.$urlinfo['query'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment