Advertisement
Guest User

Untitled

a guest
Sep 6th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.45 KB | None | 0 0
  1. diff --git a/src/web/WebRenderer.C b/src/web/WebRenderer.C
  2. index 31586da..cdfb151 100644
  3. --- a/src/web/WebRenderer.C
  4. +++ b/src/web/WebRenderer.C
  5. @@ -219,12 +219,12 @@ void WebRenderer::streamRedirectJS(std::ostream& out,
  6.    if (session_.app() && session_.app()->internalPathIsChanged_)
  7.      out << "if (window." << session_.app()->javaScriptClass() << ") "
  8.     << session_.app()->javaScriptClass()
  9. -   << "._p_.setHash('" << session_.app()->internalPath() << "');\n";
  10. +   << "._p_.setHash('" << boost::algorithm::replace_all_copy(session_.app()->internalPath(), "'", "\\'") << "');\n";
  11.    out <<
  12.      "if (window.location.replace)"
  13. -    " window.location.replace('" << redirect << "');"
  14. +    " window.location.replace('" << boost::algorithm::replace_all_copy(redirect, "'", "\\'") << "');"
  15.      "else"
  16. -    " window.location.href='" << redirect << "';\n";
  17. +    " window.location.href='" << boost::algorithm::replace_all_copy(redirect, "'", "\\'") << "';\n";
  18.  }
  19.  
  20.  void WebRenderer::serveResponse(WebResponse& response)
  21. @@ -1617,7 +1617,7 @@ void WebRenderer::collectJS(std::ostream* js)
  22.  
  23.      if (app->internalPathIsChanged_) {
  24.        *js << app->javaScriptClass()
  25. -     << "._p_.setHash('" << app->newInternalPath_ << "');\n";
  26. +     << "._p_.setHash('" << boost::algorithm::replace_all_copy(app->newInternalPath_, "'", "\\'") << "');\n";
  27.        if (!preLearning() && !app->environment().hashInternalPaths())
  28.     session_.setPagePathInfo(app->newInternalPath_);
  29.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement