Bug #18888 » patch_permajax_20080606_8578.diff
typo3/mod/web/perm/class.sc_mod_web_perm_ajax.php (working copy) | ||
---|---|---|
* @return Void
|
||
*/
|
||
public function __construct() {
|
||
// get charset from current ajax request (which is expected to be utf-8)
|
||
preg_match('/.*; charset=(.*)$/i', strtolower($_SERVER["CONTENT_TYPE"]), $contenttype);
|
||
// $contenttype[1] now contains the charset we recieved by the post/ajax request
|
||
// Configuration, variable assignment
|
||
$this->conf['page'] = t3lib_div::_POST('page');
|
||
$this->conf['who'] = t3lib_div::_POST('who');
|
||
... | ... | |
$this->conf['owner_data'] = urldecode(t3lib_div::_POST('owner_data'));
|
||
$this->conf['owner_data'] = str_replace('new_page_owner=', '', $this->conf['owner_data']);
|
||
$this->conf['owner_data'] = str_replace('%3B', ';', $this->conf['owner_data']);
|
||
if ($contenttype[1]) {
|
||
// _POST[owner_data] and _POST[group_data] are url encoded UTF-8 strings (encoded by prototype-js Ajax.Request)
|
||
// thus we first need to urldecode the string and then ensure that it's converted
|
||
// to the charset used by the backend (LANG->charSet)
|
||
$this->conf['owner_data'] = $GLOBALS['LANG']->csConvObj->conv(
|
||
$this->conf['owner_data'], // subject
|
||
strtolower($contenttype[1]), // from charset
|
||
strtolower($GLOBALS['LANG']->charSet) // to charset
|
||
);
|
||
}
|
||
$temp_owner_data = explode(';', $this->conf['owner_data']);
|
||
$this->conf['new_owner_uid'] = intval($temp_owner_data[0]);
|
||
$this->conf['new_owner_username'] = htmlspecialchars($temp_owner_data[1]);
|
||
... | ... | |
$this->conf['group_data'] = urldecode(t3lib_div::_POST('group_data'));
|
||
$this->conf['group_data'] = str_replace('new_page_group=', '', $this->conf['group_data']);
|
||
$this->conf['group_data'] = str_replace('%3B', ';', $this->conf['group_data']);
|
||
if ($contenttype[1]) {
|
||
$this->conf['group_data'] = $GLOBALS['LANG']->csConvObj->conv(
|
||
$this->conf['group_data'],
|
||
$contenttype[1],
|
||
$GLOBALS['LANG']->charSet);
|
||
}
|
||
$temp_group_data = explode(';', $this->conf['group_data']);
|
||
$this->conf['new_group_uid'] = intval($temp_group_data[0]);
|
||
$this->conf['new_group_username'] = htmlspecialchars($temp_group_data[1]);
|