Created
January 28, 2012 02:01
-
-
Save bhwebworks/1692086 to your computer and use it in GitHub Desktop.
Contact form Invalid Token patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($user->get('id') || ($viewnow == 'category' && $viewcache == 0)) { | |
$view->display(); | |
} else { | |
+ | |
+ // Workaround for token caching | |
+ if ($viewName == 'contact') | |
+ { | |
+ ob_start(); | |
+ } | |
+ | |
$option = JRequest::getCmd('option'); | |
$cache =& JFactory::getCache($option, 'view'); | |
$cache->get($view, 'display'); | |
+ | |
+ // Workaround for token caching | |
+ if ($viewName == 'contact') | |
+ { | |
+ $contents = ob_get_contents(); | |
+ ob_end_clean(); | |
+ | |
+ $token = JUtility::getToken(); | |
+ $search = '# | |
#'; | |
+ $replacement = ' | |
'; | |
+ | |
+ echo preg_replace($search, $replacement, $contents); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment