From: <ny...@us...> - 2010-10-06 09:53:21
|
Revision: 29826 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=29826&view=rev Author: nyloth Date: 2010-10-06 09:53:11 +0000 (Wed, 06 Oct 2010) Log Message: ----------- [FIX] Loses the session when creating a page with the character exclamation mark in the name (tested using https). Modified Paths: -------------- branches/6.x/tiki-editpage.php Modified: branches/6.x/tiki-editpage.php =================================================================== --- branches/6.x/tiki-editpage.php 2010-10-06 07:48:40 UTC (rev 29825) +++ branches/6.x/tiki-editpage.php 2010-10-06 09:53:11 UTC (rev 29826) @@ -169,6 +169,9 @@ $_REQUEST['edit']=$info['data']."\n".$_REQUEST['copypaste']; } +// String use to lock the page currently edit. +$editLockPageId = 'edit_lock_' . (isset($info['page_id']) ? (int) $info['page_id'] : 0); + // 2010-01-26: Keep in active until translation refactoring is done. if ($editlib->isNewTranslationMode() || $editlib->isUpdateTranslationMode()) { $editlib->prepareTranslationData(); @@ -254,7 +257,7 @@ $page = $approvedPageName; } - $tikilib->semaphore_unset($page, $_SESSION["edit_lock_$page"]); + $tikilib->semaphore_unset($page, $_SESSION[$editLockPageId]); if (!empty($_REQUEST['returnto'])) { // came from wikiplugin_include.php edit button $url = "location:".$wikilib->sefurl($_REQUEST['returnto']); } else { @@ -322,13 +325,13 @@ if ($tikilib->semaphore_is_set($page, $prefs['warn_on_edit_time'] * 60) && $tikilib->get_semaphore_user($page) !== $u) { $editpageconflict = 'y'; } elseif ($tiki_p_edit === 'y') { - $_SESSION["edit_lock_$page"] = $tikilib->semaphore_set($page); + $_SESSION[$editLockPageId] = $tikilib->semaphore_set($page); } $semUser = $tikilib->get_semaphore_user($page); $beingedited = 'y'; } else { - if (!empty($_SESSION["edit_lock_$page"])) { - $tikilib->semaphore_unset($page, $_SESSION["edit_lock_$page"]); + if (!empty($_SESSION[$editLockPageId])) { + $tikilib->semaphore_unset($page, $_SESSION[$editLockPageId]); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |