Posted by on the 2nd of January, 2013 at 4:21 pm under 컴퓨터.  This post has one comment.

글 링크가 영어가 아닐 때 읽을 수 없는 문제가 있었는데(link) 해결했다. 옮긴 서버 문제인지 뭔지 잘 모르겠지만, 워드프레스가 주소를 가지고 작업하는 도중에 문자열이 달라서 생긴 문제였다.

워드프레스 동작이 어떻게 되는지 잘 몰라서 헤맸는데, 어쨌든 REQUEST_URI를 쓸거라는 생각에 여기저기 뒤져보다가 원인을 찾았다. $_SERVER[‘PATH_INFO’]는 주소를 그대로 전달 해 주는데 $_SERVER[‘REQUEST_URI’]는 urlencode 한 값이 와서 그랬다. 그래서 urldecode 하도록 수정.

--- wp-includes/class-wp.php.orig       2013-01-02 16:09:46.000000000 +0900
+++ wp-includes/class-wp.php    2013-01-02 16:09:49.000000000 +0900
@@ -149,7 +149,7 @@
			$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);
			$req_uri = $_SERVER['REQUEST_URI'];
			$req_uri_array = explode('?', $req_uri);
-			$req_uri = $req_uri_array[0];
+			$req_uri = urldecode($req_uri_array[0]);
			$self = $_SERVER['PHP_SELF'];
			$home_path = parse_url(home_url());
			if ( isset($home_path['path']) )

2015년 2월 4일 추가. WordPress 4.1에서는 이렇게 고쳤다.

--- class-wp.php.orig   2015-02-03 23:44:44.000000000 +0900
+++ class-wp.php        2015-02-04 00:04:33.000000000 +0900
@@ -155,6 +155,7 @@
			$pathinfo = str_replace( "%", "%25", $pathinfo );

			list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
+			$req_uri = urldecode($req_uri);
			$self = $_SERVER['PHP_SELF'];
			$home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );




* Required

The URI to TrackBack this entry is:
https://bmp.pe.kr/blog/index.php/2013/01/02/%ea%b8%80-%ec%9d%bd%ec%9d%84-%ec%88%98-%ec%97%86%eb%8a%94-%eb%ac%b8%ec%a0%9c-%ed%95%b4%ea%b2%b0/trackback/

Posted on the 22nd of January, 2018 at 11:56 pm.

[…] 적은 것처럼 wordpress업데이트 후 매번 패치를 하고 있다.  (글 읽을 수 없는 문제 해결) 꼬박꼬박 해야 해서 귀찮아서 wordpress에 ticket도 등록했으나 딱히 진행이 […]