heavylcuky

하위 경로 설치시 오류

Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /home/user/kpwhl/public_html/new/common.php(30) : runtime-created function on line 5

Fatal error: Call to undefined function: () in /home/user/kpwhl/public_html/new/common.php on line 33

제가 최상위 경로에 설치하지 않고 하위폴더 생성후에 4s를 설치해보려고 했는데 index.php 파일을 불러오니 다음과 같은 오류가 발생하네요

댓글 5개

하위폴더 생성시 별다른 오류가 생기지는 않는것으로 확인되고 있습니다.
혹시나 FTP 설치정보를 알려주실수 있다면 확인해 드리도록 하겠습니다.
정보는 [email protected] 로 보내주시면 됩니다.
감사합니다.
그렇군요 ㅠ_ㅠ.. 그럼
PHP : PHP 4.3.9
DataBase : MySQL 4.1.20
Server : Microsoft-IIS/5.0

이중에 문제 있는게 있나요 ?
호스팅이 제것이 아니라서 제 맘데로 알려드릴수가 없어서요 ㅠ_ㅠ
서버에서 magic_quotes_gpc가 꺼져 있을 경우 같은데요. 그렇게 되면 create_function 함수에 의해 함수가 생성되는데 첫번째 변수 앞에 '&'가 오기 때문에 에러가 나는 것 같습니다.

common.php에서

[code]
$escape_function = 'addslashes($value)';
$addslashes_deep = create_function('&$value, $fn', '
if (is_string($value)) {
$value = ' . $escape_function . ';
} else if (is_array($value)) {
foreach ($value as &$v) $fn($v, $fn);
}
');

// Escape data
$addslashes_deep($_POST, $addslashes_deep);
$addslashes_deep($_GET, $addslashes_deep);
$addslashes_deep($_COOKIE, $addslashes_deep);
$addslashes_deep($_REQUEST, $addslashes_deep);
[/code]
를
[code]
function addslashes_deep($array)
{
return is_array($array) ? array_map('addslashes_deep', $array) : addslashes($array);
}

// Escape data
$_POST = addslashes_deep($_POST);
$_GET = addslashes_deep($_GET);
$_COOKIE = addslashes_deep($_COOKIE);
$_REQUEST = addslashes_deep($_REQUEST);
[/code]
로 교체하면 될 것같습니다.
말씀해주신데로 변경하니 해결 되었습니다. 정말 감사합니다 ㅠ_ㅠ..
heavylcuky님? letsgolee님께서 알려주신 코드로 대체하여 테스트 해주실수 있는지요?

common.php 의

if (!get_magic_quotes_gpc()) {
$escape_function = 'addslashes($value)';
$addslashes_deep = create_function('&$value, $fn', '
if (is_string($value)) {
$value = ' . $escape_function . ';
} else if (is_array($value)) {
foreach ($value as &$v) $fn($v, $fn);
}
');

// Escape data
$addslashes_deep($_POST, $addslashes_deep);
$addslashes_deep($_GET, $addslashes_deep);
$addslashes_deep($_COOKIE, $addslashes_deep);
$addslashes_deep($_REQUEST, $addslashes_deep);
}

를

function addslashes_deep($array)
{
return is_array($array) ? array_map('addslashes_deep', $array) : addslashes($array);
}

// Escape data
$_POST = addslashes_deep($_POST);
$_GET = addslashes_deep($_GET);
$_COOKIE = addslashes_deep($_COOKIE);
$_REQUEST = addslashes_deep($_REQUEST);

로 수정하시면 됩니다.


letsgolee님 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

버그신고

4,188건

  문의게시판을 이용해 주세요 :) https://sir.kr/co_qa  

+
분류 제목 글쓴이 날짜
13-03-21
13-03-21
13-03-21
13-03-21
13-03-20
13-03-20
13-03-20
13-03-20
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-19
13-03-18
13-03-18