mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
commit
16e243fa1b
222 changed files with 11320 additions and 889 deletions
9
.jshintignore
Normal file
9
.jshintignore
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
common/js/jquery*.js
|
||||
common/js/modernizr.js
|
||||
common/js/xe.js
|
||||
common/js/x.js
|
||||
common/js/*.min.js
|
||||
common/js/unittest/*
|
||||
common/js/plugins/*
|
||||
common/js/foggyLayer.js
|
||||
common/js/html5.js
|
||||
68
.jshintrc
Normal file
68
.jshintrc
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"globalstrict": false,
|
||||
"undef": false,
|
||||
"eqeqeq": false,
|
||||
"browser": true,
|
||||
"devel": true,
|
||||
"jquery": true,
|
||||
"evil": true,
|
||||
"globals": {
|
||||
"window": true,
|
||||
"current_url": true,
|
||||
"exec_json": true,
|
||||
"exec_xml": true,
|
||||
"procFilter": true,
|
||||
"xe": true,
|
||||
"request_uri": true,
|
||||
"xAddEventListener": false,
|
||||
"xResizeEvent": false,
|
||||
"xScrollEvent": false,
|
||||
"xAppendChild": false,
|
||||
"xClientHeight": false,
|
||||
"xClientWidth": false,
|
||||
"xCreateElement": false,
|
||||
"xDef": false,
|
||||
"xDeleteCookie": false,
|
||||
"xDisplay": false,
|
||||
"xEvent": false,
|
||||
"xFirstChild": false,
|
||||
"xGetBodyWidth": false,
|
||||
"xGetBodyHeight": false,
|
||||
"xGetComputedStyle": false,
|
||||
"xGetCookie": false,
|
||||
"xGetElementById": false,
|
||||
"xGetElementsByAttribute": false,
|
||||
"xGetElementsByClassName": false,
|
||||
"xGetElementsByTagName": false,
|
||||
"xGetURLArguments": false,
|
||||
"xHeight": false,
|
||||
"xHex": false,
|
||||
"xHide": false,
|
||||
"xInnerHtml": false,
|
||||
"xLeft": false,
|
||||
"xMoveTo": false,
|
||||
"xName": false,
|
||||
"xNextSib": false,
|
||||
"xNum": false,
|
||||
"xOffsetLeft": false,
|
||||
"xOffsetTop": false,
|
||||
"xPad": false,
|
||||
"xPageX": false,
|
||||
"xPageY": false,
|
||||
"xParent": false,
|
||||
"xPreventDefault": false,
|
||||
"xPrevSib": false,
|
||||
"xRemoveEventListener": false,
|
||||
"xResizeTo": false,
|
||||
"xScrollLeft": false,
|
||||
"xScrollTop": false,
|
||||
"xSetCookie": false,
|
||||
"xShow": false,
|
||||
"xStr": false,
|
||||
"xTop": false,
|
||||
"xVisibility": false,
|
||||
"xWidth": false,
|
||||
"xZIndex": false,
|
||||
"xStopPropagation": false
|
||||
}
|
||||
}
|
||||
29
Gruntfile.js
29
Gruntfile.js
|
|
@ -2,7 +2,7 @@ module.exports = function(grunt) {
|
|||
"use strict";
|
||||
|
||||
var banner = '/*! Copyright (C) NAVER <http://www.navercorp.com> */\n';
|
||||
var banner_xe_js = banner + '/**!\n * @file common.js + js_app.js + xml_handler.js + xml_js_filter.js\n * @brief XE Common JavaScript\n **/\n';
|
||||
var banner_xe_js = banner + '/**!\n * @concat modernizr.js + common.js + js_app.js + xml_handler.js + xml_js_filter.js\n * @brief XE Common JavaScript\n **/\n';
|
||||
|
||||
grunt.file.defaultEncoding = 'utf8';
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ module.exports = function(grunt) {
|
|||
banner: banner_xe_js
|
||||
},
|
||||
src: [
|
||||
'common/js/modernizr.js',
|
||||
'common/js/common.js',
|
||||
'common/js/js_app.js',
|
||||
'common/js/xml_handler.js',
|
||||
|
|
@ -32,7 +33,7 @@ module.exports = function(grunt) {
|
|||
'xpresseditor': {
|
||||
options: {
|
||||
stripBanners: true,
|
||||
banner: banner_xe_js
|
||||
banner: '/**!\n * @concat Xpress_Editor.js + xe_interface.js \n **/\n'
|
||||
},
|
||||
src: [
|
||||
'modules/editor/skins/xpresseditor/js/Xpress_Editor.js',
|
||||
|
|
@ -44,7 +45,8 @@ module.exports = function(grunt) {
|
|||
uglify: {
|
||||
'common-js': {
|
||||
options: {
|
||||
banner: banner_xe_js
|
||||
banner: banner_xe_js,
|
||||
sourceMap: true
|
||||
},
|
||||
files: {
|
||||
'common/js/xe.min.js': ['common/js/xe.js']
|
||||
|
|
@ -60,6 +62,9 @@ module.exports = function(grunt) {
|
|||
}
|
||||
},
|
||||
'modules': {
|
||||
options: {
|
||||
sourceMap: true
|
||||
},
|
||||
files: {
|
||||
'common/js/x.min.js' : ['common/js/x.js'],
|
||||
// addon
|
||||
|
|
@ -154,7 +159,12 @@ module.exports = function(grunt) {
|
|||
jshint: {
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'common/js/*.js', '!common/js/html5.js', '!common/js/jquery.js', '!common/js/x.js', '!common/js/xe.js',
|
||||
'common/js/*.js',
|
||||
'!common/js/html5.js',
|
||||
'!common/js/jquery.js',
|
||||
'!common/js/x.js',
|
||||
'!common/js/xe.js',
|
||||
'!common/js/modernizr.js',
|
||||
'modules/admin/tpl/js/*.js',
|
||||
'modules/board/tpl/js/*.js',
|
||||
'modules/editor/tpl/js/*.js',
|
||||
|
|
@ -162,15 +172,6 @@ module.exports = function(grunt) {
|
|||
'modules/widget/tpl/js/*.js',
|
||||
],
|
||||
options : {
|
||||
globalstrict: false,
|
||||
undef : false,
|
||||
eqeqeq: false,
|
||||
browser : true,
|
||||
globals: {
|
||||
"jQuery" : true,
|
||||
"console" : true,
|
||||
"window" : true
|
||||
},
|
||||
ignores : [
|
||||
'**/jquery*.js',
|
||||
'**/swfupload.js',
|
||||
|
|
@ -314,7 +315,7 @@ module.exports = function(grunt) {
|
|||
// changed
|
||||
grunt.util.spawn({
|
||||
cmd: "git",
|
||||
args: ['diff', '--name-only', target]
|
||||
args: ['diff', '--name-only', '--diff-filter' ,'ACM', target]
|
||||
}, function (error, result, code) {
|
||||
diff = result.stdout;
|
||||
|
||||
|
|
|
|||
39
README.md
39
README.md
|
|
@ -5,21 +5,40 @@ XpressEngine
|
|||
[](http://www.gnu.org/licenses/gpl.html)
|
||||
[](https://github.com/xpressengine/xe-core/releases)
|
||||
|
||||
XpressEngine(XE)은 PHP로 작성한 설치형 CMS(Content Management System)입니다.
|
||||
XpressEngine(XE)은 누구나 쉽고 편하고 자유롭게 콘텐츠를 발행을 할 수 있도록 하기 위한 CMS(Content Management System)입니다.
|
||||
오픈소스 라이선스로 누구나 사용 또는 개작할 수 있으며, 개방형 프로젝트로서 누구나 개발에 참여할 수 있습니다.
|
||||
|
||||
### 확장형 구조
|
||||
|
||||
XE 코어는 모듈, 애드온, 에디터 컴포넌트, 위젯, 레이아웃의 구조를 기반으로 결과물을 생성합니다.
|
||||
|
||||
이렇게 각각의 기능과 디자인이 구조적으로 연결되는 모듈형 구조는 개발 및 유지보수를 쉽게하도록 도와주며 관리자는 손쉽게 설정과 디자인을 변경할 수 있습니다.
|
||||
|
||||
레이아웃, 모듈 스킨 그리고 위젯의 스타일과 스킨을 활용하면 여러분만의 개성을 가진 웹 사이트를 만들 수 있습니다. XE와 함께 더 다채롭고 개성있는 웹사이트를 만들어보세요!
|
||||
|
||||
### 오픈 소스 소프트웨어! 열린 프로젝트! (코드 공헌 가이드)
|
||||
많은 분들께서 개발, 디자인, 마크업 등의 전문 분야는 물론 다국어 번역, 문제점 보고 등 기능 개선 및 문제 해결을 위해 많은 노력을 해주시고 계십니다.
|
||||
|
||||
참여를 원하시는 분들은 버그 신고/제안 혹은 Pull Request 전 [CONTRIBUTING.md](./CONTRIBUTING.md) 문서를 먼저 읽어주시기 바랍니다.
|
||||
XpressEngine은 여러분들의 개발 참여를 기다립니다.
|
||||
|
||||
## Server Requirements
|
||||
* PHP version 5.2.4 or greater (But recommend PHP >= 5.3.11)
|
||||
* MYSQL version 4.1 or greater (But recommend MYSQL >= 5.x) , MS-SQL, CUBRID
|
||||
* XML Library
|
||||
* GD Library
|
||||
* ICONV
|
||||
* session.auto_start = Off (php.ini)
|
||||
|
||||
## Maintainers
|
||||
@akasima @bnu @jhyeon1010 @khongchi @findstar @ngleader
|
||||
|
||||
## Contributors
|
||||
http://www.xpressengine.com/contributors
|
||||
|
||||
## Support
|
||||
* Official sitie (Korean) : http://www.xpressengine.com/
|
||||
|
||||
## Maintainers
|
||||
@akasima @bnu @jhyeon1010 @khongchi @ngleader
|
||||
|
||||
## Authors
|
||||
<http://www.xpressengine.com/contributors>
|
||||
|
||||
## Contribution Guide
|
||||
`CONTRIBUTING.md`파일을 참고하세요.
|
||||
|
||||
## License
|
||||
Copyright 2014 NAVER Corp. <http://www.navercorp.com>
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,10 @@ if($_REQUEST['act'] != 'api')
|
|||
// Read func file
|
||||
require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');
|
||||
|
||||
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
|
||||
|
||||
// If HTTP_RAW_POST_DATA is NULL, Print error message
|
||||
if(!$GLOBALS['HTTP_RAW_POST_DATA'])
|
||||
if(!$xml)
|
||||
{
|
||||
$content = getXmlRpcFailure(1, 'Invalid Method Call');
|
||||
printContent($content);
|
||||
|
|
@ -39,7 +41,14 @@ if(!$GLOBALS['HTTP_RAW_POST_DATA'])
|
|||
|
||||
// xmlprc parsing
|
||||
// Parse the requested xmlrpc
|
||||
$xml = new SimpleXMLElement($GLOBALS['HTTP_RAW_POST_DATA']);
|
||||
if(Security::detectingXEE($xml))
|
||||
{
|
||||
header("HTTP/1.0 400 Bad Request");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(version_compare(PHP_VERSION, '5.2.11', '<=')) libxml_disable_entity_loader(true);
|
||||
$xml = new SimpleXMLElement($xml, LIBXML_NONET | LIBXML_NOENT);
|
||||
|
||||
$method_name = (string)$xml->methodName;
|
||||
$params = $xml->params->param;
|
||||
|
|
|
|||
3
addons/captcha/captcha.min.js
vendored
3
addons/captcha/captcha.min.js
vendored
File diff suppressed because one or more lines are too long
1
addons/captcha/captcha.min.map
Normal file
1
addons/captcha/captcha.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"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"}
|
||||
3
addons/captcha_member/captcha.min.js
vendored
3
addons/captcha_member/captcha.min.js
vendored
File diff suppressed because one or more lines are too long
1
addons/captcha_member/captcha.min.map
Normal file
1
addons/captcha_member/captcha.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"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"}
|
||||
|
|
@ -10,7 +10,7 @@ if(!defined('__XE__'))
|
|||
* @brief Counter add-on
|
||||
*/
|
||||
// Execute if called_position is before_display_content
|
||||
if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled())
|
||||
if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler())
|
||||
{
|
||||
$oCounterController = getController('counter');
|
||||
$oCounterController->counterExecute();
|
||||
|
|
|
|||
|
|
@ -781,12 +781,6 @@
|
|||
from: 'htmlstring'
|
||||
}
|
||||
}),
|
||||
new $.fn.oembed.OEmbedProvider("gravtar", "photo", ["mailto:.+"], null, {
|
||||
templateRegex: /mailto:([^\/]+).*/,
|
||||
template: function (wm, email) {
|
||||
return '<img src="http://gravatar.com/avatar/' + email.md5() + '.jpg" alt="on Gravtar" class="jqoaImg">';
|
||||
}
|
||||
}),
|
||||
|
||||
//Rich
|
||||
new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"),
|
||||
|
|
@ -1062,137 +1056,3 @@
|
|||
})
|
||||
];
|
||||
})(jQuery);
|
||||
|
||||
//This is needed for gravatar :(
|
||||
String.prototype.md5 = function () {
|
||||
var a = function (a, b) {
|
||||
var c = (a & 65535) + (b & 65535);
|
||||
var d = (a >> 16) + (b >> 16) + (c >> 16);
|
||||
return d << 16 | c & 65535
|
||||
};
|
||||
var b = function (a, b) {
|
||||
return a << b | a >>> 32 - b
|
||||
};
|
||||
var c = function (c, d, e, f, g, h) {
|
||||
return a(b(a(a(d, c), a(f, h)), g), e)
|
||||
};
|
||||
var d = function (a, b, d, e, f, g, h) {
|
||||
return c(b & d | ~b & e, a, b, f, g, h)
|
||||
};
|
||||
var e = function (a, b, d, e, f, g, h) {
|
||||
return c(b & e | d & ~e, a, b, f, g, h)
|
||||
};
|
||||
var f = function (a, b, d, e, f, g, h) {
|
||||
return c(b ^ d ^ e, a, b, f, g, h)
|
||||
};
|
||||
var g = function (a, b, d, e, f, g, h) {
|
||||
return c(d ^ (b | ~e), a, b, f, g, h)
|
||||
};
|
||||
var h = function (b) {
|
||||
var c, h, i, j, k, l = b.length;
|
||||
var m = 1732584193;
|
||||
var n = -271733879;
|
||||
var o = -1732584194;
|
||||
var p = 271733878;
|
||||
for(k = 0; k < l; k += 16) {
|
||||
c = m;
|
||||
h = n;
|
||||
i = o;
|
||||
j = p;
|
||||
m = d(m, n, o, p, b[k + 0], 7, -680876936);
|
||||
p = d(p, m, n, o, b[k + 1], 12, -389564586);
|
||||
o = d(o, p, m, n, b[k + 2], 17, 606105819);
|
||||
n = d(n, o, p, m, b[k + 3], 22, -1044525330);
|
||||
m = d(m, n, o, p, b[k + 4], 7, -176418897);
|
||||
p = d(p, m, n, o, b[k + 5], 12, 1200080426);
|
||||
o = d(o, p, m, n, b[k + 6], 17, -1473231341);
|
||||
n = d(n, o, p, m, b[k + 7], 22, -45705983);
|
||||
m = d(m, n, o, p, b[k + 8], 7, 1770035416);
|
||||
p = d(p, m, n, o, b[k + 9], 12, -1958414417);
|
||||
o = d(o, p, m, n, b[k + 10], 17, -42063);
|
||||
n = d(n, o, p, m, b[k + 11], 22, -1990404162);
|
||||
m = d(m, n, o, p, b[k + 12], 7, 1804603682);
|
||||
p = d(p, m, n, o, b[k + 13], 12, -40341101);
|
||||
o = d(o, p, m, n, b[k + 14], 17, -1502002290);
|
||||
n = d(n, o, p, m, b[k + 15], 22, 1236535329);
|
||||
m = e(m, n, o, p, b[k + 1], 5, -165796510);
|
||||
p = e(p, m, n, o, b[k + 6], 9, -1069501632);
|
||||
o = e(o, p, m, n, b[k + 11], 14, 643717713);
|
||||
n = e(n, o, p, m, b[k + 0], 20, -373897302);
|
||||
m = e(m, n, o, p, b[k + 5], 5, -701558691);
|
||||
p = e(p, m, n, o, b[k + 10], 9, 38016083);
|
||||
o = e(o, p, m, n, b[k + 15], 14, -660478335);
|
||||
n = e(n, o, p, m, b[k + 4], 20, -405537848);
|
||||
m = e(m, n, o, p, b[k + 9], 5, 568446438);
|
||||
p = e(p, m, n, o, b[k + 14], 9, -1019803690);
|
||||
o = e(o, p, m, n, b[k + 3], 14, -187363961);
|
||||
n = e(n, o, p, m, b[k + 8], 20, 1163531501);
|
||||
m = e(m, n, o, p, b[k + 13], 5, -1444681467);
|
||||
p = e(p, m, n, o, b[k + 2], 9, -51403784);
|
||||
o = e(o, p, m, n, b[k + 7], 14, 1735328473);
|
||||
n = e(n, o, p, m, b[k + 12], 20, -1926607734);
|
||||
m = f(m, n, o, p, b[k + 5], 4, -378558);
|
||||
p = f(p, m, n, o, b[k + 8], 11, -2022574463);
|
||||
o = f(o, p, m, n, b[k + 11], 16, 1839030562);
|
||||
n = f(n, o, p, m, b[k + 14], 23, -35309556);
|
||||
m = f(m, n, o, p, b[k + 1], 4, -1530992060);
|
||||
p = f(p, m, n, o, b[k + 4], 11, 1272893353);
|
||||
o = f(o, p, m, n, b[k + 7], 16, -155497632);
|
||||
n = f(n, o, p, m, b[k + 10], 23, -1094730640);
|
||||
m = f(m, n, o, p, b[k + 13], 4, 681279174);
|
||||
p = f(p, m, n, o, b[k + 0], 11, -358537222);
|
||||
o = f(o, p, m, n, b[k + 3], 16, -722521979);
|
||||
n = f(n, o, p, m, b[k + 6], 23, 76029189);
|
||||
m = f(m, n, o, p, b[k + 9], 4, -640364487);
|
||||
p = f(p, m, n, o, b[k + 12], 11, -421815835);
|
||||
o = f(o, p, m, n, b[k + 15], 16, 530742520);
|
||||
n = f(n, o, p, m, b[k + 2], 23, -995338651);
|
||||
m = g(m, n, o, p, b[k + 0], 6, -198630844);
|
||||
p = g(p, m, n, o, b[k + 7], 10, 1126891415);
|
||||
o = g(o, p, m, n, b[k + 14], 15, -1416354905);
|
||||
n = g(n, o, p, m, b[k + 5], 21, -57434055);
|
||||
m = g(m, n, o, p, b[k + 12], 6, 1700485571);
|
||||
p = g(p, m, n, o, b[k + 3], 10, -1894986606);
|
||||
o = g(o, p, m, n, b[k + 10], 15, -1051523);
|
||||
n = g(n, o, p, m, b[k + 1], 21, -2054922799);
|
||||
m = g(m, n, o, p, b[k + 8], 6, 1873313359);
|
||||
p = g(p, m, n, o, b[k + 15], 10, -30611744);
|
||||
o = g(o, p, m, n, b[k + 6], 15, -1560198380);
|
||||
n = g(n, o, p, m, b[k + 13], 21, 1309151649);
|
||||
m = g(m, n, o, p, b[k + 4], 6, -145523070);
|
||||
p = g(p, m, n, o, b[k + 11], 10, -1120210379);
|
||||
o = g(o, p, m, n, b[k + 2], 15, 718787259);
|
||||
n = g(n, o, p, m, b[k + 9], 21, -343485551);
|
||||
m = a(m, c);
|
||||
n = a(n, h);
|
||||
o = a(o, i);
|
||||
p = a(p, j)
|
||||
}
|
||||
return [m, n, o, p]
|
||||
};
|
||||
var i = function (a) {
|
||||
var b = "0123456789abcdef",
|
||||
c = "",
|
||||
d, e = a.length * 4;
|
||||
for(d = 0; d < e; d++) {
|
||||
c += b.charAt(a[d >> 2] >> d % 4 * 8 + 4 & 15) + b.charAt(a[d >> 2] >> d % 4 * 8 & 15)
|
||||
}
|
||||
return c
|
||||
};
|
||||
var j = function (a) {
|
||||
var b = (a.length + 8 >> 6) + 1;
|
||||
var c = [],
|
||||
d, e = b * 16,
|
||||
f, g = a.length;
|
||||
for(d = 0; d < e; d++) {
|
||||
c.push(0)
|
||||
}
|
||||
for(f = 0; f < g; f++) {
|
||||
c[f >> 2] |= (a.charCodeAt(f) & 255) << f % 4 * 8
|
||||
}
|
||||
c[f >> 2] |= 128 << f % 4 * 8;
|
||||
c[b * 16 - 2] = g * 8;
|
||||
return c
|
||||
};
|
||||
return i(h(j(this)))
|
||||
}
|
||||
|
|
|
|||
5
addons/oembed/jquery.oembed.min.js
vendored
5
addons/oembed/jquery.oembed.min.js
vendored
File diff suppressed because one or more lines are too long
1
addons/oembed/jquery.oembed.min.map
Normal file
1
addons/oembed/jquery.oembed.min.map
Normal file
File diff suppressed because one or more lines are too long
3
addons/oembed/oembed.min.js
vendored
3
addons/oembed/oembed.min.js
vendored
|
|
@ -1 +1,2 @@
|
|||
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
|
||||
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
|
||||
//# sourceMappingURL=oembed.min.map
|
||||
1
addons/oembed/oembed.min.map
Normal file
1
addons/oembed/oembed.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"oembed.min.js","sources":["oembed.js"],"names":["$","protocol_re","domain_re","max_255_re","ip_re","port_re","user_re","path_re","hash_re","url_regex","RegExp","OEmbed","xe","createPlugin","targets","init","this","enableAutoLink","castedOembedA","embedSetting","API_ONREADY","thisPlugin","extractTargets","oApp","getPlugin","length","cast","each","API_BEFORE_AUTOLINK","API_AFTER_AUTOLINK","oSender","params","oembed","API_OEMBED","textNode","parent","get","nodeName","toLowerCase","content","nodeValue","dummy","replace","before","replaceWith","next","remove","API_OEMBEDA","not","target","maxWidth","width","nodeType","addClass","obj","wrap","contents","node_name","inArray","exec","test","push","registerPlugin","jQuery"],"mappings":"CAKA,SAAUA,GACT,GAAIC,GAAc,sCACdC,EAAc,8BACdC,EAAc,gDACdC,EAAc,MAAMD,EAAW,UAAUA,EACzCE,EAAc,iBACdC,EAAc,iBACdC,EAAc,yBACdC,EAAc,oBAEdC,EAAY,GAAIC,QAAO,IAAIT,EAAY,IAAIC,EAAU,IAAIE,EAAM,cAAiBC,EAAQC,EAAQC,EAAQC,EAAQ,IAAK,MAErHG,EAASC,GAAGC,aAAa,UAC5BC,WACAC,KAAO,WACNC,KAAKF,WACLE,KAAKC,gBAAiB,EACtBD,KAAKE,eAAgB,EACrBF,KAAKG,iBAGNC,YAAc,WACb,GAAIC,GAAaL,IAGjBA,MAAKM,eAAetB,EAAE,gBAEnBgB,KAAKO,KAAKC,UAAU,YAAYC,SAElCT,KAAKC,gBAAiB,GAEvBI,EAAWK,KAAK,WAEZV,KAAKC,gBAERjB,EAAEgB,KAAKF,SAASa,KAAK,WACpBN,EAAWK,KAAK,UAAWV,UAI9BY,oBAAsB,WACrB,GAAIP,GAAaL,IACjBK,GAAWK,KAAK,YAEjBG,mBAAqB,SAASC,EAASC,GACtCf,KAAKgB,OAAOD,EAAO,KAEpBE,WAAa,SAASH,EAASC,GAC9B,IAAGf,KAAKC,eAAR,CACA,GAEIiB,GAAWH,EAAO,EACtB,KAAI/B,EAAEkC,GAAUC,SAASV,QAAgE,KAAtDzB,EAAEkC,GAAUC,SAASC,IAAI,GAAGC,SAASC,cAGvE,WADAtB,MAAKgB,OAAOhC,EAAEkC,GAGf,IAAIK,GAAWL,EAASM,UACpBC,EAAWzC,EAAE,SAEjBuC,GAAUA,EAAQG,QAAQ,KAAM,QAAQA,QAAQ,KAAM,QACtDH,EAAUA,EAAQG,QAAQjC,EAAW,uCAErCT,EAAEkC,GAAUS,OAAOF,GACnBzC,EAAEkC,GAAUU,YAAYL,GACxBR,EAAO,GAAKU,EAAMI,KAAK,KACvBJ,EAAMK,SAEN9B,KAAKgB,OAAOD,EAAO,MAEpBgB,YAAc,WACb,IAAG/B,KAAKE,cAAR,CACA,GAAIG,GAAaL,IAEjBA,MAAKE,eAAgB,EAErBlB,EAAE,gBAAgBgD,IAAI,WAAWrB,KAAK,WACrCN,EAAWW,OAAOhC,EAAEgB,WAGtBgB,OAAS,SAASiB,GACjB,GAAI5B,GAAaL,IAEbA,MAAKG,aAAa+B,WAErBlC,KAAKG,aAAa+B,SAAWlD,EAAE,eAAemD,SAG3CF,IACDA,GAA6B,GAAnBA,EAAOG,WAAeH,EAASjD,EAAEiD,IAE9CA,EAAOjB,OAAO,KAAMX,EAAWF,cAAckC,SAAS,aAEvD/B,eAAiB,SAASgC,GACzB,GAAIjC,GAAaL,KACbuC,EAAOvD,EAAE,cAAesD,EAC5B,OAAGC,GAAK9B,WACPT,MAAKM,eAAeiC,OAIrBvD,GAAEsD,GACDE,WACA7B,KAAK,WACL,GAAI8B,GAAYzC,KAAKqB,SAASC,aAC9B,IAAyK,IAAtKtC,EAAE0D,QAAQD,GAAY,IAAK,MAAO,MAAO,WAAY,QAAS,SAAU,SAAU,OAAQ,SAAU,QAAS,SAAU,SAAU,MAAO,QAAS,SAAU,QAK9J,GAFAhD,EAAUkD,KAAK,IAEK,GAAjB3C,KAAKoC,SAAe,CACtB,GAAIb,GAAUvB,KAAKwB,SAEnB,IAAGD,EAAQd,OAAS,EAAG,MAEvB,KAAI,6CAA6CmC,KAAKrB,GAAU,MAEhElB,GAAWP,QAAQ+C,KAAK7C,UAExBK,GAAWC,eAAeN,UAM9BJ,IAAGkD,eAAe,GAAInD,KACpBoD"}
|
||||
3
addons/resize_image/js/resize_image.min.js
vendored
3
addons/resize_image/js/resize_image.min.js
vendored
|
|
@ -1 +1,2 @@
|
|||
!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
|
||||
!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
|
||||
//# sourceMappingURL=resize_image.min.map
|
||||
1
addons/resize_image/js/resize_image.min.map
Normal file
1
addons/resize_image/js/resize_image.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"resize_image.min.js","sources":["resize_image.js"],"names":["$","getScreen","controls","imgframe","closebtn","prevbtn","nextbtn","body","document","xScreen","attr","css","position","display","backgroundColor","zIndex","opacity","overflow","left","backgroundPosition","click","xePrev","appendTo","top","xeHide","right","xeNext","find","width","height","cursor","border","margin","padding","backgroundImage","request_uri","backgroundRepeat","filter","mouseover","this","mouseout","focus","trigger","blur","Image","zindex","maxWidth","borderRadius","boxShadow","draggable","append","live","clientWidth","window","clientHeight","xeShow","show","bottom","Math","round","xeMove","hide","val","index","list","size","src","eq","removeAttr","keydown","e","which","slideshow","container","closest","imglist","currentIdx","inArray","get","load","doResize","contentWidth","count","$img","beforSize","setTimeout","call","resize_ratio","parseInt","regx_skip","regx_allow_i6pngfix","dummy","each","remove","imgSrc","test","parent","length","jQuery"],"mappings":"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"}
|
||||
|
|
@ -219,7 +219,7 @@ class Context
|
|||
if($this->db_info->use_sitelock == 'Y')
|
||||
{
|
||||
if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
|
||||
|
||||
|
||||
if(!IpFilter::filter($whitelist))
|
||||
{
|
||||
$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
|
||||
|
|
@ -230,7 +230,14 @@ class Context
|
|||
define('_XE_SITELOCK_MESSAGE_', $message);
|
||||
|
||||
header("HTTP/1.1 403 Forbidden");
|
||||
include _XE_PATH_ . 'common/tpl/sitelock.html';
|
||||
if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
|
||||
{
|
||||
include _XE_PATH_ . 'common/tpl/sitelock.user.html';
|
||||
}
|
||||
else
|
||||
{
|
||||
include _XE_PATH_ . 'common/tpl/sitelock.html';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
@ -360,6 +367,8 @@ class Context
|
|||
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
|
||||
|
||||
// set locations for javascript use
|
||||
$url = array();
|
||||
$current_url = self::getRequestUri();
|
||||
if($_SERVER['REQUEST_METHOD'] == 'GET')
|
||||
{
|
||||
if($this->get_vars)
|
||||
|
|
@ -379,17 +388,21 @@ class Context
|
|||
$url[] = $key . '=' . urlencode($val);
|
||||
}
|
||||
}
|
||||
$this->set('current_url', self::getRequestUri() . '?' . join('&', $url));
|
||||
|
||||
$current_url = self::getRequestUri();
|
||||
if($url) $current_url .= '?' . join('&', $url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->set('current_url', $this->getUrl());
|
||||
$current_url = $this->getUrl();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->set('current_url', self::getRequestUri());
|
||||
$current_url = self::getRequestUri();
|
||||
}
|
||||
|
||||
$this->set('current_url', $current_url);
|
||||
$this->set('request_uri', self::getRequestUri());
|
||||
}
|
||||
|
||||
|
|
@ -473,10 +486,8 @@ class Context
|
|||
$db_info->use_ssl = 'none';
|
||||
$this->set('_use_ssl', $db_info->use_ssl);
|
||||
|
||||
if($db_info->http_port)
|
||||
$self->set('_http_port', $db_info->http_port);
|
||||
if($db_info->https_port)
|
||||
$self->set('_https_port', $db_info->https_port);
|
||||
$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
|
||||
$self->set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
|
||||
|
||||
if(!$db_info->sitelock_whitelist) {
|
||||
$db_info->sitelock_whitelist = '127.0.0.1';
|
||||
|
|
@ -1108,7 +1119,7 @@ class Context
|
|||
{
|
||||
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
|
||||
|
||||
$self->js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
|
||||
$self->js_callback_func = $self->getJSCallbackFunc();
|
||||
|
||||
($type && $self->request_method = $type) or
|
||||
(strpos($_SERVER['CONTENT_TYPE'], 'json') && $self->request_method = 'JSON') or
|
||||
|
|
@ -1152,6 +1163,7 @@ class Context
|
|||
{
|
||||
continue;
|
||||
}
|
||||
$key = htmlentities($key);
|
||||
$val = $this->_filterRequestVar($key, $val);
|
||||
|
||||
if($requestMethod == 'GET' && isset($_GET[$key]))
|
||||
|
|
@ -1235,23 +1247,81 @@ class Context
|
|||
return;
|
||||
}
|
||||
|
||||
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
|
||||
if(Security::detectingXEE($xml))
|
||||
{
|
||||
header("HTTP/1.0 400 Bad Request");
|
||||
exit;
|
||||
}
|
||||
|
||||
$oXml = new XmlParser();
|
||||
$xml_obj = $oXml->parse();
|
||||
$xml_obj = $oXml->parse($xml);
|
||||
|
||||
$params = $xml_obj->methodcall->params;
|
||||
unset($params->node_name, $params->attrs);
|
||||
unset($params->node_name, $params->attrs, $params->body);
|
||||
|
||||
if(!count($params))
|
||||
if(!count(get_object_vars($params)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($params as $key => $obj)
|
||||
foreach($params as $key => $val)
|
||||
{
|
||||
$this->set($key, $this->_filterRequestVar($key, $obj->body, 0), TRUE);
|
||||
$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter xml variables
|
||||
*
|
||||
* @param string $key Variable key
|
||||
* @param object $val Variable value
|
||||
* @return mixed filtered value
|
||||
*/
|
||||
function _filterXmlVars($key, $val)
|
||||
{
|
||||
if(is_array($val))
|
||||
{
|
||||
$stack = array();
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
$stack[$k] = $this->_filterXmlVars($k, $v);
|
||||
}
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
$body = $val->body;
|
||||
unset($val->node_name, $val->attrs, $val->body);
|
||||
if(!count(get_object_vars($val)))
|
||||
{
|
||||
return $this->_filterRequestVar($key, $body, 0);
|
||||
}
|
||||
|
||||
$stack = new stdClass();
|
||||
foreach($val as $k => $v)
|
||||
{
|
||||
$output = $this->_filterXmlVars($k, $v);
|
||||
if(is_object($v) && $v->attrs->type == 'array')
|
||||
{
|
||||
$output = array($output);
|
||||
}
|
||||
if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$stack->{$k} = $output;
|
||||
}
|
||||
|
||||
if(!count(get_object_vars($stack)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter request variable
|
||||
*
|
||||
|
|
@ -1397,7 +1467,16 @@ class Context
|
|||
function getJSCallbackFunc()
|
||||
{
|
||||
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
|
||||
return $self->js_callback_func;
|
||||
$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
|
||||
|
||||
if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
|
||||
{
|
||||
unset($js_callback_func);
|
||||
unset($_GET['xe_js_callback']);
|
||||
unset($_POST['xe_js_callback']);
|
||||
}
|
||||
|
||||
return $js_callback_func;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1597,7 +1676,7 @@ class Context
|
|||
}
|
||||
elseif($_use_ssl == 'optional')
|
||||
{
|
||||
$ssl_mode = ($get_vars['act'] && $self->isExistsSSLAction($get_vars['act'])) ? ENFORCE_SSL : RELEASE_SSL;
|
||||
$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
|
||||
$query = $self->getRequestUri($ssl_mode, $domain) . $query;
|
||||
// no SSL
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class HTMLDisplayHandler
|
|||
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this, '_moveMetaToHeader'), $output);
|
||||
|
||||
// change a meta fine(widget often put the tag like <!--Meta:path--> to the content because of caching)
|
||||
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@]+)-->/is', array($this, '_transMeta'), $output);
|
||||
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output);
|
||||
|
||||
// handles a relative path generated by using the rewrite module
|
||||
if(Context::isAllowRewrite())
|
||||
|
|
@ -219,8 +219,8 @@ class HTMLDisplayHandler
|
|||
|
||||
// set icon
|
||||
$oAdminModel = getAdminModel('admin');
|
||||
$favicon_url = $oAdminModel->getFaviconUrl();
|
||||
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
||||
$favicon_url = $oAdminModel->getFaviconUrl(false);
|
||||
$mobicon_url = $oAdminModel->getMobileIconUrl(false);
|
||||
Context::set('favicon_url', $favicon_url);
|
||||
Context::set('mobicon_url', $mobicon_url);
|
||||
|
||||
|
|
@ -398,6 +398,7 @@ class HTMLDisplayHandler
|
|||
{
|
||||
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
|
||||
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
|
||||
|
|
@ -431,7 +432,7 @@ class HTMLDisplayHandler
|
|||
{
|
||||
$oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true);
|
||||
$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
|
||||
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.min.css", '', 'ie', 10), true);
|
||||
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true);
|
||||
$oContext->loadFile('./modules/admin/tpl/js/admin.min.js', true);
|
||||
$oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.min.css', '', '', 1), true);
|
||||
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true);
|
||||
|
|
@ -451,8 +452,8 @@ class HTMLDisplayHandler
|
|||
// add common JS/CSS files
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
{
|
||||
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true);
|
||||
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
|
||||
|
|
@ -463,8 +464,7 @@ class HTMLDisplayHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true);
|
||||
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
|
||||
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ class VirtualXMLDisplayHandler
|
|||
$message = $oModule->getMessage();
|
||||
$redirect_url = $oModule->get('redirect_url');
|
||||
$request_uri = Context::get('xeRequestURI');
|
||||
$request_url = Context::get('xeVirtualRequestUrl');
|
||||
$output = new stdClass;
|
||||
$request_url = Context::getRequestUri();
|
||||
$output = new stdClass();
|
||||
|
||||
if(substr_compare($request_url, '/', -1) !== 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ class ExtraItem
|
|||
return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : "";
|
||||
|
||||
case 'tel' :
|
||||
return sprintf('%s - %s - %s', $value[0], $value[1], $value[2]);
|
||||
return sprintf('%s-%s-%s', $value[0], $value[1], $value[2]);
|
||||
|
||||
case 'textarea' :
|
||||
return nl2br($value);
|
||||
|
|
|
|||
|
|
@ -635,18 +635,13 @@ class FileHandler
|
|||
*/
|
||||
function returnBytes($val)
|
||||
{
|
||||
$last = strtolower(substr(trim($val), -1));
|
||||
switch ($last)
|
||||
$unit = strtoupper(substr($val, -1));
|
||||
$val = (int)$val;
|
||||
switch ($unit)
|
||||
{
|
||||
case 'g':
|
||||
$val *= 1024 * 1024 * 1024;
|
||||
break;
|
||||
case 'm':
|
||||
$val *= 1024 * 1024;
|
||||
break;
|
||||
case 'k':
|
||||
$val *= 1024;
|
||||
break;
|
||||
case 'G': $val *= 1024;
|
||||
case 'M': $val *= 1024;
|
||||
case 'K': $val *= 1024;
|
||||
}
|
||||
|
||||
return $val;
|
||||
|
|
|
|||
|
|
@ -551,7 +551,6 @@ class ModuleHandler extends Handler
|
|||
}
|
||||
|
||||
$xml_info = $oModuleModel->getModuleActionXml($forward->module);
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
if($this->module == "admin" && $type == "view")
|
||||
{
|
||||
|
|
@ -1161,6 +1160,13 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
//store before trigger call time
|
||||
$before_trigger_time = NULL;
|
||||
if(__LOG_SLOW_TRIGGER__> 0)
|
||||
{
|
||||
$before_trigger_time = microtime(true);
|
||||
}
|
||||
|
||||
foreach($triggers as $item)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -175,6 +175,55 @@ class Security
|
|||
return $var;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check XML External Entity
|
||||
*
|
||||
* @see from drupal. https://github.com/drupal/drupal/commit/90e884ad0f7f2cf269d953f7d70966de9fd821ff
|
||||
*
|
||||
* @param string $xml
|
||||
* @return bool
|
||||
*/
|
||||
static function detectingXEE($xml)
|
||||
{
|
||||
if(!$xml) return FALSE;
|
||||
|
||||
if(strpos($xml, '<!ENTITY') !== FALSE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Strip XML declaration.
|
||||
$header = preg_replace('/<\?xml.*?\?'.'>/s', '', substr($xml, 0, 100), 1);
|
||||
$xml = trim(substr_replace($xml, $header, 0, 100));
|
||||
if($xml == '')
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Strip DTD.
|
||||
$header = preg_replace('/^<!DOCTYPE[^>]*+>/i', '', substr($xml, 0, 200), 1);
|
||||
$xml = trim(substr_replace($xml, $header, 0, 200));
|
||||
if($xml == '')
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Confirm the XML now starts with a valid root tag. A root tag can end in [> \t\r\n]
|
||||
$root_tag = substr($xml, 0, strcspn(substr($xml, 0, 20), "> \t\r\n"));
|
||||
|
||||
// Reject a second DTD.
|
||||
if(strtoupper($root_tag) == '<!DOCTYPE')
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(!in_array($root_tag, array('<methodCall', '<methodResponse', '<fault')))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* End of file : Security.class.php */
|
||||
/* Location: ./classes/security/Security.class.php */
|
||||
|
|
|
|||
|
|
@ -596,14 +596,36 @@ function doDocumentLoad(obj) {
|
|||
}
|
||||
|
||||
/* 저장된 게시글의 선택 */
|
||||
function doDocumentSelect(document_srl) {
|
||||
function doDocumentSelect(document_srl, module) {
|
||||
if(!opener || !opener.objForSavedDoc) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
if(module===undefined) {
|
||||
module = 'document';
|
||||
}
|
||||
|
||||
// 게시글을 가져와서 등록하기
|
||||
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
|
||||
switch(module) {
|
||||
case 'page' :
|
||||
var url = opener.current_url;
|
||||
url = url.setQuery('document_srl', document_srl);
|
||||
|
||||
if(url.getQuery('act') === 'dispPageAdminMobileContentModify')
|
||||
{
|
||||
url = url.setQuery('act', 'dispPageAdminMobileContentModify');
|
||||
}
|
||||
else
|
||||
{
|
||||
url = url.setQuery('act', 'dispPageAdminContentModify');
|
||||
}
|
||||
opener.location.href = url;
|
||||
break;
|
||||
default :
|
||||
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
|
||||
break;
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
|||
826
common/js/modernizr.js
Normal file
826
common/js/modernizr.js
Normal file
|
|
@ -0,0 +1,826 @@
|
|||
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
|
||||
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load-cssclassprefix:modernizr!
|
||||
*/
|
||||
;
|
||||
|
||||
|
||||
|
||||
window.Modernizr = (function( window, document, undefined ) {
|
||||
|
||||
var version = '2.8.3',
|
||||
|
||||
Modernizr = {},
|
||||
|
||||
enableClasses = true,
|
||||
|
||||
docElement = document.documentElement,
|
||||
|
||||
mod = 'modernizr',
|
||||
modElem = document.createElement(mod),
|
||||
mStyle = modElem.style,
|
||||
|
||||
inputElem = document.createElement('input') ,
|
||||
|
||||
smile = ':)',
|
||||
|
||||
toString = {}.toString,
|
||||
|
||||
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
|
||||
|
||||
|
||||
|
||||
omPrefixes = 'Webkit Moz O ms',
|
||||
|
||||
cssomPrefixes = omPrefixes.split(' '),
|
||||
|
||||
domPrefixes = omPrefixes.toLowerCase().split(' '),
|
||||
|
||||
ns = {'svg': 'http://www.w3.org/2000/svg'},
|
||||
|
||||
tests = {},
|
||||
inputs = {},
|
||||
attrs = {},
|
||||
|
||||
classes = [],
|
||||
|
||||
slice = classes.slice,
|
||||
|
||||
featureName,
|
||||
|
||||
|
||||
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
|
||||
|
||||
var style, ret, node, docOverflow,
|
||||
div = document.createElement('div'),
|
||||
body = document.body,
|
||||
fakeBody = body || document.createElement('body');
|
||||
|
||||
if ( parseInt(nodes, 10) ) {
|
||||
while ( nodes-- ) {
|
||||
node = document.createElement('div');
|
||||
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
|
||||
div.appendChild(node);
|
||||
}
|
||||
}
|
||||
|
||||
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
|
||||
div.id = mod;
|
||||
(body ? div : fakeBody).innerHTML += style;
|
||||
fakeBody.appendChild(div);
|
||||
if ( !body ) {
|
||||
fakeBody.style.background = '';
|
||||
fakeBody.style.overflow = 'hidden';
|
||||
docOverflow = docElement.style.overflow;
|
||||
docElement.style.overflow = 'hidden';
|
||||
docElement.appendChild(fakeBody);
|
||||
}
|
||||
|
||||
ret = callback(div, rule);
|
||||
if ( !body ) {
|
||||
fakeBody.parentNode.removeChild(fakeBody);
|
||||
docElement.style.overflow = docOverflow;
|
||||
} else {
|
||||
div.parentNode.removeChild(div);
|
||||
}
|
||||
|
||||
return !!ret;
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
isEventSupported = (function() {
|
||||
|
||||
var TAGNAMES = {
|
||||
'select': 'input', 'change': 'input',
|
||||
'submit': 'form', 'reset': 'form',
|
||||
'error': 'img', 'load': 'img', 'abort': 'img'
|
||||
};
|
||||
|
||||
function isEventSupported( eventName, element ) {
|
||||
|
||||
element = element || document.createElement(TAGNAMES[eventName] || 'div');
|
||||
eventName = 'on' + eventName;
|
||||
|
||||
var isSupported = eventName in element;
|
||||
|
||||
if ( !isSupported ) {
|
||||
if ( !element.setAttribute ) {
|
||||
element = document.createElement('div');
|
||||
}
|
||||
if ( element.setAttribute && element.removeAttribute ) {
|
||||
element.setAttribute(eventName, '');
|
||||
isSupported = is(element[eventName], 'function');
|
||||
|
||||
if ( !is(element[eventName], 'undefined') ) {
|
||||
element[eventName] = undefined;
|
||||
}
|
||||
element.removeAttribute(eventName);
|
||||
}
|
||||
}
|
||||
|
||||
element = null;
|
||||
return isSupported;
|
||||
}
|
||||
return isEventSupported;
|
||||
})(),
|
||||
|
||||
|
||||
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
|
||||
|
||||
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
||||
hasOwnProp = function (object, property) {
|
||||
return _hasOwnProperty.call(object, property);
|
||||
};
|
||||
}
|
||||
else {
|
||||
hasOwnProp = function (object, property) {
|
||||
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function bind(that) {
|
||||
|
||||
var target = this;
|
||||
|
||||
if (typeof target != "function") {
|
||||
throw new TypeError();
|
||||
}
|
||||
|
||||
var args = slice.call(arguments, 1),
|
||||
bound = function () {
|
||||
|
||||
if (this instanceof bound) {
|
||||
|
||||
var F = function(){};
|
||||
F.prototype = target.prototype;
|
||||
var self = new F();
|
||||
|
||||
var result = target.apply(
|
||||
self,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
if (Object(result) === result) {
|
||||
return result;
|
||||
}
|
||||
return self;
|
||||
|
||||
} else {
|
||||
|
||||
return target.apply(
|
||||
that,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return bound;
|
||||
};
|
||||
}
|
||||
|
||||
function setCss( str ) {
|
||||
mStyle.cssText = str;
|
||||
}
|
||||
|
||||
function setCssAll( str1, str2 ) {
|
||||
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
||||
}
|
||||
|
||||
function is( obj, type ) {
|
||||
return typeof obj === type;
|
||||
}
|
||||
|
||||
function contains( str, substr ) {
|
||||
return !!~('' + str).indexOf(substr);
|
||||
}
|
||||
|
||||
function testProps( props, prefixed ) {
|
||||
for ( var i in props ) {
|
||||
var prop = props[i];
|
||||
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
|
||||
return prefixed == 'pfx' ? prop : true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function testDOMProps( props, obj, elem ) {
|
||||
for ( var i in props ) {
|
||||
var item = obj[props[i]];
|
||||
if ( item !== undefined) {
|
||||
|
||||
if (elem === false) return props[i];
|
||||
|
||||
if (is(item, 'function')){
|
||||
return item.bind(elem || obj);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function testPropsAll( prop, prefixed, elem ) {
|
||||
|
||||
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
||||
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
||||
|
||||
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
||||
return testProps(props, prefixed);
|
||||
|
||||
} else {
|
||||
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
||||
return testDOMProps(props, prefixed, elem);
|
||||
}
|
||||
} tests['flexbox'] = function() {
|
||||
return testPropsAll('flexWrap');
|
||||
};
|
||||
|
||||
|
||||
tests['flexboxlegacy'] = function() {
|
||||
return testPropsAll('boxDirection');
|
||||
};
|
||||
|
||||
|
||||
tests['canvas'] = function() {
|
||||
var elem = document.createElement('canvas');
|
||||
return !!(elem.getContext && elem.getContext('2d'));
|
||||
};
|
||||
|
||||
tests['canvastext'] = function() {
|
||||
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
||||
};
|
||||
|
||||
|
||||
|
||||
tests['webgl'] = function() {
|
||||
return !!window.WebGLRenderingContext;
|
||||
};
|
||||
|
||||
|
||||
tests['touch'] = function() {
|
||||
var bool;
|
||||
|
||||
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
||||
bool = true;
|
||||
} else {
|
||||
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
||||
bool = node.offsetTop === 9;
|
||||
});
|
||||
}
|
||||
|
||||
return bool;
|
||||
};
|
||||
|
||||
|
||||
|
||||
tests['geolocation'] = function() {
|
||||
return 'geolocation' in navigator;
|
||||
};
|
||||
|
||||
|
||||
tests['postmessage'] = function() {
|
||||
return !!window.postMessage;
|
||||
};
|
||||
|
||||
|
||||
tests['websqldatabase'] = function() {
|
||||
return !!window.openDatabase;
|
||||
};
|
||||
|
||||
tests['indexedDB'] = function() {
|
||||
return !!testPropsAll("indexedDB", window);
|
||||
};
|
||||
|
||||
tests['hashchange'] = function() {
|
||||
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
||||
};
|
||||
|
||||
tests['history'] = function() {
|
||||
return !!(window.history && history.pushState);
|
||||
};
|
||||
|
||||
tests['draganddrop'] = function() {
|
||||
var div = document.createElement('div');
|
||||
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
||||
};
|
||||
|
||||
tests['websockets'] = function() {
|
||||
return 'WebSocket' in window || 'MozWebSocket' in window;
|
||||
};
|
||||
|
||||
|
||||
tests['rgba'] = function() {
|
||||
setCss('background-color:rgba(150,255,150,.5)');
|
||||
|
||||
return contains(mStyle.backgroundColor, 'rgba');
|
||||
};
|
||||
|
||||
tests['hsla'] = function() {
|
||||
setCss('background-color:hsla(120,40%,100%,.5)');
|
||||
|
||||
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
||||
};
|
||||
|
||||
tests['multiplebgs'] = function() {
|
||||
setCss('background:url(https://),url(https://),red url(https://)');
|
||||
|
||||
return (/(url\s*\(.*?){3}/).test(mStyle.background);
|
||||
}; tests['backgroundsize'] = function() {
|
||||
return testPropsAll('backgroundSize');
|
||||
};
|
||||
|
||||
tests['borderimage'] = function() {
|
||||
return testPropsAll('borderImage');
|
||||
};
|
||||
|
||||
|
||||
|
||||
tests['borderradius'] = function() {
|
||||
return testPropsAll('borderRadius');
|
||||
};
|
||||
|
||||
tests['boxshadow'] = function() {
|
||||
return testPropsAll('boxShadow');
|
||||
};
|
||||
|
||||
tests['textshadow'] = function() {
|
||||
return document.createElement('div').style.textShadow === '';
|
||||
};
|
||||
|
||||
|
||||
tests['opacity'] = function() {
|
||||
setCssAll('opacity:.55');
|
||||
|
||||
return (/^0.55$/).test(mStyle.opacity);
|
||||
};
|
||||
|
||||
|
||||
tests['cssanimations'] = function() {
|
||||
return testPropsAll('animationName');
|
||||
};
|
||||
|
||||
|
||||
tests['csscolumns'] = function() {
|
||||
return testPropsAll('columnCount');
|
||||
};
|
||||
|
||||
|
||||
tests['cssgradients'] = function() {
|
||||
var str1 = 'background-image:',
|
||||
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
||||
str3 = 'linear-gradient(left top,#9f9, white);';
|
||||
|
||||
setCss(
|
||||
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
|
||||
prefixes.join(str3 + str1)).slice(0, -str1.length)
|
||||
);
|
||||
|
||||
return contains(mStyle.backgroundImage, 'gradient');
|
||||
};
|
||||
|
||||
|
||||
tests['cssreflections'] = function() {
|
||||
return testPropsAll('boxReflect');
|
||||
};
|
||||
|
||||
|
||||
tests['csstransforms'] = function() {
|
||||
return !!testPropsAll('transform');
|
||||
};
|
||||
|
||||
|
||||
tests['csstransforms3d'] = function() {
|
||||
|
||||
var ret = !!testPropsAll('perspective');
|
||||
|
||||
if ( ret && 'webkitPerspective' in docElement.style ) {
|
||||
|
||||
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
|
||||
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
tests['csstransitions'] = function() {
|
||||
return testPropsAll('transition');
|
||||
};
|
||||
|
||||
|
||||
|
||||
tests['fontface'] = function() {
|
||||
var bool;
|
||||
|
||||
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
|
||||
var style = document.getElementById('smodernizr'),
|
||||
sheet = style.sheet || style.styleSheet,
|
||||
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
|
||||
|
||||
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
|
||||
});
|
||||
|
||||
return bool;
|
||||
};
|
||||
|
||||
tests['generatedcontent'] = function() {
|
||||
var bool;
|
||||
|
||||
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
|
||||
bool = node.offsetHeight >= 3;
|
||||
});
|
||||
|
||||
return bool;
|
||||
};
|
||||
tests['video'] = function() {
|
||||
var elem = document.createElement('video'),
|
||||
bool = false;
|
||||
|
||||
try {
|
||||
if ( bool = !!elem.canPlayType ) {
|
||||
bool = new Boolean(bool);
|
||||
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
||||
|
||||
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
||||
|
||||
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
||||
}
|
||||
|
||||
} catch(e) { }
|
||||
|
||||
return bool;
|
||||
};
|
||||
|
||||
tests['audio'] = function() {
|
||||
var elem = document.createElement('audio'),
|
||||
bool = false;
|
||||
|
||||
try {
|
||||
if ( bool = !!elem.canPlayType ) {
|
||||
bool = new Boolean(bool);
|
||||
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
||||
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
||||
|
||||
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
||||
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
||||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
||||
}
|
||||
} catch(e) { }
|
||||
|
||||
return bool;
|
||||
};
|
||||
|
||||
|
||||
tests['localstorage'] = function() {
|
||||
try {
|
||||
localStorage.setItem(mod, mod);
|
||||
localStorage.removeItem(mod);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
tests['sessionstorage'] = function() {
|
||||
try {
|
||||
sessionStorage.setItem(mod, mod);
|
||||
sessionStorage.removeItem(mod);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
tests['webworkers'] = function() {
|
||||
return !!window.Worker;
|
||||
};
|
||||
|
||||
|
||||
tests['applicationcache'] = function() {
|
||||
return !!window.applicationCache;
|
||||
};
|
||||
|
||||
|
||||
tests['svg'] = function() {
|
||||
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
||||
};
|
||||
|
||||
tests['inlinesvg'] = function() {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<svg/>';
|
||||
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
||||
};
|
||||
|
||||
tests['smil'] = function() {
|
||||
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
||||
};
|
||||
|
||||
|
||||
tests['svgclippaths'] = function() {
|
||||
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
||||
};
|
||||
|
||||
function webforms() {
|
||||
Modernizr['input'] = (function( props ) {
|
||||
for ( var i = 0, len = props.length; i < len; i++ ) {
|
||||
attrs[ props[i] ] = !!(props[i] in inputElem);
|
||||
}
|
||||
if (attrs.list){
|
||||
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
||||
}
|
||||
return attrs;
|
||||
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
||||
Modernizr['inputtypes'] = (function(props) {
|
||||
|
||||
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
||||
|
||||
inputElem.setAttribute('type', inputElemType = props[i]);
|
||||
bool = inputElem.type !== 'text';
|
||||
|
||||
if ( bool ) {
|
||||
|
||||
inputElem.value = smile;
|
||||
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
||||
|
||||
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
||||
|
||||
docElement.appendChild(inputElem);
|
||||
defaultView = document.defaultView;
|
||||
|
||||
bool = defaultView.getComputedStyle &&
|
||||
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
||||
(inputElem.offsetHeight !== 0);
|
||||
|
||||
docElement.removeChild(inputElem);
|
||||
|
||||
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
||||
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
||||
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
||||
|
||||
} else {
|
||||
bool = inputElem.value != smile;
|
||||
}
|
||||
}
|
||||
|
||||
inputs[ props[i] ] = !!bool;
|
||||
}
|
||||
return inputs;
|
||||
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
||||
}
|
||||
for ( var feature in tests ) {
|
||||
if ( hasOwnProp(tests, feature) ) {
|
||||
featureName = feature.toLowerCase();
|
||||
Modernizr[featureName] = tests[feature]();
|
||||
|
||||
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
||||
}
|
||||
}
|
||||
|
||||
Modernizr.input || webforms();
|
||||
|
||||
|
||||
Modernizr.addTest = function ( feature, test ) {
|
||||
if ( typeof feature == 'object' ) {
|
||||
for ( var key in feature ) {
|
||||
if ( hasOwnProp( feature, key ) ) {
|
||||
Modernizr.addTest( key, feature[ key ] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
feature = feature.toLowerCase();
|
||||
|
||||
if ( Modernizr[feature] !== undefined ) {
|
||||
return Modernizr;
|
||||
}
|
||||
|
||||
test = typeof test == 'function' ? test() : test;
|
||||
|
||||
if (typeof enableClasses !== "undefined" && enableClasses) {
|
||||
docElement.className+=" modernizr-" + (test ? '' : 'no-') + feature;
|
||||
}
|
||||
Modernizr[feature] = test;
|
||||
|
||||
}
|
||||
|
||||
return Modernizr;
|
||||
};
|
||||
|
||||
|
||||
setCss('');
|
||||
modElem = inputElem = null;
|
||||
|
||||
;(function(window, document) {
|
||||
var version = '3.7.0';
|
||||
|
||||
var options = window.html5 || {};
|
||||
|
||||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||||
|
||||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||||
|
||||
var supportsHtml5Styles;
|
||||
|
||||
var expando = '_html5shiv';
|
||||
|
||||
var expanID = 0;
|
||||
|
||||
var expandoData = {};
|
||||
|
||||
var supportsUnknownElements;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
var a = document.createElement('a');
|
||||
a.innerHTML = '<xyz></xyz>';
|
||||
supportsHtml5Styles = ('hidden' in a);
|
||||
|
||||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||||
(document.createElement)('a');
|
||||
var frag = document.createDocumentFragment();
|
||||
return (
|
||||
typeof frag.cloneNode == 'undefined' ||
|
||||
typeof frag.createDocumentFragment == 'undefined' ||
|
||||
typeof frag.createElement == 'undefined'
|
||||
);
|
||||
}());
|
||||
} catch(e) {
|
||||
supportsHtml5Styles = true;
|
||||
supportsUnknownElements = true;
|
||||
}
|
||||
|
||||
}());
|
||||
|
||||
function addStyleSheet(ownerDocument, cssText) {
|
||||
var p = ownerDocument.createElement('p'),
|
||||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||||
|
||||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||||
}
|
||||
|
||||
function getElements() {
|
||||
var elements = html5.elements;
|
||||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||||
}
|
||||
|
||||
function getExpandoData(ownerDocument) {
|
||||
var data = expandoData[ownerDocument[expando]];
|
||||
if (!data) {
|
||||
data = {};
|
||||
expanID++;
|
||||
ownerDocument[expando] = expanID;
|
||||
expandoData[expanID] = data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function createElement(nodeName, ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createElement(nodeName);
|
||||
}
|
||||
if (!data) {
|
||||
data = getExpandoData(ownerDocument);
|
||||
}
|
||||
var node;
|
||||
|
||||
if (data.cache[nodeName]) {
|
||||
node = data.cache[nodeName].cloneNode();
|
||||
} else if (saveClones.test(nodeName)) {
|
||||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||||
} else {
|
||||
node = data.createElem(nodeName);
|
||||
}
|
||||
|
||||
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
||||
}
|
||||
|
||||
function createDocumentFragment(ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createDocumentFragment();
|
||||
}
|
||||
data = data || getExpandoData(ownerDocument);
|
||||
var clone = data.frag.cloneNode(),
|
||||
i = 0,
|
||||
elems = getElements(),
|
||||
l = elems.length;
|
||||
for(;i<l;i++){
|
||||
clone.createElement(elems[i]);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
function shivMethods(ownerDocument, data) {
|
||||
if (!data.cache) {
|
||||
data.cache = {};
|
||||
data.createElem = ownerDocument.createElement;
|
||||
data.createFrag = ownerDocument.createDocumentFragment;
|
||||
data.frag = data.createFrag();
|
||||
}
|
||||
|
||||
|
||||
ownerDocument.createElement = function(nodeName) {
|
||||
if (!html5.shivMethods) {
|
||||
return data.createElem(nodeName);
|
||||
}
|
||||
return createElement(nodeName, ownerDocument, data);
|
||||
};
|
||||
|
||||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||||
'var n=f.cloneNode(),c=n.createElement;' +
|
||||
'h.shivMethods&&(' +
|
||||
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
|
||||
data.createElem(nodeName);
|
||||
data.frag.createElement(nodeName);
|
||||
return 'c("' + nodeName + '")';
|
||||
}) +
|
||||
');return n}'
|
||||
)(html5, data.frag);
|
||||
}
|
||||
|
||||
function shivDocument(ownerDocument) {
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
var data = getExpandoData(ownerDocument);
|
||||
|
||||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||||
'mark{background:#FF0;color:#000}' +
|
||||
'template{display:none}'
|
||||
);
|
||||
}
|
||||
if (!supportsUnknownElements) {
|
||||
shivMethods(ownerDocument, data);
|
||||
}
|
||||
return ownerDocument;
|
||||
}
|
||||
|
||||
var html5 = {
|
||||
|
||||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
|
||||
|
||||
'version': version,
|
||||
|
||||
'shivCSS': (options.shivCSS !== false),
|
||||
|
||||
'supportsUnknownElements': supportsUnknownElements,
|
||||
|
||||
'shivMethods': (options.shivMethods !== false),
|
||||
|
||||
'type': 'default',
|
||||
|
||||
'shivDocument': shivDocument,
|
||||
|
||||
createElement: createElement,
|
||||
|
||||
createDocumentFragment: createDocumentFragment
|
||||
};
|
||||
|
||||
window.html5 = html5;
|
||||
|
||||
shivDocument(document);
|
||||
|
||||
}(this, document));
|
||||
|
||||
Modernizr._version = version;
|
||||
|
||||
Modernizr._prefixes = prefixes;
|
||||
Modernizr._domPrefixes = domPrefixes;
|
||||
Modernizr._cssomPrefixes = cssomPrefixes;
|
||||
|
||||
|
||||
Modernizr.hasEvent = isEventSupported;
|
||||
|
||||
Modernizr.testProp = function(prop){
|
||||
return testProps([prop]);
|
||||
};
|
||||
|
||||
Modernizr.testAllProps = testPropsAll;
|
||||
|
||||
|
||||
Modernizr.testStyles = injectElementWithStyles; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
||||
|
||||
(enableClasses ? " modernizr-js modernizr-"+classes.join(" modernizr-") : '');
|
||||
|
||||
return Modernizr;
|
||||
|
||||
})(this, this.document);
|
||||
/*yepnope1.5.4|WTFPL*/
|
||||
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document);
|
||||
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
|
||||
;
|
||||
4
common/js/modernizr.min.js
vendored
Normal file
4
common/js/modernizr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
common/js/x.min.js
vendored
3
common/js/x.min.js
vendored
File diff suppressed because one or more lines are too long
1
common/js/x.min.map
Normal file
1
common/js/x.min.map
Normal file
File diff suppressed because one or more lines are too long
1001
common/js/xe.js
1001
common/js/xe.js
File diff suppressed because it is too large
Load diff
9
common/js/xe.min.js
vendored
9
common/js/xe.min.js
vendored
File diff suppressed because one or more lines are too long
1
common/js/xe.min.map
Normal file
1
common/js/xe.min.map
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -237,17 +237,33 @@ function xml2json(xml, tab, ignoreAttrib) {
|
|||
// 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송
|
||||
if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params);
|
||||
|
||||
var xml = [], i = 0;
|
||||
xml[i++] = '<?xml version="1.0" encoding="utf-8" ?>';
|
||||
xml[i++] = '<methodCall>';
|
||||
xml[i++] = '<params>';
|
||||
var xml = [],
|
||||
xmlHelper = function(params) {
|
||||
var stack = [];
|
||||
|
||||
$.each(params, function(key, val) {
|
||||
xml[i++] = '<'+key+'><![CDATA['+val+']]></'+key+'>';
|
||||
});
|
||||
if ($.isArray(params)) {
|
||||
$.each(params, function(key, val) {
|
||||
stack.push('<value type="array">' + xmlHelper(val) + '</value>');
|
||||
});
|
||||
}
|
||||
else if ($.isPlainObject(params)) {
|
||||
$.each(params, function(key, val) {
|
||||
stack.push('<' + key + '>' + xmlHelper(val) + '</' + key + '>');
|
||||
});
|
||||
}
|
||||
else if (!$.isFunction(params)) {
|
||||
stack.push('<![CDATA[' + params + ']]>');
|
||||
}
|
||||
|
||||
xml[i++] = '</params>';
|
||||
xml[i++] = '</methodCall>';
|
||||
return stack.join('\n');
|
||||
};
|
||||
|
||||
xml.push('<?xml version="1.0" encoding="utf-8" ?>');
|
||||
xml.push('<methodCall>');
|
||||
xml.push('<params>');
|
||||
xml.push(xmlHelper(params));
|
||||
xml.push('</params>');
|
||||
xml.push('</methodCall>');
|
||||
|
||||
var _xhr = null;
|
||||
if (_xhr && _xhr.readyState !== 0) _xhr.abort();
|
||||
|
|
@ -414,31 +430,55 @@ function xml2json(xml, tab, ignoreAttrib) {
|
|||
|
||||
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: request_uri,
|
||||
contentType: "application/json",
|
||||
data: $.param(data),
|
||||
success: function(data) {
|
||||
$(".wfsr").hide().trigger('cancel_confirm');
|
||||
if(data.error != '0' && data.error > -1000) {
|
||||
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
|
||||
alert('You are not logged in as an administrator');
|
||||
if($.isFunction(callback_error)) callback_error(data);
|
||||
try {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: request_uri,
|
||||
contentType: "application/json",
|
||||
data: $.param(data),
|
||||
success: function(data) {
|
||||
$(".wfsr").hide().trigger('cancel_confirm');
|
||||
if(data.error != '0' && data.error > -1000) {
|
||||
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
|
||||
alert('You are not logged in as an administrator');
|
||||
if($.isFunction(callback_error)) callback_error(data);
|
||||
|
||||
return;
|
||||
} else {
|
||||
alert(data.message);
|
||||
if($.isFunction(callback_error)) callback_error(data);
|
||||
return;
|
||||
} else {
|
||||
alert(data.message);
|
||||
if($.isFunction(callback_error)) callback_error(data);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($.isFunction(callback_sucess)) callback_sucess(data);
|
||||
}
|
||||
});
|
||||
if($.isFunction(callback_sucess)) callback_sucess(data);
|
||||
},
|
||||
error: function(xhr, textStatus) {
|
||||
$(".wfsr").hide();
|
||||
|
||||
var msg = '';
|
||||
|
||||
if (textStatus == 'parsererror') {
|
||||
msg = 'The result is not valid JSON :\n-------------------------------------\n';
|
||||
|
||||
if(xhr.responseText === "") return;
|
||||
|
||||
msg += xhr.responseText.replace(/<[^>]+>/g, '');
|
||||
} else {
|
||||
msg = textStatus;
|
||||
}
|
||||
|
||||
try{
|
||||
console.log(msg);
|
||||
} catch(ee){}
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -458,17 +498,43 @@ function xml2json(xml, tab, ignoreAttrib) {
|
|||
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
|
||||
|
||||
$.extend(data,{module:action[0],act:action[1]});
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
dataType:"html",
|
||||
url:request_uri,
|
||||
data:$.param(data),
|
||||
success : function(html){
|
||||
$(".wfsr").hide().trigger('cancel_confirm');
|
||||
self[type](html);
|
||||
if($.isFunction(func)) func(args);
|
||||
}
|
||||
});
|
||||
try {
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
dataType:"html",
|
||||
url:request_uri,
|
||||
data:$.param(data),
|
||||
success : function(html){
|
||||
$(".wfsr").hide().trigger('cancel_confirm');
|
||||
self[type](html);
|
||||
if($.isFunction(func)) func(args);
|
||||
},
|
||||
error: function(xhr, textStatus) {
|
||||
$(".wfsr").hide();
|
||||
|
||||
var msg = '';
|
||||
|
||||
if (textStatus == 'parsererror') {
|
||||
msg = 'The result is not valid page :\n-------------------------------------\n';
|
||||
|
||||
if(xhr.responseText === "") return;
|
||||
|
||||
msg += xhr.responseText.replace(/<[^>]+>/g, '');
|
||||
} else {
|
||||
msg = textStatus;
|
||||
}
|
||||
|
||||
try{
|
||||
console.log(msg);
|
||||
} catch(ee){}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<value xml:lang="ko"><![CDATA[도움말]]></value>
|
||||
<value xml:lang="en"><![CDATA[Help]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ヘルプ]]></value>
|
||||
<value xml:lang="de"><![CDATA[Hilfe]]></value>
|
||||
</item>
|
||||
<item name="cmd_write">
|
||||
<value xml:lang="ko"><![CDATA[쓰기]]></value>
|
||||
|
|
@ -93,6 +94,7 @@
|
|||
<value xml:lang="ko"><![CDATA[조회]]></value>
|
||||
<value xml:lang="en"><![CDATA[Inquiry]]></value>
|
||||
<value xml:lang="jp"><![CDATA[お問い合わせ]]></value>
|
||||
<value xml:lang="de"><![CDATA[Ansichten]]></value>
|
||||
</item>
|
||||
<item name="all">
|
||||
<value xml:lang="ko"><![CDATA[전체]]></value>
|
||||
|
|
@ -100,6 +102,7 @@
|
|||
<value xml:lang="jp"><![CDATA[すべて]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[全部]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[全部]]></value>
|
||||
<value xml:lang="de"><![CDATA[Alle]]></value>
|
||||
</item>
|
||||
<item name="cmd_view_all">
|
||||
<value xml:lang="ko"><![CDATA[전체 보기]]></value>
|
||||
|
|
@ -1972,6 +1975,7 @@
|
|||
<value xml:lang="jp"><![CDATA[非推奨数]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[Blames]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[Blames]]></value>
|
||||
<value xml:lang="de"><![CDATA[Anzahl der Neinsager]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Suçlama]]></value>
|
||||
</item>
|
||||
<item name="comment_count">
|
||||
|
|
@ -2176,7 +2180,7 @@
|
|||
<value xml:lang="zh-CN"><![CDATA[版面管理]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[討論板管理]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Administration des Panneaux]]></value>
|
||||
<value xml:lang="de"><![CDATA[Forum verwalten]]></value>
|
||||
<value xml:lang="de"><![CDATA[Anschlagbrett verwalten]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Настройки форума]]></value>
|
||||
<value xml:lang="es"><![CDATA[Adm. Tableros]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Yönetim Ayarları]]></value>
|
||||
|
|
@ -2303,7 +2307,7 @@
|
|||
<value xml:lang="jp"><![CDATA[その他]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[其他]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[其他]]></value>
|
||||
<value xml:lang="de"><![CDATA[Sonstiges]]></value>
|
||||
<value xml:lang="de"><![CDATA[Ander]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Diğer]]></value>
|
||||
</item>
|
||||
<item name="unit_sec">
|
||||
|
|
@ -2394,6 +2398,7 @@
|
|||
<value xml:lang="ko"><![CDATA[회]]></value>
|
||||
<value xml:lang="en"><![CDATA[count]]></value>
|
||||
<value xml:lang="jp"><![CDATA[回]]></value>
|
||||
<value xml:lang="de"><![CDATA[Zeit]]></value>
|
||||
</item>
|
||||
<item name="unit_week" type="array">
|
||||
<item name="Monday">
|
||||
|
|
@ -2627,26 +2632,32 @@
|
|||
<value xml:lang="ko"><![CDATA[IP주소 입력형식<br />1. 와일드카드(*) 사용가능(예: 192.168.0.*)<br />2. 하이픈(-)을 사용하여 대역으로 입력가능<br />(단, 대역폭으로 입력할 경우 와일드카드 사용불가. 예: 192.168.0.1-192.168.0.254)<br />3.여러개의 항목은 줄을 바꾸어 입력하세요]]></value>
|
||||
<value xml:lang="en"><![CDATA[IP address input format<br />You can use wildcard(*) (ex: 192.168.0.*)<br />You can use hyphen(*) for ip range (you can't use wild card with hyphen, ex: 192.168.0.1-192.168.0.254)<br />]]></value>
|
||||
<value xml:lang="jp"><![CDATA[IPアドレス入力方法<br />1.ワイルドカード(*)使用可能(例:192.168.0.*)<br />2.ハイフン(-)を使用して帯域で入力可能<br />(ただし、帯域幅で入力する場合、ワイルドカードは使用不可。例:192.168.0.1-192.168.0.254)<br />3.複数の項目は行を変えて入力してください。]]></value>
|
||||
<value xml:lang="de"><![CDATA[IP adresse eingabeformat<br />Sie können Platzhalter (*) verwenden (zB:. 192.168.0 *)<br />Sie können Bindestrich (*) für IP-Bereich nutzen (können Sie nicht wild card mit Bindestrich, ex: 192.168.0.1-192.168.0.254)]]></value>
|
||||
|
||||
</item>
|
||||
<item name="msg_invalid_ip">
|
||||
<value xml:lang="ko"><![CDATA[잘못된 IP주소 형식입니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Specified IP address is invalid.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[正しくないIPアドレス形式です。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Angegebenen IP adresse ist ungültig.]]></value>
|
||||
</item>
|
||||
<item name="msg_no_root">
|
||||
<value xml:lang="ko"><![CDATA[루트는 선택 할 수 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You cannot select a root.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ルートは選択できません。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Sie können eine root nicht auswählen.]]></value>
|
||||
</item>
|
||||
<item name="msg_no_shortcut">
|
||||
<value xml:lang="ko"><![CDATA[바로가기는 선택 할 수 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You cannot select a shortcut.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ショートカットは選択できません。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Sie können eine verknüpfung nicht auswählen.]]></value>
|
||||
</item>
|
||||
<item name="msg_select_menu">
|
||||
<value xml:lang="ko"><![CDATA[대상 메뉴 선택]]></value>
|
||||
<value xml:lang="en"><![CDATA[Select target menu]]></value>
|
||||
<value xml:lang="jp"><![CDATA[対象メニュー選択]]></value>
|
||||
<value xml:lang="de"><![CDATA[Wählen Sie das Menü, das Sie anwenden möchten]]></value>
|
||||
</item>
|
||||
<item name="msg_call_server">
|
||||
<value xml:lang="ko"><![CDATA[서버에 요청 중입니다. 잠시만 기다려주세요.]]></value>
|
||||
|
|
@ -2890,6 +2901,7 @@
|
|||
<value xml:lang="jp"><![CDATA[検索対象がありません。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[搜索不到目标]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[搜尋不到目標]]></value>
|
||||
<value xml:lang="de"><![CDATA[Nicht finden können die das Suchziel.]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Arama amacı bulunamadı]]></value>
|
||||
</item>
|
||||
<item name="msg_empty_search_keyword">
|
||||
|
|
@ -2898,6 +2910,7 @@
|
|||
<value xml:lang="jp"><![CDATA[キーワードがありません。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[搜索不到关键字]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[搜尋不到關鍵字]]></value>
|
||||
<value xml:lang="de"><![CDATA[Nicht finden können das Stichwort.]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Anahtar kelime yok]]></value>
|
||||
</item>
|
||||
<item name="comment_to_be_approved">
|
||||
|
|
@ -2905,6 +2918,7 @@
|
|||
<value xml:lang="en"><![CDATA[Your comment must be approved by admin before being published.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[管理者の確認が必要なコメントです。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[您的回复在通过管理员审核之后才会被显示出来。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Ihr Kommentar muss von admin vor der Veröffentlichung genehmigt werden.]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Yorumunuz, yayınlanmadan önce adminden onay almanız gerekir]]></value>
|
||||
</item>
|
||||
<item name="success_registed">
|
||||
|
|
@ -2964,9 +2978,10 @@
|
|||
<value xml:lang="mn"><![CDATA[Устгагдсан]]></value>
|
||||
</item>
|
||||
<item name="success_declare_canceled">
|
||||
<value xml:lang="ko"><![CDATA[신고 취소되었습니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[신고가 취소되었습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Declare was canceled successfully.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[通報が取り消しされました。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Deklarieren wurde abgebrochen.]]></value>
|
||||
</item>
|
||||
<item name="success_restore">
|
||||
<value xml:lang="ko"><![CDATA[복원했습니다.]]></value>
|
||||
|
|
@ -3092,6 +3107,7 @@
|
|||
<value xml:lang="ko"><![CDATA[수정하지 못했습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Fail to update.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[修正されませんでした。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Update fehlgeschlagen]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Güncellenemedi]]></value>
|
||||
</item>
|
||||
<item name="fail_to_delete">
|
||||
|
|
@ -3301,6 +3317,7 @@
|
|||
<value xml:lang="ko"><![CDATA[처리하시겠습니까?]]></value>
|
||||
<value xml:lang="en"><![CDATA[Are you sure you want to process?]]></value>
|
||||
<value xml:lang="jp"><![CDATA[処理しますか?]]></value>
|
||||
<value xml:lang="de"><![CDATA[Sind Sie sicher, dass Sie fortfahren möchten?]]></value>
|
||||
</item>
|
||||
<item name="column_type">
|
||||
<value xml:lang="ko"><![CDATA[형식]]></value>
|
||||
|
|
@ -3578,6 +3595,7 @@
|
|||
<value xml:lang="jp"><![CDATA[%sの値が正しくありません。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[%s值有误。]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[%s值有誤。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Der Wert% ist ungültig.]]></value>
|
||||
<value xml:lang="tr"><![CDATA[%s değeri uymuyordur.]]></value>
|
||||
</item>
|
||||
<item name="invalid_email">
|
||||
|
|
@ -3835,6 +3853,7 @@
|
|||
<value xml:lang="ko"><![CDATA[모바일]]></value>
|
||||
<value xml:lang="en"><![CDATA[Mobile]]></value>
|
||||
<value xml:lang="jp"><![CDATA[モバイル]]></value>
|
||||
<value xml:lang="de"><![CDATA[Handy]]></value>
|
||||
</item>
|
||||
<item name="mobile_view">
|
||||
<value xml:lang="ko"><![CDATA[모바일 뷰 사용]]></value>
|
||||
|
|
@ -3865,6 +3884,7 @@
|
|||
<value xml:lang="en"><![CDATA[Simple View]]></value>
|
||||
<value xml:lang="jp"><![CDATA[シンプルビュー]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[预览]]></value>
|
||||
<value xml:lang="de"><![CDATA[einfache ansicht]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Basit Görünüm]]></value>
|
||||
</item>
|
||||
<item name="detail_view">
|
||||
|
|
@ -3872,6 +3892,7 @@
|
|||
<value xml:lang="en"><![CDATA[Detail View]]></value>
|
||||
<value xml:lang="jp"><![CDATA[詳細ビュー]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[查看详情]]></value>
|
||||
<value xml:lang="de"><![CDATA[detail ansicht]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Detaylı Görünüm]]></value>
|
||||
</item>
|
||||
<item name="more">
|
||||
|
|
@ -3880,19 +3901,22 @@
|
|||
<value xml:lang="jp"><![CDATA[もっと見る]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[更多]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[更多]]></value>
|
||||
<value xml:lang="de"><![CDATA[mehr]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Daha Fazla]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Xem thêm]]></value>
|
||||
</item>
|
||||
<item name="skip_to_content">
|
||||
<value xml:lang="ko"><![CDATA[메뉴 건너뛰기]]></value>
|
||||
<value xml:lang="en"><![CDATA[Skip to content]]></value>
|
||||
<value xml:lang="en"><![CDATA[Skip to menu]]></value>
|
||||
<value xml:lang="jp"><![CDATA[メニュースキップ]]></value>
|
||||
<value xml:lang="de"><![CDATA[Menü überspringen]]></value>
|
||||
</item>
|
||||
<item name="dashboard">
|
||||
<value xml:lang="ko"><![CDATA[대시보드]]></value>
|
||||
<value xml:lang="en"><![CDATA[Dashboard]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ダッシュボード]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[控制面板]]></value>
|
||||
<value xml:lang="de"><![CDATA[Armaturenbrett]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Kontrol Paneli]]></value>
|
||||
</item>
|
||||
<item name="user">
|
||||
|
|
@ -3900,29 +3924,33 @@
|
|||
<value xml:lang="en"><![CDATA[Member]]></value>
|
||||
<value xml:lang="jp"><![CDATA[会員]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[会员]]></value>
|
||||
<value xml:lang="de"><![CDATA[Mitglied]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Üye]]></value>
|
||||
</item>
|
||||
<item name="yes">
|
||||
<value xml:lang="ko"><![CDATA[예]]></value>
|
||||
<value xml:lang="en"><![CDATA[Yes]]></value>
|
||||
<value xml:lang="jp"><![CDATA[はい]]></value>
|
||||
<value xml:lang="de"><![CDATA[ja]]></value>
|
||||
</item>
|
||||
<item name="not">
|
||||
<value xml:lang="ko"><![CDATA[아니오]]></value>
|
||||
<value xml:lang="en"><![CDATA[No]]></value>
|
||||
<value xml:lang="jp"><![CDATA[いいえ]]></value>
|
||||
<value xml:lang="de"><![CDATA[nicht]]></value>
|
||||
</item>
|
||||
<item name="msg_default_url_is_null">
|
||||
<value xml:lang="ko"><![CDATA[기본 URL 설정이 안 되어 있습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Default url is null.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[基本URLが設定されていません。]]></value>
|
||||
<value xml:lang="de"><![CDATA[Standard URL ist null.]]></value>
|
||||
</item>
|
||||
<item name="license_agreement">
|
||||
<value xml:lang="ko"><![CDATA[사용권 동의]]></value>
|
||||
<value xml:lang="en"><![CDATA[License agree]]></value>
|
||||
</item>
|
||||
<item name="license">
|
||||
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER <http://www.navercorp.com></p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
|
||||
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER <http://www.navercorp.com></p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://korea.gnu.org/people/chsong/copyleft/lgpl.ko.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
|
||||
<value xml:lang="en"><![CDATA[<p>Copyright (C) NAVER <http://www.navercorp.com></p> <p>"XpressEngine (XE)" is an opensource and being developed in the opensource project. For more information, please see the link below.</p> <ul> <li>Official website: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>Official Repository: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)" is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.</p> <p>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p> <p>You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</p> <ul> <li>License : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
|
||||
</item>
|
||||
<item name="cmd_license_agree">
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<script src="{$js_file['file']}"></script>
|
||||
<block cond="$js_file['targetie']"><![endif]--></block>
|
||||
</block>
|
||||
<!--[if lt IE 9]><script src="../js/html5.js"></script><![endif]-->
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" cond="$rss_url" />
|
||||
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" cond="$general_rss_url" />
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
<script src="{$js_file['file']}"></script>
|
||||
<block cond="$js_file['targetie']"><![endif]--></block>
|
||||
</block>
|
||||
<!--[if lt IE 9]><script src="../js/html5.js"></script><![endif]-->
|
||||
|
||||
<!--// RSS -->
|
||||
<!--@if($rss_url)-->
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var idx = location.href.indexOf('?');
|
||||
var url = parent.location.href;
|
||||
var url = location.href;
|
||||
var idx = url.indexOf('?');
|
||||
|
||||
if(idx > -1 ) {
|
||||
var query_string = location.href.substr(idx+1, location.href.length);
|
||||
var args = {};
|
||||
|
|
@ -23,4 +24,4 @@
|
|||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ define('__ZBXE__', __XE__);
|
|||
/**
|
||||
* Display XE's full version.
|
||||
*/
|
||||
define('__XE_VERSION__', '1.7.8');
|
||||
define('__XE_VERSION__', '1.7.12');
|
||||
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
|
||||
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
|
||||
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));
|
||||
define('__XE_VERSION_STABLE__', (!__XE_VERSION_ALPHA__ && !__XE_VERSION_BETA__ && !__XE_VERSION_RC__));
|
||||
|
||||
define('__XE_MIN_PHP_VERSION__', '5.3.0');
|
||||
|
||||
/**
|
||||
* @deprecated __ZBXE_VERSION__ will be removed. Use __XE_VERSION__ instead.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1101,8 +1101,22 @@ function removeHackTag($content)
|
|||
*/
|
||||
$content = preg_replace_callback('@<(/?)([a-z]+[0-9]?)((?>"[^"]*"|\'[^\']*\'|[^>])*?\b(?:on[a-z]+|data|style|background|href|(?:dyn|low)?src)\s*=[\s\S]*?)(/?)($|>|<)@i', 'removeSrcHack', $content);
|
||||
|
||||
// xmp tag ?뺤씤 <20>??<3F>붽?
|
||||
$content = checkXmpTag($content);
|
||||
$content = blockWidgetCode($content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* blocking widget code
|
||||
*
|
||||
* @param string $content Taget content
|
||||
* @return string
|
||||
**/
|
||||
function blockWidgetCode($content)
|
||||
{
|
||||
$content = preg_replace('/(<(?:img|div)(?:[^>]*))(widget)(?:(=([^>]*?)>))/is', '$1blocked-widget$3', $content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
|
@ -1539,7 +1553,7 @@ function requirePear()
|
|||
}
|
||||
else
|
||||
{
|
||||
set_include_path(_XE_PATH_ . "libs/PEAR.1.9");
|
||||
set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
55
libs/PEAR.1.9.5/HTTP/Request.php
Normal file
55
libs/PEAR.1.9.5/HTTP/Request.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
require_once 'HTTP/Request2.php';
|
||||
|
||||
class HTTP_Request extends HTTP_Request2
|
||||
{
|
||||
private $reponse = null;
|
||||
|
||||
public function addHeader($name, $value)
|
||||
{
|
||||
$this->setHeader($name, $value);
|
||||
}
|
||||
|
||||
public function sendRequest($saveBody = true)
|
||||
{
|
||||
$response = $this->send();
|
||||
$this->response = $response;
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getResponseCode() {
|
||||
if($this->response)
|
||||
{
|
||||
return $this->response->getStatus();
|
||||
}
|
||||
}
|
||||
|
||||
public function getResponseHeader() {
|
||||
if($this->response)
|
||||
{
|
||||
return $this->response->getHeader();
|
||||
}
|
||||
}
|
||||
|
||||
public function getResponseBody() {
|
||||
if($this->response)
|
||||
{
|
||||
return $this->response->getBody();
|
||||
}
|
||||
}
|
||||
|
||||
public function getResponseCookies() {
|
||||
if($this->response)
|
||||
{
|
||||
return $this->response->getCookies();
|
||||
}
|
||||
}
|
||||
|
||||
public function addPostData($name, $value, $preencoded = false)
|
||||
{
|
||||
$this->addPostParameter($name, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
1030
libs/PEAR.1.9.5/HTTP/Request2.php
Normal file
1030
libs/PEAR.1.9.5/HTTP/Request2.php
Normal file
File diff suppressed because it is too large
Load diff
137
libs/PEAR.1.9.5/HTTP/Request2/Adapter.php
Normal file
137
libs/PEAR.1.9.5/HTTP/Request2/Adapter.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
/**
|
||||
* Base class for HTTP_Request2 adapters
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class representing a HTTP response
|
||||
*/
|
||||
require_once 'HTTP/Request2/Response.php';
|
||||
|
||||
/**
|
||||
* Base class for HTTP_Request2 adapters
|
||||
*
|
||||
* HTTP_Request2 class itself only defines methods for aggregating the request
|
||||
* data, all actual work of sending the request to the remote server and
|
||||
* receiving its response is performed by adapters.
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
abstract class HTTP_Request2_Adapter
|
||||
{
|
||||
/**
|
||||
* A list of methods that MUST NOT have a request body, per RFC 2616
|
||||
* @var array
|
||||
*/
|
||||
protected static $bodyDisallowed = array('TRACE');
|
||||
|
||||
/**
|
||||
* Methods having defined semantics for request body
|
||||
*
|
||||
* Content-Length header (indicating that the body follows, section 4.3 of
|
||||
* RFC 2616) will be sent for these methods even if no body was added
|
||||
*
|
||||
* @var array
|
||||
* @link http://pear.php.net/bugs/bug.php?id=12900
|
||||
* @link http://pear.php.net/bugs/bug.php?id=14740
|
||||
*/
|
||||
protected static $bodyRequired = array('POST', 'PUT');
|
||||
|
||||
/**
|
||||
* Request being sent
|
||||
* @var HTTP_Request2
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Request body
|
||||
* @var string|resource|HTTP_Request2_MultipartBody
|
||||
* @see HTTP_Request2::getBody()
|
||||
*/
|
||||
protected $requestBody;
|
||||
|
||||
/**
|
||||
* Length of the request body
|
||||
* @var integer
|
||||
*/
|
||||
protected $contentLength;
|
||||
|
||||
/**
|
||||
* Sends request to the remote server and returns its response
|
||||
*
|
||||
* @param HTTP_Request2 $request HTTP request message
|
||||
*
|
||||
* @return HTTP_Request2_Response
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
abstract public function sendRequest(HTTP_Request2 $request);
|
||||
|
||||
/**
|
||||
* Calculates length of the request body, adds proper headers
|
||||
*
|
||||
* @param array &$headers associative array of request headers, this method
|
||||
* will add proper 'Content-Length' and 'Content-Type'
|
||||
* headers to this array (or remove them if not needed)
|
||||
*/
|
||||
protected function calculateRequestLength(&$headers)
|
||||
{
|
||||
$this->requestBody = $this->request->getBody();
|
||||
|
||||
if (is_string($this->requestBody)) {
|
||||
$this->contentLength = strlen($this->requestBody);
|
||||
} elseif (is_resource($this->requestBody)) {
|
||||
$stat = fstat($this->requestBody);
|
||||
$this->contentLength = $stat['size'];
|
||||
rewind($this->requestBody);
|
||||
} else {
|
||||
$this->contentLength = $this->requestBody->getLength();
|
||||
$headers['content-type'] = 'multipart/form-data; boundary=' .
|
||||
$this->requestBody->getBoundary();
|
||||
$this->requestBody->rewind();
|
||||
}
|
||||
|
||||
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|
||||
|| 0 == $this->contentLength
|
||||
) {
|
||||
// No body: send a Content-Length header nonetheless (request #12900),
|
||||
// but do that only for methods that require a body (bug #14740)
|
||||
if (in_array($this->request->getMethod(), self::$bodyRequired)) {
|
||||
$headers['content-length'] = 0;
|
||||
} else {
|
||||
unset($headers['content-length']);
|
||||
// if the method doesn't require a body and doesn't have a
|
||||
// body, don't send a Content-Type header. (request #16799)
|
||||
unset($headers['content-type']);
|
||||
}
|
||||
} else {
|
||||
if (empty($headers['content-type'])) {
|
||||
$headers['content-type'] = 'application/x-www-form-urlencoded';
|
||||
}
|
||||
// Content-Length should not be sent for chunked Transfer-Encoding (bug #20125)
|
||||
if (!isset($headers['transfer-encoding'])) {
|
||||
$headers['content-length'] = $this->contentLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
567
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Curl.php
Normal file
567
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Curl.php
Normal file
|
|
@ -0,0 +1,567 @@
|
|||
<?php
|
||||
/**
|
||||
* Adapter for HTTP_Request2 wrapping around cURL extension
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for HTTP_Request2 adapters
|
||||
*/
|
||||
require_once 'HTTP/Request2/Adapter.php';
|
||||
|
||||
/**
|
||||
* Adapter for HTTP_Request2 wrapping around cURL extension
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter
|
||||
{
|
||||
/**
|
||||
* Mapping of header names to cURL options
|
||||
* @var array
|
||||
*/
|
||||
protected static $headerMap = array(
|
||||
'accept-encoding' => CURLOPT_ENCODING,
|
||||
'cookie' => CURLOPT_COOKIE,
|
||||
'referer' => CURLOPT_REFERER,
|
||||
'user-agent' => CURLOPT_USERAGENT
|
||||
);
|
||||
|
||||
/**
|
||||
* Mapping of SSL context options to cURL options
|
||||
* @var array
|
||||
*/
|
||||
protected static $sslContextMap = array(
|
||||
'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER,
|
||||
'ssl_cafile' => CURLOPT_CAINFO,
|
||||
'ssl_capath' => CURLOPT_CAPATH,
|
||||
'ssl_local_cert' => CURLOPT_SSLCERT,
|
||||
'ssl_passphrase' => CURLOPT_SSLCERTPASSWD
|
||||
);
|
||||
|
||||
/**
|
||||
* Mapping of CURLE_* constants to Exception subclasses and error codes
|
||||
* @var array
|
||||
*/
|
||||
protected static $errorMap = array(
|
||||
CURLE_UNSUPPORTED_PROTOCOL => array('HTTP_Request2_MessageException',
|
||||
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
|
||||
CURLE_COULDNT_RESOLVE_PROXY => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_COULDNT_RESOLVE_HOST => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_COULDNT_CONNECT => array('HTTP_Request2_ConnectionException'),
|
||||
// error returned from write callback
|
||||
CURLE_WRITE_ERROR => array('HTTP_Request2_MessageException',
|
||||
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
|
||||
CURLE_OPERATION_TIMEOUTED => array('HTTP_Request2_MessageException',
|
||||
HTTP_Request2_Exception::TIMEOUT),
|
||||
CURLE_HTTP_RANGE_ERROR => array('HTTP_Request2_MessageException'),
|
||||
CURLE_SSL_CONNECT_ERROR => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_LIBRARY_NOT_FOUND => array('HTTP_Request2_LogicException',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION),
|
||||
CURLE_FUNCTION_NOT_FOUND => array('HTTP_Request2_LogicException',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION),
|
||||
CURLE_ABORTED_BY_CALLBACK => array('HTTP_Request2_MessageException',
|
||||
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
|
||||
CURLE_TOO_MANY_REDIRECTS => array('HTTP_Request2_MessageException',
|
||||
HTTP_Request2_Exception::TOO_MANY_REDIRECTS),
|
||||
CURLE_SSL_PEER_CERTIFICATE => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_GOT_NOTHING => array('HTTP_Request2_MessageException'),
|
||||
CURLE_SSL_ENGINE_NOTFOUND => array('HTTP_Request2_LogicException',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION),
|
||||
CURLE_SSL_ENGINE_SETFAILED => array('HTTP_Request2_LogicException',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION),
|
||||
CURLE_SEND_ERROR => array('HTTP_Request2_MessageException'),
|
||||
CURLE_RECV_ERROR => array('HTTP_Request2_MessageException'),
|
||||
CURLE_SSL_CERTPROBLEM => array('HTTP_Request2_LogicException',
|
||||
HTTP_Request2_Exception::INVALID_ARGUMENT),
|
||||
CURLE_SSL_CIPHER => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_SSL_CACERT => array('HTTP_Request2_ConnectionException'),
|
||||
CURLE_BAD_CONTENT_ENCODING => array('HTTP_Request2_MessageException'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Response being received
|
||||
* @var HTTP_Request2_Response
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* Whether 'sentHeaders' event was sent to observers
|
||||
* @var boolean
|
||||
*/
|
||||
protected $eventSentHeaders = false;
|
||||
|
||||
/**
|
||||
* Whether 'receivedHeaders' event was sent to observers
|
||||
* @var boolean
|
||||
*/
|
||||
protected $eventReceivedHeaders = false;
|
||||
|
||||
/**
|
||||
* Position within request body
|
||||
* @var integer
|
||||
* @see callbackReadBody()
|
||||
*/
|
||||
protected $position = 0;
|
||||
|
||||
/**
|
||||
* Information about last transfer, as returned by curl_getinfo()
|
||||
* @var array
|
||||
*/
|
||||
protected $lastInfo;
|
||||
|
||||
/**
|
||||
* Creates a subclass of HTTP_Request2_Exception from curl error data
|
||||
*
|
||||
* @param resource $ch curl handle
|
||||
*
|
||||
* @return HTTP_Request2_Exception
|
||||
*/
|
||||
protected static function wrapCurlError($ch)
|
||||
{
|
||||
$nativeCode = curl_errno($ch);
|
||||
$message = 'Curl error: ' . curl_error($ch);
|
||||
if (!isset(self::$errorMap[$nativeCode])) {
|
||||
return new HTTP_Request2_Exception($message, 0, $nativeCode);
|
||||
} else {
|
||||
$class = self::$errorMap[$nativeCode][0];
|
||||
$code = empty(self::$errorMap[$nativeCode][1])
|
||||
? 0 : self::$errorMap[$nativeCode][1];
|
||||
return new $class($message, $code, $nativeCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends request to the remote server and returns its response
|
||||
*
|
||||
* @param HTTP_Request2 $request HTTP request message
|
||||
*
|
||||
* @return HTTP_Request2_Response
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
public function sendRequest(HTTP_Request2 $request)
|
||||
{
|
||||
if (!extension_loaded('curl')) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'cURL extension not available', HTTP_Request2_Exception::MISCONFIGURATION
|
||||
);
|
||||
}
|
||||
|
||||
$this->request = $request;
|
||||
$this->response = null;
|
||||
$this->position = 0;
|
||||
$this->eventSentHeaders = false;
|
||||
$this->eventReceivedHeaders = false;
|
||||
|
||||
try {
|
||||
if (false === curl_exec($ch = $this->createCurlHandle())) {
|
||||
$e = self::wrapCurlError($ch);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
if (isset($ch)) {
|
||||
$this->lastInfo = curl_getinfo($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
$response = $this->response;
|
||||
unset($this->request, $this->requestBody, $this->response);
|
||||
|
||||
if (!empty($e)) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if ($jar = $request->getCookieJar()) {
|
||||
$jar->addCookiesFromResponse($response, $request->getUrl());
|
||||
}
|
||||
|
||||
if (0 < $this->lastInfo['size_download']) {
|
||||
$request->setLastEvent('receivedBody', $response);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about last transfer
|
||||
*
|
||||
* @return array associative array as returned by curl_getinfo()
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
return $this->lastInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new cURL handle and populates it with data from the request
|
||||
*
|
||||
* @return resource a cURL handle, as created by curl_init()
|
||||
* @throws HTTP_Request2_LogicException
|
||||
* @throws HTTP_Request2_NotImplementedException
|
||||
*/
|
||||
protected function createCurlHandle()
|
||||
{
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt_array($ch, array(
|
||||
// setup write callbacks
|
||||
CURLOPT_HEADERFUNCTION => array($this, 'callbackWriteHeader'),
|
||||
CURLOPT_WRITEFUNCTION => array($this, 'callbackWriteBody'),
|
||||
// buffer size
|
||||
CURLOPT_BUFFERSIZE => $this->request->getConfig('buffer_size'),
|
||||
// connection timeout
|
||||
CURLOPT_CONNECTTIMEOUT => $this->request->getConfig('connect_timeout'),
|
||||
// save full outgoing headers, in case someone is interested
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
// request url
|
||||
CURLOPT_URL => $this->request->getUrl()->getUrl()
|
||||
));
|
||||
|
||||
// set up redirects
|
||||
if (!$this->request->getConfig('follow_redirects')) {
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
|
||||
} else {
|
||||
if (!@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true)) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Redirect support in curl is unavailable due to open_basedir or safe_mode setting',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION
|
||||
);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, $this->request->getConfig('max_redirects'));
|
||||
// limit redirects to http(s), works in 5.2.10+
|
||||
if (defined('CURLOPT_REDIR_PROTOCOLS')) {
|
||||
curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
}
|
||||
// works in 5.3.2+, http://bugs.php.net/bug.php?id=49571
|
||||
if ($this->request->getConfig('strict_redirects') && defined('CURLOPT_POSTREDIR')) {
|
||||
curl_setopt($ch, CURLOPT_POSTREDIR, 3);
|
||||
}
|
||||
}
|
||||
|
||||
// set local IP via CURLOPT_INTERFACE (request #19515)
|
||||
if ($ip = $this->request->getConfig('local_ip')) {
|
||||
curl_setopt($ch, CURLOPT_INTERFACE, $ip);
|
||||
}
|
||||
|
||||
// request timeout
|
||||
if ($timeout = $this->request->getConfig('timeout')) {
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||
}
|
||||
|
||||
// set HTTP version
|
||||
switch ($this->request->getConfig('protocol_version')) {
|
||||
case '1.0':
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||
break;
|
||||
case '1.1':
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||
}
|
||||
|
||||
// set request method
|
||||
switch ($this->request->getMethod()) {
|
||||
case HTTP_Request2::METHOD_GET:
|
||||
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
||||
break;
|
||||
case HTTP_Request2::METHOD_POST:
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
break;
|
||||
case HTTP_Request2::METHOD_HEAD:
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
break;
|
||||
case HTTP_Request2::METHOD_PUT:
|
||||
curl_setopt($ch, CURLOPT_UPLOAD, true);
|
||||
break;
|
||||
default:
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
|
||||
}
|
||||
|
||||
// set proxy, if needed
|
||||
if ($host = $this->request->getConfig('proxy_host')) {
|
||||
if (!($port = $this->request->getConfig('proxy_port'))) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Proxy port not provided', HTTP_Request2_Exception::MISSING_VALUE
|
||||
);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_PROXY, $host . ':' . $port);
|
||||
if ($user = $this->request->getConfig('proxy_user')) {
|
||||
curl_setopt(
|
||||
$ch, CURLOPT_PROXYUSERPWD,
|
||||
$user . ':' . $this->request->getConfig('proxy_password')
|
||||
);
|
||||
switch ($this->request->getConfig('proxy_auth_scheme')) {
|
||||
case HTTP_Request2::AUTH_BASIC:
|
||||
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
|
||||
break;
|
||||
case HTTP_Request2::AUTH_DIGEST:
|
||||
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST);
|
||||
}
|
||||
}
|
||||
if ($type = $this->request->getConfig('proxy_type')) {
|
||||
switch ($type) {
|
||||
case 'http':
|
||||
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
|
||||
break;
|
||||
case 'socks5':
|
||||
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
|
||||
break;
|
||||
default:
|
||||
throw new HTTP_Request2_NotImplementedException(
|
||||
"Proxy type '{$type}' is not supported"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set authentication data
|
||||
if ($auth = $this->request->getAuth()) {
|
||||
curl_setopt($ch, CURLOPT_USERPWD, $auth['user'] . ':' . $auth['password']);
|
||||
switch ($auth['scheme']) {
|
||||
case HTTP_Request2::AUTH_BASIC:
|
||||
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||
break;
|
||||
case HTTP_Request2::AUTH_DIGEST:
|
||||
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
}
|
||||
}
|
||||
|
||||
// set SSL options
|
||||
foreach ($this->request->getConfig() as $name => $value) {
|
||||
if ('ssl_verify_host' == $name && null !== $value) {
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value? 2: 0);
|
||||
} elseif (isset(self::$sslContextMap[$name]) && null !== $value) {
|
||||
curl_setopt($ch, self::$sslContextMap[$name], $value);
|
||||
}
|
||||
}
|
||||
|
||||
$headers = $this->request->getHeaders();
|
||||
// make cURL automagically send proper header
|
||||
if (!isset($headers['accept-encoding'])) {
|
||||
$headers['accept-encoding'] = '';
|
||||
}
|
||||
|
||||
if (($jar = $this->request->getCookieJar())
|
||||
&& ($cookies = $jar->getMatching($this->request->getUrl(), true))
|
||||
) {
|
||||
$headers['cookie'] = (empty($headers['cookie'])? '': $headers['cookie'] . '; ') . $cookies;
|
||||
}
|
||||
|
||||
// set headers having special cURL keys
|
||||
foreach (self::$headerMap as $name => $option) {
|
||||
if (isset($headers[$name])) {
|
||||
curl_setopt($ch, $option, $headers[$name]);
|
||||
unset($headers[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->calculateRequestLength($headers);
|
||||
if (isset($headers['content-length']) || isset($headers['transfer-encoding'])) {
|
||||
$this->workaroundPhpBug47204($ch, $headers);
|
||||
}
|
||||
|
||||
// set headers not having special keys
|
||||
$headersFmt = array();
|
||||
foreach ($headers as $name => $value) {
|
||||
$canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));
|
||||
$headersFmt[] = $canonicalName . ': ' . $value;
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFmt);
|
||||
|
||||
return $ch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Workaround for PHP bug #47204 that prevents rewinding request body
|
||||
*
|
||||
* The workaround consists of reading the entire request body into memory
|
||||
* and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large
|
||||
* file uploads, use Socket adapter instead.
|
||||
*
|
||||
* @param resource $ch cURL handle
|
||||
* @param array &$headers Request headers
|
||||
*/
|
||||
protected function workaroundPhpBug47204($ch, &$headers)
|
||||
{
|
||||
// no redirects, no digest auth -> probably no rewind needed
|
||||
if (!$this->request->getConfig('follow_redirects')
|
||||
&& (!($auth = $this->request->getAuth())
|
||||
|| HTTP_Request2::AUTH_DIGEST != $auth['scheme'])
|
||||
) {
|
||||
curl_setopt($ch, CURLOPT_READFUNCTION, array($this, 'callbackReadBody'));
|
||||
|
||||
} else {
|
||||
// rewind may be needed, read the whole body into memory
|
||||
if ($this->requestBody instanceof HTTP_Request2_MultipartBody) {
|
||||
$this->requestBody = $this->requestBody->__toString();
|
||||
|
||||
} elseif (is_resource($this->requestBody)) {
|
||||
$fp = $this->requestBody;
|
||||
$this->requestBody = '';
|
||||
while (!feof($fp)) {
|
||||
$this->requestBody .= fread($fp, 16384);
|
||||
}
|
||||
}
|
||||
// curl hangs up if content-length is present
|
||||
unset($headers['content-length']);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function called by cURL for reading the request body
|
||||
*
|
||||
* @param resource $ch cURL handle
|
||||
* @param resource $fd file descriptor (not used)
|
||||
* @param integer $length maximum length of data to return
|
||||
*
|
||||
* @return string part of the request body, up to $length bytes
|
||||
*/
|
||||
protected function callbackReadBody($ch, $fd, $length)
|
||||
{
|
||||
if (!$this->eventSentHeaders) {
|
||||
$this->request->setLastEvent(
|
||||
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
|
||||
);
|
||||
$this->eventSentHeaders = true;
|
||||
}
|
||||
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|
||||
|| 0 == $this->contentLength || $this->position >= $this->contentLength
|
||||
) {
|
||||
return '';
|
||||
}
|
||||
if (is_string($this->requestBody)) {
|
||||
$string = substr($this->requestBody, $this->position, $length);
|
||||
} elseif (is_resource($this->requestBody)) {
|
||||
$string = fread($this->requestBody, $length);
|
||||
} else {
|
||||
$string = $this->requestBody->read($length);
|
||||
}
|
||||
$this->request->setLastEvent('sentBodyPart', strlen($string));
|
||||
$this->position += strlen($string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function called by cURL for saving the response headers
|
||||
*
|
||||
* @param resource $ch cURL handle
|
||||
* @param string $string response header (with trailing CRLF)
|
||||
*
|
||||
* @return integer number of bytes saved
|
||||
* @see HTTP_Request2_Response::parseHeaderLine()
|
||||
*/
|
||||
protected function callbackWriteHeader($ch, $string)
|
||||
{
|
||||
// we may receive a second set of headers if doing e.g. digest auth
|
||||
if ($this->eventReceivedHeaders || !$this->eventSentHeaders) {
|
||||
// don't bother with 100-Continue responses (bug #15785)
|
||||
if (!$this->eventSentHeaders
|
||||
|| $this->response->getStatus() >= 200
|
||||
) {
|
||||
$this->request->setLastEvent(
|
||||
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
|
||||
);
|
||||
}
|
||||
$upload = curl_getinfo($ch, CURLINFO_SIZE_UPLOAD);
|
||||
// if body wasn't read by a callback, send event with total body size
|
||||
if ($upload > $this->position) {
|
||||
$this->request->setLastEvent(
|
||||
'sentBodyPart', $upload - $this->position
|
||||
);
|
||||
$this->position = $upload;
|
||||
}
|
||||
if ($upload && (!$this->eventSentHeaders
|
||||
|| $this->response->getStatus() >= 200)
|
||||
) {
|
||||
$this->request->setLastEvent('sentBody', $upload);
|
||||
}
|
||||
$this->eventSentHeaders = true;
|
||||
// we'll need a new response object
|
||||
if ($this->eventReceivedHeaders) {
|
||||
$this->eventReceivedHeaders = false;
|
||||
$this->response = null;
|
||||
}
|
||||
}
|
||||
if (empty($this->response)) {
|
||||
$this->response = new HTTP_Request2_Response(
|
||||
$string, false, curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)
|
||||
);
|
||||
} else {
|
||||
$this->response->parseHeaderLine($string);
|
||||
if ('' == trim($string)) {
|
||||
// don't bother with 100-Continue responses (bug #15785)
|
||||
if (200 <= $this->response->getStatus()) {
|
||||
$this->request->setLastEvent('receivedHeaders', $this->response);
|
||||
}
|
||||
|
||||
if ($this->request->getConfig('follow_redirects') && $this->response->isRedirect()) {
|
||||
$redirectUrl = new Net_URL2($this->response->getHeader('location'));
|
||||
|
||||
// for versions lower than 5.2.10, check the redirection URL protocol
|
||||
if (!defined('CURLOPT_REDIR_PROTOCOLS') && $redirectUrl->isAbsolute()
|
||||
&& !in_array($redirectUrl->getScheme(), array('http', 'https'))
|
||||
) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($jar = $this->request->getCookieJar()) {
|
||||
$jar->addCookiesFromResponse($this->response, $this->request->getUrl());
|
||||
if (!$redirectUrl->isAbsolute()) {
|
||||
$redirectUrl = $this->request->getUrl()->resolve($redirectUrl);
|
||||
}
|
||||
if ($cookies = $jar->getMatching($redirectUrl, true)) {
|
||||
curl_setopt($ch, CURLOPT_COOKIE, $cookies);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->eventReceivedHeaders = true;
|
||||
}
|
||||
}
|
||||
return strlen($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function called by cURL for saving the response body
|
||||
*
|
||||
* @param resource $ch cURL handle (not used)
|
||||
* @param string $string part of the response body
|
||||
*
|
||||
* @return integer number of bytes saved
|
||||
* @throws HTTP_Request2_MessageException
|
||||
* @see HTTP_Request2_Response::appendBody()
|
||||
*/
|
||||
protected function callbackWriteBody($ch, $string)
|
||||
{
|
||||
// cURL calls WRITEFUNCTION callback without calling HEADERFUNCTION if
|
||||
// response doesn't start with proper HTTP status line (see bug #15716)
|
||||
if (empty($this->response)) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
"Malformed response: {$string}",
|
||||
HTTP_Request2_Exception::MALFORMED_RESPONSE
|
||||
);
|
||||
}
|
||||
if ($this->request->getConfig('store_body')) {
|
||||
$this->response->appendBody($string);
|
||||
}
|
||||
$this->request->setLastEvent('receivedBodyPart', $string);
|
||||
return strlen($string);
|
||||
}
|
||||
}
|
||||
?>
|
||||
166
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Mock.php
Normal file
166
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Mock.php
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
<?php
|
||||
/**
|
||||
* Mock adapter intended for testing
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for HTTP_Request2 adapters
|
||||
*/
|
||||
require_once 'HTTP/Request2/Adapter.php';
|
||||
|
||||
/**
|
||||
* Mock adapter intended for testing
|
||||
*
|
||||
* Can be used to test applications depending on HTTP_Request2 package without
|
||||
* actually performing any HTTP requests. This adapter will return responses
|
||||
* previously added via addResponse()
|
||||
* <code>
|
||||
* $mock = new HTTP_Request2_Adapter_Mock();
|
||||
* $mock->addResponse("HTTP/1.1 ... ");
|
||||
*
|
||||
* $request = new HTTP_Request2();
|
||||
* $request->setAdapter($mock);
|
||||
*
|
||||
* // This will return the response set above
|
||||
* $response = $req->send();
|
||||
* </code>
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter
|
||||
{
|
||||
/**
|
||||
* A queue of responses to be returned by sendRequest()
|
||||
* @var array
|
||||
*/
|
||||
protected $responses = array();
|
||||
|
||||
/**
|
||||
* Returns the next response from the queue built by addResponse()
|
||||
*
|
||||
* Only responses without explicit URLs or with URLs equal to request URL
|
||||
* will be considered. If matching response is not found or the queue is
|
||||
* empty then default empty response with status 400 will be returned,
|
||||
* if an Exception object was added to the queue it will be thrown.
|
||||
*
|
||||
* @param HTTP_Request2 $request HTTP request message
|
||||
*
|
||||
* @return HTTP_Request2_Response
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendRequest(HTTP_Request2 $request)
|
||||
{
|
||||
$requestUrl = (string)$request->getUrl();
|
||||
$response = null;
|
||||
foreach ($this->responses as $k => $v) {
|
||||
if (!$v[1] || $requestUrl == $v[1]) {
|
||||
$response = $v[0];
|
||||
array_splice($this->responses, $k, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$response) {
|
||||
return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n");
|
||||
|
||||
} elseif ($response instanceof HTTP_Request2_Response) {
|
||||
return $response;
|
||||
|
||||
} else {
|
||||
// rethrow the exception
|
||||
$class = get_class($response);
|
||||
$message = $response->getMessage();
|
||||
$code = $response->getCode();
|
||||
throw new $class($message, $code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds response to the queue
|
||||
*
|
||||
* @param mixed $response either a string, a pointer to an open file,
|
||||
* an instance of HTTP_Request2_Response or Exception
|
||||
* @param string $url A request URL this response should be valid for
|
||||
* (see {@link http://pear.php.net/bugs/bug.php?id=19276})
|
||||
*
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
public function addResponse($response, $url = null)
|
||||
{
|
||||
if (is_string($response)) {
|
||||
$response = self::createResponseFromString($response);
|
||||
} elseif (is_resource($response)) {
|
||||
$response = self::createResponseFromFile($response);
|
||||
} elseif (!$response instanceof HTTP_Request2_Response &&
|
||||
!$response instanceof Exception
|
||||
) {
|
||||
throw new HTTP_Request2_Exception('Parameter is not a valid response');
|
||||
}
|
||||
$this->responses[] = array($response, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new HTTP_Request2_Response object from a string
|
||||
*
|
||||
* @param string $str string containing HTTP response message
|
||||
*
|
||||
* @return HTTP_Request2_Response
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
public static function createResponseFromString($str)
|
||||
{
|
||||
$parts = preg_split('!(\r?\n){2}!m', $str, 2);
|
||||
$headerLines = explode("\n", $parts[0]);
|
||||
$response = new HTTP_Request2_Response(array_shift($headerLines));
|
||||
foreach ($headerLines as $headerLine) {
|
||||
$response->parseHeaderLine($headerLine);
|
||||
}
|
||||
$response->parseHeaderLine('');
|
||||
if (isset($parts[1])) {
|
||||
$response->appendBody($parts[1]);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new HTTP_Request2_Response object from a file
|
||||
*
|
||||
* @param resource $fp file pointer returned by fopen()
|
||||
*
|
||||
* @return HTTP_Request2_Response
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
public static function createResponseFromFile($fp)
|
||||
{
|
||||
$response = new HTTP_Request2_Response(fgets($fp));
|
||||
do {
|
||||
$headerLine = fgets($fp);
|
||||
$response->parseHeaderLine($headerLine);
|
||||
} while ('' != trim($headerLine));
|
||||
|
||||
while (!feof($fp)) {
|
||||
$response->appendBody(fread($fp, 8192));
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
?>
|
||||
1121
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Socket.php
Normal file
1121
libs/PEAR.1.9.5/HTTP/Request2/Adapter/Socket.php
Normal file
File diff suppressed because it is too large
Load diff
494
libs/PEAR.1.9.5/HTTP/Request2/CookieJar.php
Normal file
494
libs/PEAR.1.9.5/HTTP/Request2/CookieJar.php
Normal file
|
|
@ -0,0 +1,494 @@
|
|||
<?php
|
||||
/**
|
||||
* Stores cookies and passes them between HTTP requests
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/** Class representing a HTTP request message */
|
||||
require_once 'HTTP/Request2.php';
|
||||
|
||||
/**
|
||||
* Stores cookies and passes them between HTTP requests
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_CookieJar implements Serializable
|
||||
{
|
||||
/**
|
||||
* Array of stored cookies
|
||||
*
|
||||
* The array is indexed by domain, path and cookie name
|
||||
* .example.com
|
||||
* /
|
||||
* some_cookie => cookie data
|
||||
* /subdir
|
||||
* other_cookie => cookie data
|
||||
* .example.org
|
||||
* ...
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $cookies = array();
|
||||
|
||||
/**
|
||||
* Whether session cookies should be serialized when serializing the jar
|
||||
* @var bool
|
||||
*/
|
||||
protected $serializeSession = false;
|
||||
|
||||
/**
|
||||
* Whether Public Suffix List should be used for domain matching
|
||||
* @var bool
|
||||
*/
|
||||
protected $useList = true;
|
||||
|
||||
/**
|
||||
* Array with Public Suffix List data
|
||||
* @var array
|
||||
* @link http://publicsuffix.org/
|
||||
*/
|
||||
protected static $psl = array();
|
||||
|
||||
/**
|
||||
* Class constructor, sets various options
|
||||
*
|
||||
* @param bool $serializeSessionCookies Controls serializing session cookies,
|
||||
* see {@link serializeSessionCookies()}
|
||||
* @param bool $usePublicSuffixList Controls using Public Suffix List,
|
||||
* see {@link usePublicSuffixList()}
|
||||
*/
|
||||
public function __construct(
|
||||
$serializeSessionCookies = false, $usePublicSuffixList = true
|
||||
) {
|
||||
$this->serializeSessionCookies($serializeSessionCookies);
|
||||
$this->usePublicSuffixList($usePublicSuffixList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current time formatted in ISO-8601 at UTC timezone
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function now()
|
||||
{
|
||||
$dt = new DateTime();
|
||||
$dt->setTimezone(new DateTimeZone('UTC'));
|
||||
return $dt->format(DateTime::ISO8601);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks cookie array for correctness, possibly updating its 'domain', 'path' and 'expires' fields
|
||||
*
|
||||
* The checks are as follows:
|
||||
* - cookie array should contain 'name' and 'value' fields;
|
||||
* - name and value should not contain disallowed symbols;
|
||||
* - 'expires' should be either empty parseable by DateTime;
|
||||
* - 'domain' and 'path' should be either not empty or an URL where
|
||||
* cookie was set should be provided.
|
||||
* - if $setter is provided, then document at that URL should be allowed
|
||||
* to set a cookie for that 'domain'. If $setter is not provided,
|
||||
* then no domain checks will be made.
|
||||
*
|
||||
* 'expires' field will be converted to ISO8601 format from COOKIE format,
|
||||
* 'domain' and 'path' will be set from setter URL if empty.
|
||||
*
|
||||
* @param array $cookie cookie data, as returned by
|
||||
* {@link HTTP_Request2_Response::getCookies()}
|
||||
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
|
||||
*
|
||||
* @return array Updated cookie array
|
||||
* @throws HTTP_Request2_LogicException
|
||||
* @throws HTTP_Request2_MessageException
|
||||
*/
|
||||
protected function checkAndUpdateFields(array $cookie, Net_URL2 $setter = null)
|
||||
{
|
||||
if ($missing = array_diff(array('name', 'value'), array_keys($cookie))) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
"Cookie array should contain 'name' and 'value' fields",
|
||||
HTTP_Request2_Exception::MISSING_VALUE
|
||||
);
|
||||
}
|
||||
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['name'])) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
"Invalid cookie name: '{$cookie['name']}'",
|
||||
HTTP_Request2_Exception::INVALID_ARGUMENT
|
||||
);
|
||||
}
|
||||
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['value'])) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
"Invalid cookie value: '{$cookie['value']}'",
|
||||
HTTP_Request2_Exception::INVALID_ARGUMENT
|
||||
);
|
||||
}
|
||||
$cookie += array('domain' => '', 'path' => '', 'expires' => null, 'secure' => false);
|
||||
|
||||
// Need ISO-8601 date @ UTC timezone
|
||||
if (!empty($cookie['expires'])
|
||||
&& !preg_match('/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+0000$/', $cookie['expires'])
|
||||
) {
|
||||
try {
|
||||
$dt = new DateTime($cookie['expires']);
|
||||
$dt->setTimezone(new DateTimeZone('UTC'));
|
||||
$cookie['expires'] = $dt->format(DateTime::ISO8601);
|
||||
} catch (Exception $e) {
|
||||
throw new HTTP_Request2_LogicException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($cookie['domain']) || empty($cookie['path'])) {
|
||||
if (!$setter) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Cookie misses domain and/or path component, cookie setter URL needed',
|
||||
HTTP_Request2_Exception::MISSING_VALUE
|
||||
);
|
||||
}
|
||||
if (empty($cookie['domain'])) {
|
||||
if ($host = $setter->getHost()) {
|
||||
$cookie['domain'] = $host;
|
||||
} else {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Setter URL does not contain host part, can\'t set cookie domain',
|
||||
HTTP_Request2_Exception::MISSING_VALUE
|
||||
);
|
||||
}
|
||||
}
|
||||
if (empty($cookie['path'])) {
|
||||
$path = $setter->getPath();
|
||||
$cookie['path'] = empty($path)? '/': substr($path, 0, strrpos($path, '/') + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($setter && !$this->domainMatch($setter->getHost(), $cookie['domain'])) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
"Domain " . $setter->getHost() . " cannot set cookies for "
|
||||
. $cookie['domain']
|
||||
);
|
||||
}
|
||||
|
||||
return $cookie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores a cookie in the jar
|
||||
*
|
||||
* @param array $cookie cookie data, as returned by
|
||||
* {@link HTTP_Request2_Response::getCookies()}
|
||||
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
|
||||
*
|
||||
* @throws HTTP_Request2_Exception
|
||||
*/
|
||||
public function store(array $cookie, Net_URL2 $setter = null)
|
||||
{
|
||||
$cookie = $this->checkAndUpdateFields($cookie, $setter);
|
||||
|
||||
if (strlen($cookie['value'])
|
||||
&& (is_null($cookie['expires']) || $cookie['expires'] > $this->now())
|
||||
) {
|
||||
if (!isset($this->cookies[$cookie['domain']])) {
|
||||
$this->cookies[$cookie['domain']] = array();
|
||||
}
|
||||
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
|
||||
$this->cookies[$cookie['domain']][$cookie['path']] = array();
|
||||
}
|
||||
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
|
||||
|
||||
} elseif (isset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']])) {
|
||||
unset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds cookies set in HTTP response to the jar
|
||||
*
|
||||
* @param HTTP_Request2_Response $response HTTP response message
|
||||
* @param Net_URL2 $setter original request URL, needed for
|
||||
* setting default domain/path
|
||||
*/
|
||||
public function addCookiesFromResponse(HTTP_Request2_Response $response, Net_URL2 $setter)
|
||||
{
|
||||
foreach ($response->getCookies() as $cookie) {
|
||||
$this->store($cookie, $setter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all cookies matching a given request URL
|
||||
*
|
||||
* The following checks are made:
|
||||
* - cookie domain should match request host
|
||||
* - cookie path should be a prefix for request path
|
||||
* - 'secure' cookies will only be sent for HTTPS requests
|
||||
*
|
||||
* @param Net_URL2 $url Request url
|
||||
* @param bool $asString Whether to return cookies as string for "Cookie: " header
|
||||
*
|
||||
* @return array|string Matching cookies
|
||||
*/
|
||||
public function getMatching(Net_URL2 $url, $asString = false)
|
||||
{
|
||||
$host = $url->getHost();
|
||||
$path = $url->getPath();
|
||||
$secure = 0 == strcasecmp($url->getScheme(), 'https');
|
||||
|
||||
$matched = $ret = array();
|
||||
foreach (array_keys($this->cookies) as $domain) {
|
||||
if ($this->domainMatch($host, $domain)) {
|
||||
foreach (array_keys($this->cookies[$domain]) as $cPath) {
|
||||
if (0 === strpos($path, $cPath)) {
|
||||
foreach ($this->cookies[$domain][$cPath] as $name => $cookie) {
|
||||
if (!$cookie['secure'] || $secure) {
|
||||
$matched[$name][strlen($cookie['path'])] = $cookie;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($matched as $cookies) {
|
||||
krsort($cookies);
|
||||
$ret = array_merge($ret, $cookies);
|
||||
}
|
||||
if (!$asString) {
|
||||
return $ret;
|
||||
} else {
|
||||
$str = '';
|
||||
foreach ($ret as $c) {
|
||||
$str .= (empty($str)? '': '; ') . $c['name'] . '=' . $c['value'];
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all cookies stored in a jar
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$cookies = array();
|
||||
foreach (array_keys($this->cookies) as $domain) {
|
||||
foreach (array_keys($this->cookies[$domain]) as $path) {
|
||||
foreach ($this->cookies[$domain][$path] as $name => $cookie) {
|
||||
$cookies[] = $cookie;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $cookies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether session cookies should be serialized when serializing the jar
|
||||
*
|
||||
* @param boolean $serialize serialize?
|
||||
*/
|
||||
public function serializeSessionCookies($serialize)
|
||||
{
|
||||
$this->serializeSession = (bool)$serialize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether Public Suffix List should be used for restricting cookie-setting
|
||||
*
|
||||
* Without PSL {@link domainMatch()} will only prevent setting cookies for
|
||||
* top-level domains like '.com' or '.org'. However, it will not prevent
|
||||
* setting a cookie for '.co.uk' even though only third-level registrations
|
||||
* are possible in .uk domain.
|
||||
*
|
||||
* With the List it is possible to find the highest level at which a domain
|
||||
* may be registered for a particular top-level domain and consequently
|
||||
* prevent cookies set for '.co.uk' or '.msk.ru'. The same list is used by
|
||||
* Firefox, Chrome and Opera browsers to restrict cookie setting.
|
||||
*
|
||||
* Note that PSL is licensed differently to HTTP_Request2 package (refer to
|
||||
* the license information in public-suffix-list.php), so you can disable
|
||||
* its use if this is an issue for you.
|
||||
*
|
||||
* @param boolean $useList use the list?
|
||||
*
|
||||
* @link http://publicsuffix.org/learn/
|
||||
*/
|
||||
public function usePublicSuffixList($useList)
|
||||
{
|
||||
$this->useList = (bool)$useList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string representation of object
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @see Serializable::serialize()
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
$cookies = $this->getAll();
|
||||
if (!$this->serializeSession) {
|
||||
for ($i = count($cookies) - 1; $i >= 0; $i--) {
|
||||
if (empty($cookies[$i]['expires'])) {
|
||||
unset($cookies[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return serialize(array(
|
||||
'cookies' => $cookies,
|
||||
'serializeSession' => $this->serializeSession,
|
||||
'useList' => $this->useList
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the object from serialized string
|
||||
*
|
||||
* @param string $serialized string representation
|
||||
*
|
||||
* @see Serializable::unserialize()
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$data = unserialize($serialized);
|
||||
$now = $this->now();
|
||||
$this->serializeSessionCookies($data['serializeSession']);
|
||||
$this->usePublicSuffixList($data['useList']);
|
||||
foreach ($data['cookies'] as $cookie) {
|
||||
if (!empty($cookie['expires']) && $cookie['expires'] <= $now) {
|
||||
continue;
|
||||
}
|
||||
if (!isset($this->cookies[$cookie['domain']])) {
|
||||
$this->cookies[$cookie['domain']] = array();
|
||||
}
|
||||
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
|
||||
$this->cookies[$cookie['domain']][$cookie['path']] = array();
|
||||
}
|
||||
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a cookie domain matches a request host.
|
||||
*
|
||||
* The method is used by {@link store()} to check for whether a document
|
||||
* at given URL can set a cookie with a given domain attribute and by
|
||||
* {@link getMatching()} to find cookies matching the request URL.
|
||||
*
|
||||
* @param string $requestHost request host
|
||||
* @param string $cookieDomain cookie domain
|
||||
*
|
||||
* @return bool match success
|
||||
*/
|
||||
public function domainMatch($requestHost, $cookieDomain)
|
||||
{
|
||||
if ($requestHost == $cookieDomain) {
|
||||
return true;
|
||||
}
|
||||
// IP address, we require exact match
|
||||
if (preg_match('/^(?:\d{1,3}\.){3}\d{1,3}$/', $requestHost)) {
|
||||
return false;
|
||||
}
|
||||
if ('.' != $cookieDomain[0]) {
|
||||
$cookieDomain = '.' . $cookieDomain;
|
||||
}
|
||||
// prevents setting cookies for '.com' and similar domains
|
||||
if (!$this->useList && substr_count($cookieDomain, '.') < 2
|
||||
|| $this->useList && !self::getRegisteredDomain($cookieDomain)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return substr('.' . $requestHost, -strlen($cookieDomain)) == $cookieDomain;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes subdomains to get the registered domain (the first after top-level)
|
||||
*
|
||||
* The method will check Public Suffix List to find out where top-level
|
||||
* domain ends and registered domain starts. It will remove domain parts
|
||||
* to the left of registered one.
|
||||
*
|
||||
* @param string $domain domain name
|
||||
*
|
||||
* @return string|bool registered domain, will return false if $domain is
|
||||
* either invalid or a TLD itself
|
||||
*/
|
||||
public static function getRegisteredDomain($domain)
|
||||
{
|
||||
$domainParts = explode('.', ltrim($domain, '.'));
|
||||
|
||||
// load the list if needed
|
||||
if (empty(self::$psl)) {
|
||||
$path = '@data_dir@' . DIRECTORY_SEPARATOR . 'HTTP_Request2';
|
||||
if (0 === strpos($path, '@' . 'data_dir@')) {
|
||||
$path = realpath(
|
||||
dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
|
||||
. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data'
|
||||
);
|
||||
}
|
||||
self::$psl = include_once $path . DIRECTORY_SEPARATOR . 'public-suffix-list.php';
|
||||
}
|
||||
|
||||
if (!($result = self::checkDomainsList($domainParts, self::$psl))) {
|
||||
// known TLD, invalid domain name
|
||||
return false;
|
||||
}
|
||||
|
||||
// unknown TLD
|
||||
if (!strpos($result, '.')) {
|
||||
// fallback to checking that domain "has at least two dots"
|
||||
if (2 > ($count = count($domainParts))) {
|
||||
return false;
|
||||
}
|
||||
return $domainParts[$count - 2] . '.' . $domainParts[$count - 1];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive helper method for {@link getRegisteredDomain()}
|
||||
*
|
||||
* @param array $domainParts remaining domain parts
|
||||
* @param mixed $listNode node in {@link HTTP_Request2_CookieJar::$psl} to check
|
||||
*
|
||||
* @return string|null concatenated domain parts, null in case of error
|
||||
*/
|
||||
protected static function checkDomainsList(array $domainParts, $listNode)
|
||||
{
|
||||
$sub = array_pop($domainParts);
|
||||
$result = null;
|
||||
|
||||
if (!is_array($listNode) || is_null($sub)
|
||||
|| array_key_exists('!' . $sub, $listNode)
|
||||
) {
|
||||
return $sub;
|
||||
|
||||
} elseif (array_key_exists($sub, $listNode)) {
|
||||
$result = self::checkDomainsList($domainParts, $listNode[$sub]);
|
||||
|
||||
} elseif (array_key_exists('*', $listNode)) {
|
||||
$result = self::checkDomainsList($domainParts, $listNode['*']);
|
||||
|
||||
} else {
|
||||
return $sub;
|
||||
}
|
||||
|
||||
return (strlen($result) > 0) ? ($result . '.' . $sub) : null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
160
libs/PEAR.1.9.5/HTTP/Request2/Exception.php
Normal file
160
libs/PEAR.1.9.5/HTTP/Request2/Exception.php
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
/**
|
||||
* Exception classes for HTTP_Request2 package
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for exceptions in PEAR
|
||||
*/
|
||||
require_once 'PEAR/Exception.php';
|
||||
|
||||
/**
|
||||
* Base exception class for HTTP_Request2 package
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=132
|
||||
*/
|
||||
class HTTP_Request2_Exception extends PEAR_Exception
|
||||
{
|
||||
/** An invalid argument was passed to a method */
|
||||
const INVALID_ARGUMENT = 1;
|
||||
/** Some required value was not available */
|
||||
const MISSING_VALUE = 2;
|
||||
/** Request cannot be processed due to errors in PHP configuration */
|
||||
const MISCONFIGURATION = 3;
|
||||
/** Error reading the local file */
|
||||
const READ_ERROR = 4;
|
||||
|
||||
/** Server returned a response that does not conform to HTTP protocol */
|
||||
const MALFORMED_RESPONSE = 10;
|
||||
/** Failure decoding Content-Encoding or Transfer-Encoding of response */
|
||||
const DECODE_ERROR = 20;
|
||||
/** Operation timed out */
|
||||
const TIMEOUT = 30;
|
||||
/** Number of redirects exceeded 'max_redirects' configuration parameter */
|
||||
const TOO_MANY_REDIRECTS = 40;
|
||||
/** Redirect to a protocol other than http(s):// */
|
||||
const NON_HTTP_REDIRECT = 50;
|
||||
|
||||
/**
|
||||
* Native error code
|
||||
* @var int
|
||||
*/
|
||||
private $_nativeCode;
|
||||
|
||||
/**
|
||||
* Constructor, can set package error code and native error code
|
||||
*
|
||||
* @param string $message exception message
|
||||
* @param int $code package error code, one of class constants
|
||||
* @param int $nativeCode error code from underlying PHP extension
|
||||
*/
|
||||
public function __construct($message = null, $code = null, $nativeCode = null)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
$this->_nativeCode = $nativeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns error code produced by underlying PHP extension
|
||||
*
|
||||
* For Socket Adapter this may contain error number returned by
|
||||
* stream_socket_client(), for Curl Adapter this will contain error number
|
||||
* returned by curl_errno()
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getNativeCode()
|
||||
{
|
||||
return $this->_nativeCode;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception thrown in case of missing features
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception that represents error in the program logic
|
||||
*
|
||||
* This exception usually implies a programmer's error, like passing invalid
|
||||
* data to methods or trying to use PHP extensions that weren't installed or
|
||||
* enabled. Usually exceptions of this kind will be thrown before request even
|
||||
* starts.
|
||||
*
|
||||
* The exception will usually contain a package error code.
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_LogicException extends HTTP_Request2_Exception
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception thrown when connection to a web or proxy server fails
|
||||
*
|
||||
* The exception will not contain a package error code, but will contain
|
||||
* native error code, as returned by stream_socket_client() or curl_errno().
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception thrown when sending or receiving HTTP message fails
|
||||
*
|
||||
* The exception may contain both package error code and native error code.
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_MessageException extends HTTP_Request2_Exception
|
||||
{
|
||||
}
|
||||
?>
|
||||
268
libs/PEAR.1.9.5/HTTP/Request2/MultipartBody.php
Normal file
268
libs/PEAR.1.9.5/HTTP/Request2/MultipartBody.php
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
<?php
|
||||
/**
|
||||
* Helper class for building multipart/form-data request body
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/** Exception class for HTTP_Request2 package */
|
||||
require_once 'HTTP/Request2/Exception.php';
|
||||
|
||||
/**
|
||||
* Class for building multipart/form-data request body
|
||||
*
|
||||
* The class helps to reduce memory consumption by streaming large file uploads
|
||||
* from disk, it also allows monitoring of upload progress (see request #7630)
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
* @link http://tools.ietf.org/html/rfc1867
|
||||
*/
|
||||
class HTTP_Request2_MultipartBody
|
||||
{
|
||||
/**
|
||||
* MIME boundary
|
||||
* @var string
|
||||
*/
|
||||
private $_boundary;
|
||||
|
||||
/**
|
||||
* Form parameters added via {@link HTTP_Request2::addPostParameter()}
|
||||
* @var array
|
||||
*/
|
||||
private $_params = array();
|
||||
|
||||
/**
|
||||
* File uploads added via {@link HTTP_Request2::addUpload()}
|
||||
* @var array
|
||||
*/
|
||||
private $_uploads = array();
|
||||
|
||||
/**
|
||||
* Header for parts with parameters
|
||||
* @var string
|
||||
*/
|
||||
private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n";
|
||||
|
||||
/**
|
||||
* Header for parts with uploads
|
||||
* @var string
|
||||
*/
|
||||
private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n";
|
||||
|
||||
/**
|
||||
* Current position in parameter and upload arrays
|
||||
*
|
||||
* First number is index of "current" part, second number is position within
|
||||
* "current" part
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_pos = array(0, 0);
|
||||
|
||||
|
||||
/**
|
||||
* Constructor. Sets the arrays with POST data.
|
||||
*
|
||||
* @param array $params values of form fields set via
|
||||
* {@link HTTP_Request2::addPostParameter()}
|
||||
* @param array $uploads file uploads set via
|
||||
* {@link HTTP_Request2::addUpload()}
|
||||
* @param bool $useBrackets whether to append brackets to array variable names
|
||||
*/
|
||||
public function __construct(array $params, array $uploads, $useBrackets = true)
|
||||
{
|
||||
$this->_params = self::_flattenArray('', $params, $useBrackets);
|
||||
foreach ($uploads as $fieldName => $f) {
|
||||
if (!is_array($f['fp'])) {
|
||||
$this->_uploads[] = $f + array('name' => $fieldName);
|
||||
} else {
|
||||
for ($i = 0; $i < count($f['fp']); $i++) {
|
||||
$upload = array(
|
||||
'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName)
|
||||
);
|
||||
foreach (array('fp', 'filename', 'size', 'type') as $key) {
|
||||
$upload[$key] = $f[$key][$i];
|
||||
}
|
||||
$this->_uploads[] = $upload;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the length of the body to use in Content-Length header
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getLength()
|
||||
{
|
||||
$boundaryLength = strlen($this->getBoundary());
|
||||
$headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength;
|
||||
$headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength;
|
||||
$length = $boundaryLength + 6;
|
||||
foreach ($this->_params as $p) {
|
||||
$length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2;
|
||||
}
|
||||
foreach ($this->_uploads as $u) {
|
||||
$length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) +
|
||||
strlen($u['filename']) + $u['size'] + 2;
|
||||
}
|
||||
return $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the boundary to use in Content-Type header
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBoundary()
|
||||
{
|
||||
if (empty($this->_boundary)) {
|
||||
$this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime());
|
||||
}
|
||||
return $this->_boundary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns next chunk of request body
|
||||
*
|
||||
* @param integer $length Number of bytes to read
|
||||
*
|
||||
* @return string Up to $length bytes of data, empty string if at end
|
||||
* @throws HTTP_Request2_LogicException
|
||||
*/
|
||||
public function read($length)
|
||||
{
|
||||
$ret = '';
|
||||
$boundary = $this->getBoundary();
|
||||
$paramCount = count($this->_params);
|
||||
$uploadCount = count($this->_uploads);
|
||||
while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) {
|
||||
$oldLength = $length;
|
||||
if ($this->_pos[0] < $paramCount) {
|
||||
$param = sprintf(
|
||||
$this->_headerParam, $boundary, $this->_params[$this->_pos[0]][0]
|
||||
) . $this->_params[$this->_pos[0]][1] . "\r\n";
|
||||
$ret .= substr($param, $this->_pos[1], $length);
|
||||
$length -= min(strlen($param) - $this->_pos[1], $length);
|
||||
|
||||
} elseif ($this->_pos[0] < $paramCount + $uploadCount) {
|
||||
$pos = $this->_pos[0] - $paramCount;
|
||||
$header = sprintf(
|
||||
$this->_headerUpload, $boundary, $this->_uploads[$pos]['name'],
|
||||
$this->_uploads[$pos]['filename'], $this->_uploads[$pos]['type']
|
||||
);
|
||||
if ($this->_pos[1] < strlen($header)) {
|
||||
$ret .= substr($header, $this->_pos[1], $length);
|
||||
$length -= min(strlen($header) - $this->_pos[1], $length);
|
||||
}
|
||||
$filePos = max(0, $this->_pos[1] - strlen($header));
|
||||
if ($filePos < $this->_uploads[$pos]['size']) {
|
||||
while ($length > 0 && !feof($this->_uploads[$pos]['fp'])) {
|
||||
if (false === ($chunk = fread($this->_uploads[$pos]['fp'], $length))) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Failed reading file upload', HTTP_Request2_Exception::READ_ERROR
|
||||
);
|
||||
}
|
||||
$ret .= $chunk;
|
||||
$length -= strlen($chunk);
|
||||
}
|
||||
}
|
||||
if ($length > 0) {
|
||||
$start = $this->_pos[1] + ($oldLength - $length) -
|
||||
strlen($header) - $this->_uploads[$pos]['size'];
|
||||
$ret .= substr("\r\n", $start, $length);
|
||||
$length -= min(2 - $start, $length);
|
||||
}
|
||||
|
||||
} else {
|
||||
$closing = '--' . $boundary . "--\r\n";
|
||||
$ret .= substr($closing, $this->_pos[1], $length);
|
||||
$length -= min(strlen($closing) - $this->_pos[1], $length);
|
||||
}
|
||||
if ($length > 0) {
|
||||
$this->_pos = array($this->_pos[0] + 1, 0);
|
||||
} else {
|
||||
$this->_pos[1] += $oldLength;
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current position to the start of the body
|
||||
*
|
||||
* This allows reusing the same body in another request
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->_pos = array(0, 0);
|
||||
foreach ($this->_uploads as $u) {
|
||||
rewind($u['fp']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the body as string
|
||||
*
|
||||
* Note that it reads all file uploads into memory so it is a good idea not
|
||||
* to use this method with large file uploads and rely on read() instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$this->rewind();
|
||||
return $this->read($this->getLength());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper function to change the (probably multidimensional) associative array
|
||||
* into the simple one.
|
||||
*
|
||||
* @param string $name name for item
|
||||
* @param mixed $values item's values
|
||||
* @param bool $useBrackets whether to append [] to array variables' names
|
||||
*
|
||||
* @return array array with the following items: array('item name', 'item value');
|
||||
*/
|
||||
private static function _flattenArray($name, $values, $useBrackets)
|
||||
{
|
||||
if (!is_array($values)) {
|
||||
return array(array($name, $values));
|
||||
} else {
|
||||
$ret = array();
|
||||
foreach ($values as $k => $v) {
|
||||
if (empty($name)) {
|
||||
$newName = $k;
|
||||
} elseif ($useBrackets) {
|
||||
$newName = $name . '[' . $k . ']';
|
||||
} else {
|
||||
$newName = $name;
|
||||
}
|
||||
$ret = array_merge($ret, self::_flattenArray($newName, $v, $useBrackets));
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
192
libs/PEAR.1.9.5/HTTP/Request2/Observer/Log.php
Normal file
192
libs/PEAR.1.9.5/HTTP/Request2/Observer/Log.php
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<?php
|
||||
/**
|
||||
* An observer useful for debugging / testing.
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author David Jean Louis <izi@php.net>
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Exception class for HTTP_Request2 package
|
||||
*/
|
||||
require_once 'HTTP/Request2/Exception.php';
|
||||
|
||||
/**
|
||||
* A debug observer useful for debugging / testing.
|
||||
*
|
||||
* This observer logs to a log target data corresponding to the various request
|
||||
* and response events, it logs by default to php://output but can be configured
|
||||
* to log to a file or via the PEAR Log package.
|
||||
*
|
||||
* A simple example:
|
||||
* <code>
|
||||
* require_once 'HTTP/Request2.php';
|
||||
* require_once 'HTTP/Request2/Observer/Log.php';
|
||||
*
|
||||
* $request = new HTTP_Request2('http://www.example.com');
|
||||
* $observer = new HTTP_Request2_Observer_Log();
|
||||
* $request->attach($observer);
|
||||
* $request->send();
|
||||
* </code>
|
||||
*
|
||||
* A more complex example with PEAR Log:
|
||||
* <code>
|
||||
* require_once 'HTTP/Request2.php';
|
||||
* require_once 'HTTP/Request2/Observer/Log.php';
|
||||
* require_once 'Log.php';
|
||||
*
|
||||
* $request = new HTTP_Request2('http://www.example.com');
|
||||
* // we want to log with PEAR log
|
||||
* $observer = new HTTP_Request2_Observer_Log(Log::factory('console'));
|
||||
*
|
||||
* // we only want to log received headers
|
||||
* $observer->events = array('receivedHeaders');
|
||||
*
|
||||
* $request->attach($observer);
|
||||
* $request->send();
|
||||
* </code>
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author David Jean Louis <izi@php.net>
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
class HTTP_Request2_Observer_Log implements SplObserver
|
||||
{
|
||||
// properties {{{
|
||||
|
||||
/**
|
||||
* The log target, it can be a a resource or a PEAR Log instance.
|
||||
*
|
||||
* @var resource|Log $target
|
||||
*/
|
||||
protected $target = null;
|
||||
|
||||
/**
|
||||
* The events to log.
|
||||
*
|
||||
* @var array $events
|
||||
*/
|
||||
public $events = array(
|
||||
'connect',
|
||||
'sentHeaders',
|
||||
'sentBody',
|
||||
'receivedHeaders',
|
||||
'receivedBody',
|
||||
'disconnect',
|
||||
);
|
||||
|
||||
// }}}
|
||||
// __construct() {{{
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed $target Can be a file path (default: php://output), a resource,
|
||||
* or an instance of the PEAR Log class.
|
||||
* @param array $events Array of events to listen to (default: all events)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($target = 'php://output', array $events = array())
|
||||
{
|
||||
if (!empty($events)) {
|
||||
$this->events = $events;
|
||||
}
|
||||
if (is_resource($target) || $target instanceof Log) {
|
||||
$this->target = $target;
|
||||
} elseif (false === ($this->target = @fopen($target, 'ab'))) {
|
||||
throw new HTTP_Request2_Exception("Unable to open '{$target}'");
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// update() {{{
|
||||
|
||||
/**
|
||||
* Called when the request notifies us of an event.
|
||||
*
|
||||
* @param HTTP_Request2 $subject The HTTP_Request2 instance
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update(SplSubject $subject)
|
||||
{
|
||||
$event = $subject->getLastEvent();
|
||||
if (!in_array($event['name'], $this->events)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($event['name']) {
|
||||
case 'connect':
|
||||
$this->log('* Connected to ' . $event['data']);
|
||||
break;
|
||||
case 'sentHeaders':
|
||||
$headers = explode("\r\n", $event['data']);
|
||||
array_pop($headers);
|
||||
foreach ($headers as $header) {
|
||||
$this->log('> ' . $header);
|
||||
}
|
||||
break;
|
||||
case 'sentBody':
|
||||
$this->log('> ' . $event['data'] . ' byte(s) sent');
|
||||
break;
|
||||
case 'receivedHeaders':
|
||||
$this->log(sprintf(
|
||||
'< HTTP/%s %s %s', $event['data']->getVersion(),
|
||||
$event['data']->getStatus(), $event['data']->getReasonPhrase()
|
||||
));
|
||||
$headers = $event['data']->getHeader();
|
||||
foreach ($headers as $key => $val) {
|
||||
$this->log('< ' . $key . ': ' . $val);
|
||||
}
|
||||
$this->log('< ');
|
||||
break;
|
||||
case 'receivedBody':
|
||||
$this->log($event['data']->getBody());
|
||||
break;
|
||||
case 'disconnect':
|
||||
$this->log('* Disconnected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// log() {{{
|
||||
|
||||
/**
|
||||
* Logs the given message to the configured target.
|
||||
*
|
||||
* @param string $message Message to display
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function log($message)
|
||||
{
|
||||
if ($this->target instanceof Log) {
|
||||
$this->target->debug($message);
|
||||
} elseif (is_resource($this->target)) {
|
||||
fwrite($this->target, $message . "\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
?>
|
||||
631
libs/PEAR.1.9.5/HTTP/Request2/Response.php
Normal file
631
libs/PEAR.1.9.5/HTTP/Request2/Response.php
Normal file
|
|
@ -0,0 +1,631 @@
|
|||
<?php
|
||||
/**
|
||||
* Class representing a HTTP response
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Exception class for HTTP_Request2 package
|
||||
*/
|
||||
require_once 'HTTP/Request2/Exception.php';
|
||||
|
||||
/**
|
||||
* Class representing a HTTP response
|
||||
*
|
||||
* The class is designed to be used in "streaming" scenario, building the
|
||||
* response as it is being received:
|
||||
* <code>
|
||||
* $statusLine = read_status_line();
|
||||
* $response = new HTTP_Request2_Response($statusLine);
|
||||
* do {
|
||||
* $headerLine = read_header_line();
|
||||
* $response->parseHeaderLine($headerLine);
|
||||
* } while ($headerLine != '');
|
||||
*
|
||||
* while ($chunk = read_body()) {
|
||||
* $response->appendBody($chunk);
|
||||
* }
|
||||
*
|
||||
* var_dump($response->getHeader(), $response->getCookies(), $response->getBody());
|
||||
* </code>
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
* @link http://tools.ietf.org/html/rfc2616#section-6
|
||||
*/
|
||||
class HTTP_Request2_Response
|
||||
{
|
||||
/**
|
||||
* HTTP protocol version (e.g. 1.0, 1.1)
|
||||
* @var string
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* Status code
|
||||
* @var integer
|
||||
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
|
||||
*/
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* Reason phrase
|
||||
* @var string
|
||||
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
|
||||
*/
|
||||
protected $reasonPhrase;
|
||||
|
||||
/**
|
||||
* Effective URL (may be different from original request URL in case of redirects)
|
||||
* @var string
|
||||
*/
|
||||
protected $effectiveUrl;
|
||||
|
||||
/**
|
||||
* Associative array of response headers
|
||||
* @var array
|
||||
*/
|
||||
protected $headers = array();
|
||||
|
||||
/**
|
||||
* Cookies set in the response
|
||||
* @var array
|
||||
*/
|
||||
protected $cookies = array();
|
||||
|
||||
/**
|
||||
* Name of last header processed by parseHederLine()
|
||||
*
|
||||
* Used to handle the headers that span multiple lines
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $lastHeader = null;
|
||||
|
||||
/**
|
||||
* Response body
|
||||
* @var string
|
||||
*/
|
||||
protected $body = '';
|
||||
|
||||
/**
|
||||
* Whether the body is still encoded by Content-Encoding
|
||||
*
|
||||
* cURL provides the decoded body to the callback; if we are reading from
|
||||
* socket the body is still gzipped / deflated
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $bodyEncoded;
|
||||
|
||||
/**
|
||||
* Associative array of HTTP status code / reason phrase.
|
||||
*
|
||||
* @var array
|
||||
* @link http://tools.ietf.org/html/rfc2616#section-10
|
||||
*/
|
||||
protected static $phrases = array(
|
||||
|
||||
// 1xx: Informational - Request received, continuing process
|
||||
100 => 'Continue',
|
||||
101 => 'Switching Protocols',
|
||||
|
||||
// 2xx: Success - The action was successfully received, understood and
|
||||
// accepted
|
||||
200 => 'OK',
|
||||
201 => 'Created',
|
||||
202 => 'Accepted',
|
||||
203 => 'Non-Authoritative Information',
|
||||
204 => 'No Content',
|
||||
205 => 'Reset Content',
|
||||
206 => 'Partial Content',
|
||||
|
||||
// 3xx: Redirection - Further action must be taken in order to complete
|
||||
// the request
|
||||
300 => 'Multiple Choices',
|
||||
301 => 'Moved Permanently',
|
||||
302 => 'Found', // 1.1
|
||||
303 => 'See Other',
|
||||
304 => 'Not Modified',
|
||||
305 => 'Use Proxy',
|
||||
307 => 'Temporary Redirect',
|
||||
|
||||
// 4xx: Client Error - The request contains bad syntax or cannot be
|
||||
// fulfilled
|
||||
400 => 'Bad Request',
|
||||
401 => 'Unauthorized',
|
||||
402 => 'Payment Required',
|
||||
403 => 'Forbidden',
|
||||
404 => 'Not Found',
|
||||
405 => 'Method Not Allowed',
|
||||
406 => 'Not Acceptable',
|
||||
407 => 'Proxy Authentication Required',
|
||||
408 => 'Request Timeout',
|
||||
409 => 'Conflict',
|
||||
410 => 'Gone',
|
||||
411 => 'Length Required',
|
||||
412 => 'Precondition Failed',
|
||||
413 => 'Request Entity Too Large',
|
||||
414 => 'Request-URI Too Long',
|
||||
415 => 'Unsupported Media Type',
|
||||
416 => 'Requested Range Not Satisfiable',
|
||||
417 => 'Expectation Failed',
|
||||
|
||||
// 5xx: Server Error - The server failed to fulfill an apparently
|
||||
// valid request
|
||||
500 => 'Internal Server Error',
|
||||
501 => 'Not Implemented',
|
||||
502 => 'Bad Gateway',
|
||||
503 => 'Service Unavailable',
|
||||
504 => 'Gateway Timeout',
|
||||
505 => 'HTTP Version Not Supported',
|
||||
509 => 'Bandwidth Limit Exceeded',
|
||||
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns the default reason phrase for the given code or all reason phrases
|
||||
*
|
||||
* @param int $code Response code
|
||||
*
|
||||
* @return string|array|null Default reason phrase for $code if $code is given
|
||||
* (null if no phrase is available), array of all
|
||||
* reason phrases if $code is null
|
||||
* @link http://pear.php.net/bugs/18716
|
||||
*/
|
||||
public static function getDefaultReasonPhrase($code = null)
|
||||
{
|
||||
if (null === $code) {
|
||||
return self::$phrases;
|
||||
} else {
|
||||
return isset(self::$phrases[$code]) ? self::$phrases[$code] : null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor, parses the response status line
|
||||
*
|
||||
* @param string $statusLine Response status line (e.g. "HTTP/1.1 200 OK")
|
||||
* @param bool $bodyEncoded Whether body is still encoded by Content-Encoding
|
||||
* @param string $effectiveUrl Effective URL of the response
|
||||
*
|
||||
* @throws HTTP_Request2_MessageException if status line is invalid according to spec
|
||||
*/
|
||||
public function __construct($statusLine, $bodyEncoded = true, $effectiveUrl = null)
|
||||
{
|
||||
if (!preg_match('!^HTTP/(\d\.\d) (\d{3})(?: (.+))?!', $statusLine, $m)) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
"Malformed response: {$statusLine}",
|
||||
HTTP_Request2_Exception::MALFORMED_RESPONSE
|
||||
);
|
||||
}
|
||||
$this->version = $m[1];
|
||||
$this->code = intval($m[2]);
|
||||
$this->reasonPhrase = !empty($m[3]) ? trim($m[3]) : self::getDefaultReasonPhrase($this->code);
|
||||
$this->bodyEncoded = (bool)$bodyEncoded;
|
||||
$this->effectiveUrl = (string)$effectiveUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the line from HTTP response filling $headers array
|
||||
*
|
||||
* The method should be called after reading the line from socket or receiving
|
||||
* it into cURL callback. Passing an empty string here indicates the end of
|
||||
* response headers and triggers additional processing, so be sure to pass an
|
||||
* empty string in the end.
|
||||
*
|
||||
* @param string $headerLine Line from HTTP response
|
||||
*/
|
||||
public function parseHeaderLine($headerLine)
|
||||
{
|
||||
$headerLine = trim($headerLine, "\r\n");
|
||||
|
||||
if ('' == $headerLine) {
|
||||
// empty string signals the end of headers, process the received ones
|
||||
if (!empty($this->headers['set-cookie'])) {
|
||||
$cookies = is_array($this->headers['set-cookie'])?
|
||||
$this->headers['set-cookie']:
|
||||
array($this->headers['set-cookie']);
|
||||
foreach ($cookies as $cookieString) {
|
||||
$this->parseCookie($cookieString);
|
||||
}
|
||||
unset($this->headers['set-cookie']);
|
||||
}
|
||||
foreach (array_keys($this->headers) as $k) {
|
||||
if (is_array($this->headers[$k])) {
|
||||
$this->headers[$k] = implode(', ', $this->headers[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (preg_match('!^([^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+):(.+)$!', $headerLine, $m)) {
|
||||
// string of the form header-name: header value
|
||||
$name = strtolower($m[1]);
|
||||
$value = trim($m[2]);
|
||||
if (empty($this->headers[$name])) {
|
||||
$this->headers[$name] = $value;
|
||||
} else {
|
||||
if (!is_array($this->headers[$name])) {
|
||||
$this->headers[$name] = array($this->headers[$name]);
|
||||
}
|
||||
$this->headers[$name][] = $value;
|
||||
}
|
||||
$this->lastHeader = $name;
|
||||
|
||||
} elseif (preg_match('!^\s+(.+)$!', $headerLine, $m) && $this->lastHeader) {
|
||||
// continuation of a previous header
|
||||
if (!is_array($this->headers[$this->lastHeader])) {
|
||||
$this->headers[$this->lastHeader] .= ' ' . trim($m[1]);
|
||||
} else {
|
||||
$key = count($this->headers[$this->lastHeader]) - 1;
|
||||
$this->headers[$this->lastHeader][$key] .= ' ' . trim($m[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a Set-Cookie header to fill $cookies array
|
||||
*
|
||||
* @param string $cookieString value of Set-Cookie header
|
||||
*
|
||||
* @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
|
||||
*/
|
||||
protected function parseCookie($cookieString)
|
||||
{
|
||||
$cookie = array(
|
||||
'expires' => null,
|
||||
'domain' => null,
|
||||
'path' => null,
|
||||
'secure' => false
|
||||
);
|
||||
|
||||
if (!strpos($cookieString, ';')) {
|
||||
// Only a name=value pair
|
||||
$pos = strpos($cookieString, '=');
|
||||
$cookie['name'] = trim(substr($cookieString, 0, $pos));
|
||||
$cookie['value'] = trim(substr($cookieString, $pos + 1));
|
||||
|
||||
} else {
|
||||
// Some optional parameters are supplied
|
||||
$elements = explode(';', $cookieString);
|
||||
$pos = strpos($elements[0], '=');
|
||||
$cookie['name'] = trim(substr($elements[0], 0, $pos));
|
||||
$cookie['value'] = trim(substr($elements[0], $pos + 1));
|
||||
|
||||
for ($i = 1; $i < count($elements); $i++) {
|
||||
if (false === strpos($elements[$i], '=')) {
|
||||
$elName = trim($elements[$i]);
|
||||
$elValue = null;
|
||||
} else {
|
||||
list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
|
||||
}
|
||||
$elName = strtolower($elName);
|
||||
if ('secure' == $elName) {
|
||||
$cookie['secure'] = true;
|
||||
} elseif ('expires' == $elName) {
|
||||
$cookie['expires'] = str_replace('"', '', $elValue);
|
||||
} elseif ('path' == $elName || 'domain' == $elName) {
|
||||
$cookie[$elName] = urldecode($elValue);
|
||||
} else {
|
||||
$cookie[$elName] = $elValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->cookies[] = $cookie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string to the response body
|
||||
*
|
||||
* @param string $bodyChunk part of response body
|
||||
*/
|
||||
public function appendBody($bodyChunk)
|
||||
{
|
||||
$this->body .= $bodyChunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the effective URL of the response
|
||||
*
|
||||
* This may be different from the request URL if redirects were followed.
|
||||
*
|
||||
* @return string
|
||||
* @link http://pear.php.net/bugs/bug.php?id=18412
|
||||
*/
|
||||
public function getEffectiveUrl()
|
||||
{
|
||||
return $this->effectiveUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status code
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the reason phrase
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonPhrase()
|
||||
{
|
||||
return $this->reasonPhrase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether response is a redirect that can be automatically handled by HTTP_Request2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRedirect()
|
||||
{
|
||||
return in_array($this->code, array(300, 301, 302, 303, 307))
|
||||
&& isset($this->headers['location']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns either the named header or all response headers
|
||||
*
|
||||
* @param string $headerName Name of header to return
|
||||
*
|
||||
* @return string|array Value of $headerName header (null if header is
|
||||
* not present), array of all response headers if
|
||||
* $headerName is null
|
||||
*/
|
||||
public function getHeader($headerName = null)
|
||||
{
|
||||
if (null === $headerName) {
|
||||
return $this->headers;
|
||||
} else {
|
||||
$headerName = strtolower($headerName);
|
||||
return isset($this->headers[$headerName])? $this->headers[$headerName]: null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns cookies set in response
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCookies()
|
||||
{
|
||||
return $this->cookies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the body of the response
|
||||
*
|
||||
* @return string
|
||||
* @throws HTTP_Request2_Exception if body cannot be decoded
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
if (0 == strlen($this->body) || !$this->bodyEncoded
|
||||
|| !in_array(strtolower($this->getHeader('content-encoding')), array('gzip', 'deflate'))
|
||||
) {
|
||||
return $this->body;
|
||||
|
||||
} else {
|
||||
if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
|
||||
$oldEncoding = mb_internal_encoding();
|
||||
mb_internal_encoding('8bit');
|
||||
}
|
||||
|
||||
try {
|
||||
switch (strtolower($this->getHeader('content-encoding'))) {
|
||||
case 'gzip':
|
||||
$decoded = self::decodeGzip($this->body);
|
||||
break;
|
||||
case 'deflate':
|
||||
$decoded = self::decodeDeflate($this->body);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
if (!empty($oldEncoding)) {
|
||||
mb_internal_encoding($oldEncoding);
|
||||
}
|
||||
if (!empty($e)) {
|
||||
throw $e;
|
||||
}
|
||||
return $decoded;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTTP version of the response
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the message-body encoded by gzip
|
||||
*
|
||||
* The real decoding work is done by gzinflate() built-in function, this
|
||||
* method only parses the header and checks data for compliance with
|
||||
* RFC 1952
|
||||
*
|
||||
* @param string $data gzip-encoded data
|
||||
*
|
||||
* @return string decoded data
|
||||
* @throws HTTP_Request2_LogicException
|
||||
* @throws HTTP_Request2_MessageException
|
||||
* @link http://tools.ietf.org/html/rfc1952
|
||||
*/
|
||||
public static function decodeGzip($data)
|
||||
{
|
||||
$length = strlen($data);
|
||||
// If it doesn't look like gzip-encoded data, don't bother
|
||||
if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) {
|
||||
return $data;
|
||||
}
|
||||
if (!function_exists('gzinflate')) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Unable to decode body: gzip extension not available',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION
|
||||
);
|
||||
}
|
||||
$method = ord(substr($data, 2, 1));
|
||||
if (8 != $method) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: unknown compression method',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$flags = ord(substr($data, 3, 1));
|
||||
if ($flags & 224) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: reserved bits are set',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
// header is 10 bytes minimum. may be longer, though.
|
||||
$headerLength = 10;
|
||||
// extra fields, need to skip 'em
|
||||
if ($flags & 4) {
|
||||
if ($length - $headerLength - 2 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$extraLength = unpack('v', substr($data, 10, 2));
|
||||
if ($length - $headerLength - 2 - $extraLength[1] < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$headerLength += $extraLength[1] + 2;
|
||||
}
|
||||
// file name, need to skip that
|
||||
if ($flags & 8) {
|
||||
if ($length - $headerLength - 1 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$filenameLength = strpos(substr($data, $headerLength), chr(0));
|
||||
if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$headerLength += $filenameLength + 1;
|
||||
}
|
||||
// comment, need to skip that also
|
||||
if ($flags & 16) {
|
||||
if ($length - $headerLength - 1 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$commentLength = strpos(substr($data, $headerLength), chr(0));
|
||||
if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$headerLength += $commentLength + 1;
|
||||
}
|
||||
// have a CRC for header. let's check
|
||||
if ($flags & 2) {
|
||||
if ($length - $headerLength - 2 < 8) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Error parsing gzip header: data too short',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$crcReal = 0xffff & crc32(substr($data, 0, $headerLength));
|
||||
$crcStored = unpack('v', substr($data, $headerLength, 2));
|
||||
if ($crcReal != $crcStored[1]) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Header CRC check failed',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
$headerLength += 2;
|
||||
}
|
||||
// unpacked data CRC and size at the end of encoded data
|
||||
$tmp = unpack('V2', substr($data, -8));
|
||||
$dataCrc = $tmp[1];
|
||||
$dataSize = $tmp[2];
|
||||
|
||||
// finally, call the gzinflate() function
|
||||
// don't pass $dataSize to gzinflate, see bugs #13135, #14370
|
||||
$unpacked = gzinflate(substr($data, $headerLength, -8));
|
||||
if (false === $unpacked) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'gzinflate() call failed',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
} elseif ($dataSize != strlen($unpacked)) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Data size check failed',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
} elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) {
|
||||
throw new HTTP_Request2_Exception(
|
||||
'Data CRC check failed',
|
||||
HTTP_Request2_Exception::DECODE_ERROR
|
||||
);
|
||||
}
|
||||
return $unpacked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the message-body encoded by deflate
|
||||
*
|
||||
* @param string $data deflate-encoded data
|
||||
*
|
||||
* @return string decoded data
|
||||
* @throws HTTP_Request2_LogicException
|
||||
*/
|
||||
public static function decodeDeflate($data)
|
||||
{
|
||||
if (!function_exists('gzuncompress')) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
'Unable to decode body: gzip extension not available',
|
||||
HTTP_Request2_Exception::MISCONFIGURATION
|
||||
);
|
||||
}
|
||||
// RFC 2616 defines 'deflate' encoding as zlib format from RFC 1950,
|
||||
// while many applications send raw deflate stream from RFC 1951.
|
||||
// We should check for presence of zlib header and use gzuncompress() or
|
||||
// gzinflate() as needed. See bug #15305
|
||||
$header = unpack('n', substr($data, 0, 2));
|
||||
return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
135
libs/PEAR.1.9.5/HTTP/Request2/SOCKS5.php
Normal file
135
libs/PEAR.1.9.5/HTTP/Request2/SOCKS5.php
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
/**
|
||||
* SOCKS5 proxy connection class
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/** Socket wrapper class used by Socket Adapter */
|
||||
require_once 'HTTP/Request2/SocketWrapper.php';
|
||||
|
||||
/**
|
||||
* SOCKS5 proxy connection class (used by Socket Adapter)
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
* @link http://pear.php.net/bugs/bug.php?id=19332
|
||||
* @link http://tools.ietf.org/html/rfc1928
|
||||
*/
|
||||
class HTTP_Request2_SOCKS5 extends HTTP_Request2_SocketWrapper
|
||||
{
|
||||
/**
|
||||
* Constructor, tries to connect and authenticate to a SOCKS5 proxy
|
||||
*
|
||||
* @param string $address Proxy address, e.g. 'tcp://localhost:1080'
|
||||
* @param int $timeout Connection timeout (seconds)
|
||||
* @param array $contextOptions Stream context options
|
||||
* @param string $username Proxy user name
|
||||
* @param string $password Proxy password
|
||||
*
|
||||
* @throws HTTP_Request2_LogicException
|
||||
* @throws HTTP_Request2_ConnectionException
|
||||
* @throws HTTP_Request2_MessageException
|
||||
*/
|
||||
public function __construct(
|
||||
$address, $timeout = 10, array $contextOptions = array(),
|
||||
$username = null, $password = null
|
||||
) {
|
||||
parent::__construct($address, $timeout, $contextOptions);
|
||||
|
||||
if (strlen($username)) {
|
||||
$request = pack('C4', 5, 2, 0, 2);
|
||||
} else {
|
||||
$request = pack('C3', 5, 1, 0);
|
||||
}
|
||||
$this->write($request);
|
||||
$response = unpack('Cversion/Cmethod', $this->read(3));
|
||||
if (5 != $response['version']) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Invalid version received from SOCKS5 proxy: ' . $response['version'],
|
||||
HTTP_Request2_Exception::MALFORMED_RESPONSE
|
||||
);
|
||||
}
|
||||
switch ($response['method']) {
|
||||
case 2:
|
||||
$this->performAuthentication($username, $password);
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
throw new HTTP_Request2_ConnectionException(
|
||||
"Connection rejected by proxy due to unsupported auth method"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs username/password authentication for SOCKS5
|
||||
*
|
||||
* @param string $username Proxy user name
|
||||
* @param string $password Proxy password
|
||||
*
|
||||
* @throws HTTP_Request2_ConnectionException
|
||||
* @throws HTTP_Request2_MessageException
|
||||
* @link http://tools.ietf.org/html/rfc1929
|
||||
*/
|
||||
protected function performAuthentication($username, $password)
|
||||
{
|
||||
$request = pack('C2', 1, strlen($username)) . $username
|
||||
. pack('C', strlen($password)) . $password;
|
||||
|
||||
$this->write($request);
|
||||
$response = unpack('Cvn/Cstatus', $this->read(3));
|
||||
if (1 != $response['vn'] || 0 != $response['status']) {
|
||||
throw new HTTP_Request2_ConnectionException(
|
||||
'Connection rejected by proxy due to invalid username and/or password'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to a remote host via proxy
|
||||
*
|
||||
* @param string $remoteHost Remote host
|
||||
* @param int $remotePort Remote port
|
||||
*
|
||||
* @throws HTTP_Request2_ConnectionException
|
||||
* @throws HTTP_Request2_MessageException
|
||||
*/
|
||||
public function connect($remoteHost, $remotePort)
|
||||
{
|
||||
$request = pack('C5', 0x05, 0x01, 0x00, 0x03, strlen($remoteHost))
|
||||
. $remoteHost . pack('n', $remotePort);
|
||||
|
||||
$this->write($request);
|
||||
$response = unpack('Cversion/Creply/Creserved', $this->read(1024));
|
||||
if (5 != $response['version'] || 0 != $response['reserved']) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
'Invalid response received from SOCKS5 proxy',
|
||||
HTTP_Request2_Exception::MALFORMED_RESPONSE
|
||||
);
|
||||
} elseif (0 != $response['reply']) {
|
||||
throw new HTTP_Request2_ConnectionException(
|
||||
"Unable to connect to {$remoteHost}:{$remotePort} through SOCKS5 proxy",
|
||||
0, $response['reply']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
297
libs/PEAR.1.9.5/HTTP/Request2/SocketWrapper.php
Normal file
297
libs/PEAR.1.9.5/HTTP/Request2/SocketWrapper.php
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
<?php
|
||||
/**
|
||||
* Socket wrapper class used by Socket Adapter
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to BSD 3-Clause License that is bundled
|
||||
* with this package in the file LICENSE and available at the URL
|
||||
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
*/
|
||||
|
||||
/** Exception classes for HTTP_Request2 package */
|
||||
require_once 'HTTP/Request2/Exception.php';
|
||||
|
||||
/**
|
||||
* Socket wrapper class used by Socket Adapter
|
||||
*
|
||||
* Needed to properly handle connection errors, global timeout support and
|
||||
* similar things. Loosely based on Net_Socket used by older HTTP_Request.
|
||||
*
|
||||
* @category HTTP
|
||||
* @package HTTP_Request2
|
||||
* @author Alexey Borzov <avb@php.net>
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
|
||||
* @version Release: 2.2.1
|
||||
* @link http://pear.php.net/package/HTTP_Request2
|
||||
* @link http://pear.php.net/bugs/bug.php?id=19332
|
||||
* @link http://tools.ietf.org/html/rfc1928
|
||||
*/
|
||||
class HTTP_Request2_SocketWrapper
|
||||
{
|
||||
/**
|
||||
* PHP warning messages raised during stream_socket_client() call
|
||||
* @var array
|
||||
*/
|
||||
protected $connectionWarnings = array();
|
||||
|
||||
/**
|
||||
* Connected socket
|
||||
* @var resource
|
||||
*/
|
||||
protected $socket;
|
||||
|
||||
/**
|
||||
* Sum of start time and global timeout, exception will be thrown if request continues past this time
|
||||
* @var integer
|
||||
*/
|
||||
protected $deadline;
|
||||
|
||||
/**
|
||||
* Global timeout value, mostly for exception messages
|
||||
* @var integer
|
||||
*/
|
||||
protected $timeout;
|
||||
|
||||
/**
|
||||
* Class constructor, tries to establish connection
|
||||
*
|
||||
* @param string $address Address for stream_socket_client() call,
|
||||
* e.g. 'tcp://localhost:80'
|
||||
* @param int $timeout Connection timeout (seconds)
|
||||
* @param array $contextOptions Context options
|
||||
*
|
||||
* @throws HTTP_Request2_LogicException
|
||||
* @throws HTTP_Request2_ConnectionException
|
||||
*/
|
||||
public function __construct($address, $timeout, array $contextOptions = array())
|
||||
{
|
||||
if (!empty($contextOptions)
|
||||
&& !isset($contextOptions['socket']) && !isset($contextOptions['ssl'])
|
||||
) {
|
||||
// Backwards compatibility with 2.1.0 and 2.1.1 releases
|
||||
$contextOptions = array('ssl' => $contextOptions);
|
||||
}
|
||||
$context = stream_context_create();
|
||||
foreach ($contextOptions as $wrapper => $options) {
|
||||
foreach ($options as $name => $value) {
|
||||
if (!stream_context_set_option($context, $wrapper, $name, $value)) {
|
||||
throw new HTTP_Request2_LogicException(
|
||||
"Error setting '{$wrapper}' wrapper context option '{$name}'"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
set_error_handler(array($this, 'connectionWarningsHandler'));
|
||||
$this->socket = stream_socket_client(
|
||||
$address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context
|
||||
);
|
||||
restore_error_handler();
|
||||
// if we fail to bind to a specified local address (see request #19515),
|
||||
// connection still succeeds, albeit with a warning. Throw an Exception
|
||||
// with the warning text in this case as that connection is unlikely
|
||||
// to be what user wants and as Curl throws an error in similar case.
|
||||
if ($this->connectionWarnings) {
|
||||
if ($this->socket) {
|
||||
fclose($this->socket);
|
||||
}
|
||||
$error = $errstr ? $errstr : implode("\n", $this->connectionWarnings);
|
||||
throw new HTTP_Request2_ConnectionException(
|
||||
"Unable to connect to {$address}. Error: {$error}", 0, $errno
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor, disconnects socket
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
fclose($this->socket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around fread(), handles global request timeout
|
||||
*
|
||||
* @param int $length Reads up to this number of bytes
|
||||
*
|
||||
* @return string Data read from socket
|
||||
* @throws HTTP_Request2_MessageException In case of timeout
|
||||
*/
|
||||
public function read($length)
|
||||
{
|
||||
if ($this->deadline) {
|
||||
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
|
||||
}
|
||||
$data = fread($this->socket, $length);
|
||||
$this->checkTimeout();
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads until either the end of the socket or a newline, whichever comes first
|
||||
*
|
||||
* Strips the trailing newline from the returned data, handles global
|
||||
* request timeout. Method idea borrowed from Net_Socket PEAR package.
|
||||
*
|
||||
* @param int $bufferSize buffer size to use for reading
|
||||
* @param int $localTimeout timeout value to use just for this call
|
||||
* (used when waiting for "100 Continue" response)
|
||||
*
|
||||
* @return string Available data up to the newline (not including newline)
|
||||
* @throws HTTP_Request2_MessageException In case of timeout
|
||||
*/
|
||||
public function readLine($bufferSize, $localTimeout = null)
|
||||
{
|
||||
$line = '';
|
||||
while (!feof($this->socket)) {
|
||||
if (null !== $localTimeout) {
|
||||
stream_set_timeout($this->socket, $localTimeout);
|
||||
} elseif ($this->deadline) {
|
||||
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
|
||||
}
|
||||
|
||||
$line .= @fgets($this->socket, $bufferSize);
|
||||
|
||||
if (null === $localTimeout) {
|
||||
$this->checkTimeout();
|
||||
|
||||
} else {
|
||||
$info = stream_get_meta_data($this->socket);
|
||||
// reset socket timeout if we don't have request timeout specified,
|
||||
// prevents further calls failing with a bogus Exception
|
||||
if (!$this->deadline) {
|
||||
$default = (int)@ini_get('default_socket_timeout');
|
||||
stream_set_timeout($this->socket, $default > 0 ? $default : PHP_INT_MAX);
|
||||
}
|
||||
if ($info['timed_out']) {
|
||||
throw new HTTP_Request2_MessageException(
|
||||
"readLine() call timed out", HTTP_Request2_Exception::TIMEOUT
|
||||
);
|
||||
}
|
||||
}
|
||||
if (substr($line, -1) == "\n") {
|
||||
return rtrim($line, "\r\n");
|
||||
}
|
||||
}
|
||||
return $line;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around fwrite(), handles global request timeout
|
||||
*
|
||||
* @param string $data String to be written
|
||||
*
|
||||
* @return int
|
||||
* @throws HTTP_Request2_MessageException
|
||||
*/
|
||||
public function write($data)
|
||||
{
|
||||
if ($this->deadline) {
|
||||
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
|
||||
}
|
||||
$written = fwrite($this->socket, $data);
|
||||
$this->checkTimeout();
|
||||
// http://www.php.net/manual/en/function.fwrite.php#96951
|
||||
if ($written < strlen($data)) {
|
||||
throw new HTTP_Request2_MessageException('Error writing request');
|
||||
}
|
||||
return $written;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for end-of-file on a socket
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function eof()
|
||||
{
|
||||
return feof($this->socket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets request deadline
|
||||
*
|
||||
* @param int $deadline Exception will be thrown if request continues
|
||||
* past this time
|
||||
* @param int $timeout Original request timeout value, to use in
|
||||
* Exception message
|
||||
*/
|
||||
public function setDeadline($deadline, $timeout)
|
||||
{
|
||||
$this->deadline = $deadline;
|
||||
$this->timeout = $timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on encryption on a socket
|
||||
*
|
||||
* @throws HTTP_Request2_ConnectionException
|
||||
*/
|
||||
public function enableCrypto()
|
||||
{
|
||||
$modes = array(
|
||||
STREAM_CRYPTO_METHOD_TLS_CLIENT,
|
||||
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
|
||||
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
|
||||
STREAM_CRYPTO_METHOD_SSLv2_CLIENT
|
||||
);
|
||||
|
||||
foreach ($modes as $mode) {
|
||||
if (stream_socket_enable_crypto($this->socket, true, $mode)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new HTTP_Request2_ConnectionException(
|
||||
'Failed to enable secure connection when connecting through proxy'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an Exception if stream timed out
|
||||
*
|
||||
* @throws HTTP_Request2_MessageException
|
||||
*/
|
||||
protected function checkTimeout()
|
||||
{
|
||||
$info = stream_get_meta_data($this->socket);
|
||||
if ($info['timed_out'] || $this->deadline && time() > $this->deadline) {
|
||||
$reason = $this->deadline
|
||||
? "after {$this->timeout} second(s)"
|
||||
: 'due to default_socket_timeout php.ini setting';
|
||||
throw new HTTP_Request2_MessageException(
|
||||
"Request timed out {$reason}", HTTP_Request2_Exception::TIMEOUT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Error handler to use during stream_socket_client() call
|
||||
*
|
||||
* One stream_socket_client() call may produce *multiple* PHP warnings
|
||||
* (especially OpenSSL-related), we keep them in an array to later use for
|
||||
* the message of HTTP_Request2_ConnectionException
|
||||
*
|
||||
* @param int $errno error level
|
||||
* @param string $errstr error message
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function connectionWarningsHandler($errno, $errstr)
|
||||
{
|
||||
if ($errno & E_WARNING) {
|
||||
array_unshift($this->connectionWarnings, $errstr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
1219
libs/PEAR.1.9.5/Net/URL2.php
Normal file
1219
libs/PEAR.1.9.5/Net/URL2.php
Normal file
File diff suppressed because it is too large
Load diff
1063
libs/PEAR.1.9.5/PEAR.php
Normal file
1063
libs/PEAR.1.9.5/PEAR.php
Normal file
File diff suppressed because it is too large
Load diff
389
libs/PEAR.1.9.5/PEAR/Exception.php
Normal file
389
libs/PEAR.1.9.5/PEAR/Exception.php
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
|
||||
/**
|
||||
* PEAR_Exception
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Tomas V. V. Cox <cox@idecnet.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @author Bertrand Mansion <bmansion@mamasam.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version CVS: $Id$
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.3.3
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Base PEAR_Exception Class
|
||||
*
|
||||
* 1) Features:
|
||||
*
|
||||
* - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception))
|
||||
* - Definable triggers, shot when exceptions occur
|
||||
* - Pretty and informative error messages
|
||||
* - Added more context info available (like class, method or cause)
|
||||
* - cause can be a PEAR_Exception or an array of mixed
|
||||
* PEAR_Exceptions/PEAR_ErrorStack warnings
|
||||
* - callbacks for specific exception classes and their children
|
||||
*
|
||||
* 2) Ideas:
|
||||
*
|
||||
* - Maybe a way to define a 'template' for the output
|
||||
*
|
||||
* 3) Inherited properties from PHP Exception Class:
|
||||
*
|
||||
* protected $message
|
||||
* protected $code
|
||||
* protected $line
|
||||
* protected $file
|
||||
* private $trace
|
||||
*
|
||||
* 4) Inherited methods from PHP Exception Class:
|
||||
*
|
||||
* __clone
|
||||
* __construct
|
||||
* getMessage
|
||||
* getCode
|
||||
* getFile
|
||||
* getLine
|
||||
* getTraceSafe
|
||||
* getTraceSafeAsString
|
||||
* __toString
|
||||
*
|
||||
* 5) Usage example
|
||||
*
|
||||
* <code>
|
||||
* require_once 'PEAR/Exception.php';
|
||||
*
|
||||
* class Test {
|
||||
* function foo() {
|
||||
* throw new PEAR_Exception('Error Message', ERROR_CODE);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* function myLogger($pear_exception) {
|
||||
* echo $pear_exception->getMessage();
|
||||
* }
|
||||
* // each time a exception is thrown the 'myLogger' will be called
|
||||
* // (its use is completely optional)
|
||||
* PEAR_Exception::addObserver('myLogger');
|
||||
* $test = new Test;
|
||||
* try {
|
||||
* $test->foo();
|
||||
* } catch (PEAR_Exception $e) {
|
||||
* print $e;
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @author Bertrand Mansion <bmansion@mamasam.com>
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2009 The Authors
|
||||
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
||||
* @version Release: 1.9.5
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.3.3
|
||||
*
|
||||
*/
|
||||
class PEAR_Exception extends Exception
|
||||
{
|
||||
const OBSERVER_PRINT = -2;
|
||||
const OBSERVER_TRIGGER = -4;
|
||||
const OBSERVER_DIE = -8;
|
||||
protected $cause;
|
||||
private static $_observers = array();
|
||||
private static $_uniqueid = 0;
|
||||
private $_trace;
|
||||
|
||||
/**
|
||||
* Supported signatures:
|
||||
* - PEAR_Exception(string $message);
|
||||
* - PEAR_Exception(string $message, int $code);
|
||||
* - PEAR_Exception(string $message, Exception $cause);
|
||||
* - PEAR_Exception(string $message, Exception $cause, int $code);
|
||||
* - PEAR_Exception(string $message, PEAR_Error $cause);
|
||||
* - PEAR_Exception(string $message, PEAR_Error $cause, int $code);
|
||||
* - PEAR_Exception(string $message, array $causes);
|
||||
* - PEAR_Exception(string $message, array $causes, int $code);
|
||||
* @param string exception message
|
||||
* @param int|Exception|PEAR_Error|array|null exception cause
|
||||
* @param int|null exception code or null
|
||||
*/
|
||||
public function __construct($message, $p2 = null, $p3 = null)
|
||||
{
|
||||
if (is_int($p2)) {
|
||||
$code = $p2;
|
||||
$this->cause = null;
|
||||
} elseif (is_object($p2) || is_array($p2)) {
|
||||
// using is_object allows both Exception and PEAR_Error
|
||||
if (is_object($p2) && !($p2 instanceof Exception)) {
|
||||
if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) {
|
||||
throw new PEAR_Exception('exception cause must be Exception, ' .
|
||||
'array, or PEAR_Error');
|
||||
}
|
||||
}
|
||||
$code = $p3;
|
||||
if (is_array($p2) && isset($p2['message'])) {
|
||||
// fix potential problem of passing in a single warning
|
||||
$p2 = array($p2);
|
||||
}
|
||||
$this->cause = $p2;
|
||||
} else {
|
||||
$code = null;
|
||||
$this->cause = null;
|
||||
}
|
||||
parent::__construct($message, $code);
|
||||
$this->signal();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $callback - A valid php callback, see php func is_callable()
|
||||
* - A PEAR_Exception::OBSERVER_* constant
|
||||
* - An array(const PEAR_Exception::OBSERVER_*,
|
||||
* mixed $options)
|
||||
* @param string $label The name of the observer. Use this if you want
|
||||
* to remove it later with removeObserver()
|
||||
*/
|
||||
public static function addObserver($callback, $label = 'default')
|
||||
{
|
||||
self::$_observers[$label] = $callback;
|
||||
}
|
||||
|
||||
public static function removeObserver($label = 'default')
|
||||
{
|
||||
unset(self::$_observers[$label]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int unique identifier for an observer
|
||||
*/
|
||||
public static function getUniqueId()
|
||||
{
|
||||
return self::$_uniqueid++;
|
||||
}
|
||||
|
||||
private function signal()
|
||||
{
|
||||
foreach (self::$_observers as $func) {
|
||||
if (is_callable($func)) {
|
||||
call_user_func($func, $this);
|
||||
continue;
|
||||
}
|
||||
settype($func, 'array');
|
||||
switch ($func[0]) {
|
||||
case self::OBSERVER_PRINT :
|
||||
$f = (isset($func[1])) ? $func[1] : '%s';
|
||||
printf($f, $this->getMessage());
|
||||
break;
|
||||
case self::OBSERVER_TRIGGER :
|
||||
$f = (isset($func[1])) ? $func[1] : E_USER_NOTICE;
|
||||
trigger_error($this->getMessage(), $f);
|
||||
break;
|
||||
case self::OBSERVER_DIE :
|
||||
$f = (isset($func[1])) ? $func[1] : '%s';
|
||||
die(printf($f, $this->getMessage()));
|
||||
break;
|
||||
default:
|
||||
trigger_error('invalid observer type', E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return specific error information that can be used for more detailed
|
||||
* error messages or translation.
|
||||
*
|
||||
* This method may be overridden in child exception classes in order
|
||||
* to add functionality not present in PEAR_Exception and is a placeholder
|
||||
* to define API
|
||||
*
|
||||
* The returned array must be an associative array of parameter => value like so:
|
||||
* <pre>
|
||||
* array('name' => $name, 'context' => array(...))
|
||||
* </pre>
|
||||
* @return array
|
||||
*/
|
||||
public function getErrorData()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the exception that caused this exception to be thrown
|
||||
* @access public
|
||||
* @return Exception|array The context of the exception
|
||||
*/
|
||||
public function getCause()
|
||||
{
|
||||
return $this->cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function must be public to call on caused exceptions
|
||||
* @param array
|
||||
*/
|
||||
public function getCauseMessage(&$causes)
|
||||
{
|
||||
$trace = $this->getTraceSafe();
|
||||
$cause = array('class' => get_class($this),
|
||||
'message' => $this->message,
|
||||
'file' => 'unknown',
|
||||
'line' => 'unknown');
|
||||
if (isset($trace[0])) {
|
||||
if (isset($trace[0]['file'])) {
|
||||
$cause['file'] = $trace[0]['file'];
|
||||
$cause['line'] = $trace[0]['line'];
|
||||
}
|
||||
}
|
||||
$causes[] = $cause;
|
||||
if ($this->cause instanceof PEAR_Exception) {
|
||||
$this->cause->getCauseMessage($causes);
|
||||
} elseif ($this->cause instanceof Exception) {
|
||||
$causes[] = array('class' => get_class($this->cause),
|
||||
'message' => $this->cause->getMessage(),
|
||||
'file' => $this->cause->getFile(),
|
||||
'line' => $this->cause->getLine());
|
||||
} elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) {
|
||||
$causes[] = array('class' => get_class($this->cause),
|
||||
'message' => $this->cause->getMessage(),
|
||||
'file' => 'unknown',
|
||||
'line' => 'unknown');
|
||||
} elseif (is_array($this->cause)) {
|
||||
foreach ($this->cause as $cause) {
|
||||
if ($cause instanceof PEAR_Exception) {
|
||||
$cause->getCauseMessage($causes);
|
||||
} elseif ($cause instanceof Exception) {
|
||||
$causes[] = array('class' => get_class($cause),
|
||||
'message' => $cause->getMessage(),
|
||||
'file' => $cause->getFile(),
|
||||
'line' => $cause->getLine());
|
||||
} elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) {
|
||||
$causes[] = array('class' => get_class($cause),
|
||||
'message' => $cause->getMessage(),
|
||||
'file' => 'unknown',
|
||||
'line' => 'unknown');
|
||||
} elseif (is_array($cause) && isset($cause['message'])) {
|
||||
// PEAR_ErrorStack warning
|
||||
$causes[] = array(
|
||||
'class' => $cause['package'],
|
||||
'message' => $cause['message'],
|
||||
'file' => isset($cause['context']['file']) ?
|
||||
$cause['context']['file'] :
|
||||
'unknown',
|
||||
'line' => isset($cause['context']['line']) ?
|
||||
$cause['context']['line'] :
|
||||
'unknown',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getTraceSafe()
|
||||
{
|
||||
if (!isset($this->_trace)) {
|
||||
$this->_trace = $this->getTrace();
|
||||
if (empty($this->_trace)) {
|
||||
$backtrace = debug_backtrace();
|
||||
$this->_trace = array($backtrace[count($backtrace)-1]);
|
||||
}
|
||||
}
|
||||
return $this->_trace;
|
||||
}
|
||||
|
||||
public function getErrorClass()
|
||||
{
|
||||
$trace = $this->getTraceSafe();
|
||||
return $trace[0]['class'];
|
||||
}
|
||||
|
||||
public function getErrorMethod()
|
||||
{
|
||||
$trace = $this->getTraceSafe();
|
||||
return $trace[0]['function'];
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
if (isset($_SERVER['REQUEST_URI'])) {
|
||||
return $this->toHtml();
|
||||
}
|
||||
return $this->toText();
|
||||
}
|
||||
|
||||
public function toHtml()
|
||||
{
|
||||
$trace = $this->getTraceSafe();
|
||||
$causes = array();
|
||||
$this->getCauseMessage($causes);
|
||||
$html = '<table style="border: 1px" cellspacing="0">' . "\n";
|
||||
foreach ($causes as $i => $cause) {
|
||||
$html .= '<tr><td colspan="3" style="background: #ff9999">'
|
||||
. str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: '
|
||||
. htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> '
|
||||
. 'on line <b>' . $cause['line'] . '</b>'
|
||||
. "</td></tr>\n";
|
||||
}
|
||||
$html .= '<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>' . "\n"
|
||||
. '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>'
|
||||
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>'
|
||||
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n";
|
||||
|
||||
foreach ($trace as $k => $v) {
|
||||
$html .= '<tr><td style="text-align: center;">' . $k . '</td>'
|
||||
. '<td>';
|
||||
if (!empty($v['class'])) {
|
||||
$html .= $v['class'] . $v['type'];
|
||||
}
|
||||
$html .= $v['function'];
|
||||
$args = array();
|
||||
if (!empty($v['args'])) {
|
||||
foreach ($v['args'] as $arg) {
|
||||
if (is_null($arg)) $args[] = 'null';
|
||||
elseif (is_array($arg)) $args[] = 'Array';
|
||||
elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
|
||||
elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
|
||||
elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
|
||||
else {
|
||||
$arg = (string)$arg;
|
||||
$str = htmlspecialchars(substr($arg, 0, 16));
|
||||
if (strlen($arg) > 16) $str .= '…';
|
||||
$args[] = "'" . $str . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
$html .= '(' . implode(', ',$args) . ')'
|
||||
. '</td>'
|
||||
. '<td>' . (isset($v['file']) ? $v['file'] : 'unknown')
|
||||
. ':' . (isset($v['line']) ? $v['line'] : 'unknown')
|
||||
. '</td></tr>' . "\n";
|
||||
}
|
||||
$html .= '<tr><td style="text-align: center;">' . ($k+1) . '</td>'
|
||||
. '<td>{main}</td>'
|
||||
. '<td> </td></tr>' . "\n"
|
||||
. '</table>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function toText()
|
||||
{
|
||||
$causes = array();
|
||||
$this->getCauseMessage($causes);
|
||||
$causeMsg = '';
|
||||
foreach ($causes as $i => $cause) {
|
||||
$causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': '
|
||||
. $cause['message'] . ' in ' . $cause['file']
|
||||
. ' on line ' . $cause['line'] . "\n";
|
||||
}
|
||||
return $causeMsg . $this->getTraceAsString();
|
||||
}
|
||||
}
|
||||
33
libs/PEAR.1.9.5/PEAR5.php
Normal file
33
libs/PEAR.1.9.5/PEAR5.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* This is only meant for PHP 5 to get rid of certain strict warning
|
||||
* that doesn't get hidden since it's in the shutdown function
|
||||
*/
|
||||
class PEAR5
|
||||
{
|
||||
/**
|
||||
* If you have a class that's mostly/entirely static, and you need static
|
||||
* properties, you can use this method to simulate them. Eg. in your method(s)
|
||||
* do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
|
||||
* You MUST use a reference, or they will not persist!
|
||||
*
|
||||
* @access public
|
||||
* @param string $class The calling classname, to prevent clashes
|
||||
* @param string $var The variable to retrieve.
|
||||
* @return mixed A reference to the variable. If not set it will be
|
||||
* auto initialised to NULL.
|
||||
*/
|
||||
static function &getStaticProperty($class, $var)
|
||||
{
|
||||
static $properties;
|
||||
if (!isset($properties[$class])) {
|
||||
$properties[$class] = array();
|
||||
}
|
||||
|
||||
if (!array_key_exists($var, $properties[$class])) {
|
||||
$properties[$class][$var] = null;
|
||||
}
|
||||
|
||||
return $properties[$class][$var];
|
||||
}
|
||||
}
|
||||
|
|
@ -475,11 +475,19 @@ class adminAdminController extends admin
|
|||
*/
|
||||
function procAdminRemoveIcons()
|
||||
{
|
||||
|
||||
$site_info = Context::get('site_module_info');
|
||||
$virtual_site = '';
|
||||
if($site_info->site_srl)
|
||||
{
|
||||
$virtual_site = $site_info->site_srl . '/';
|
||||
}
|
||||
|
||||
$iconname = Context::get('iconname');
|
||||
$file_exist = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
$file_exist = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
|
||||
if($file_exist)
|
||||
{
|
||||
@FileHandler::removeFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
@FileHandler::removeFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -935,29 +935,35 @@ class adminAdminModel extends admin
|
|||
return $output->data->count;
|
||||
}
|
||||
|
||||
function getFaviconUrl()
|
||||
function getFaviconUrl($default = true)
|
||||
{
|
||||
return $this->iconUrlCheck('favicon.ico', 'faviconSample.png');
|
||||
return $this->iconUrlCheck('favicon.ico', 'faviconSample.png', $default);
|
||||
}
|
||||
|
||||
function getMobileIconUrl()
|
||||
function getMobileIconUrl($default = true)
|
||||
{
|
||||
return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png');
|
||||
return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default);
|
||||
}
|
||||
|
||||
function iconUrlCheck($iconname, $default_icon_name)
|
||||
function iconUrlCheck($iconname, $default_icon_name, $default)
|
||||
{
|
||||
$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $iconname);
|
||||
if(!$file_exsit)
|
||||
$site_info = Context::get('site_module_info');
|
||||
$virtual_site = '';
|
||||
if($site_info->site_srl)
|
||||
{
|
||||
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
|
||||
$virtual_site = $site_info->site_srl . '/';
|
||||
}
|
||||
else
|
||||
|
||||
$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
|
||||
if(!$file_exsit && $default === true)
|
||||
{
|
||||
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
|
||||
}
|
||||
elseif($file_exsit)
|
||||
{
|
||||
$default_url = Context::getDefaultUrl();
|
||||
$icon_url = $default_url . 'files/attach/xeicon/' . $iconname;
|
||||
$icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname;
|
||||
}
|
||||
|
||||
return $icon_url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,6 +248,9 @@ class adminAdminView extends admin
|
|||
*/
|
||||
function dispAdminIndex()
|
||||
{
|
||||
$db_info = Context::getDBInfo();
|
||||
Context::set('db_info',$db_info);
|
||||
|
||||
// Get statistics
|
||||
$args = new stdClass();
|
||||
$args->date = date("Ymd000000", $_SERVER['REQUEST_TIME'] - 60 * 60 * 24);
|
||||
|
|
@ -626,6 +629,7 @@ class adminAdminView extends admin
|
|||
$info['PHP_Core'] = $php_core;
|
||||
|
||||
$str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n";
|
||||
$str_info .= "realpath : ".realpath('./')."\n";
|
||||
foreach( $info as $key=>$value )
|
||||
{
|
||||
if( is_array( $value ) == false ) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class admin extends ModuleObject
|
|||
{
|
||||
|
||||
private $adminMenuName = '__ADMINMENU_V17__';
|
||||
|
||||
public function getAdminMenuName()
|
||||
{
|
||||
return $this->adminMenuName;
|
||||
|
|
|
|||
|
|
@ -1606,4 +1606,11 @@
|
|||
<value xml:lang="en"><![CDATA[Your IP]]></value>
|
||||
<value xml:lang="jp"><![CDATA[接続したIP]]></value>
|
||||
</item>
|
||||
<item name="sitelock_in_use">
|
||||
<value xml:lang="ko"><![CDATA[사이트 잠금을 사용중입니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Site lock in use]]></value>
|
||||
</item>
|
||||
<item name="about_sitelock_in_use">
|
||||
<value xml:lang="ko"><![CDATA[관리자 페이지에서 허용한 IP를 제외한 사용자는 접속할 수 없습니다.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@
|
|||
<input type="hidden" name="module" value="install">
|
||||
<input type="hidden" name="act" value="procInstallAdminConfigIconUpload">
|
||||
<p>
|
||||
<input type="file" name="favicon" id="favicon" title="Mobile Home Icon"/>
|
||||
<input class="x_btn" type="submit" value="{$lang->cmd_submit}" style="vertical-align:top">
|
||||
<input type="file" name="favicon" id="favicon" title="Favicon"/>
|
||||
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
||||
</p>
|
||||
</form>
|
||||
<span class="x_help-block">{$lang->about_use_favicon}</span>
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
<input type="hidden" name="act" value="procInstallAdminConfigIconUpload">
|
||||
<p>
|
||||
<input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/>
|
||||
<input class="x_btn" type="submit" value="{$lang->cmd_submit}" style="vertical-align:top">
|
||||
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
||||
</p>
|
||||
</form>
|
||||
<span class="x_help-block">{$lang->detail_use_mobile_icon}</span>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@
|
|||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
|
||||
<div class="message error" cond="$db_info->use_sitelock == 'Y'">
|
||||
<h2>{$lang->sitelock_in_use}</h2>
|
||||
<p>{$lang->about_sitelock_in_use}</p>
|
||||
</div>
|
||||
|
||||
<form action="./" method="post" class="message info x_clearfix" cond="!$isLicenseAgreement">
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
||||
<input type="hidden" name="module" value="install" />
|
||||
|
|
@ -74,6 +79,20 @@
|
|||
<include target="./_dashboard_default.html" />
|
||||
</block>
|
||||
</div>
|
||||
|
||||
<div class="message error" cond="version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<')">
|
||||
<h2>안전하지 않은 PHP 버전 경고</h2>
|
||||
<p>이 서버는 안전하지 않은 PHP 버전을 사용하고 있으며, PHP를 최신 안정 버전으로의 업그레이드를 권장합니다.</p>
|
||||
<p>이 서버의 PHP 버전 : <strong>{phpversion()}</strong></p>
|
||||
<p><a href="http://php.net/downloads.php" target="_blank">PHP 최신 안정버전 확인하기</a></p>
|
||||
|
||||
<ul>
|
||||
<li>매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.</li>
|
||||
<li>XE 최신 버전을 사용할 수 없습니다.</li>
|
||||
<li>XE 최신 버전 이상을 지원하는 확장 기능을 사용할 수 없습니다.</li>
|
||||
<li>일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<include target="./_footer.html" />
|
||||
|
||||
|
|
|
|||
3
modules/admin/tpl/js/admin.min.js
vendored
3
modules/admin/tpl/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
1
modules/admin/tpl/js/admin.min.map
Normal file
1
modules/admin/tpl/js/admin.min.map
Normal file
File diff suppressed because one or more lines are too long
3
modules/admin/tpl/js/config.min.js
vendored
3
modules/admin/tpl/js/config.min.js
vendored
|
|
@ -1 +1,2 @@
|
|||
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
|
||||
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
|
||||
//# sourceMappingURL=config.min.map
|
||||
1
modules/admin/tpl/js/config.min.map
Normal file
1
modules/admin/tpl/js/config.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"config.min.js","sources":["config.js"],"names":["setStartModule","target_module","jQuery","text","index_module_srl","val","css","viewSiteSearch","getFTPList","pwd","form","get","ftp_root_path","value","sftp","checked","xe_root","params","ftp_user","ftp_password","ftp_host","ftp_port","exec_xml","completeGetFtpInfo","removeFTPInfo","filterAlertMessage","ret_obj","error","alert","message","e","empty","list","isArray","item","arr","split","pop","push","target","join","i","length","v","append","deleteIcon","iconname","iconDeleteMessage","icon","attr","doRecompileCacheFile","confirm","xe","lang","confirm_run","completeCacheMessage","doResetAdminMenu","confirm_reset_admin_menu","menu_srl","admin_menu_srl","completeResetAdminMenu","document","location","reload","$","bind"],"mappings":"AAMA,QAASA,kBACR,GAAIC,GAAgBC,OAAO,iCAAiCC,OACxDC,EAAmBF,OAAO,iBAAiBG,KAC/CH,QAAO,mBAAmBG,IAAIJ,GAC9BC,OAAO,qBAAqBG,IAAID,GAChCF,OAAO,qEAAqEI,IAAI,UAAU,QAG3F,QAASC,kBACRL,OAAO,wBAAwBI,IAAI,UAAU,IAG9C,QAASE,YAAWC,GAEnB,GAAIC,GAAOR,OAAO,aAAaS,IAAI,EAGlCD,GAAKE,cAAcC,MAFF,mBAAT,GAEmBJ,GAIvBC,EAAKE,cAAcC,OAA8B,mBAAdH,GAAS,MAAoBA,EAAKI,KAAKC,QAElDC,QAIA,GAI7B,IAAIC,KAEJA,GAAOC,SAAWhB,OAAO,aAAaG,MACtCY,EAAOE,aAAcjB,OAAO,iBAAiBG,MAC7CY,EAAOG,SAAWlB,OAAO,aAAaG,MACtCY,EAAOI,SAAWnB,OAAO,aAAaG,MACtCY,EAAOL,cAAgBV,OAAO,kBAAkBG,MAChDY,EAAOH,KAAOZ,OAAO,4BAA4BG,MAEjDiB,SAAS,QAAS,kBAAmBL,EAAQM,oBAAqB,OAAQ,QAAS,WAAYN,EAAQP,GAGxG,QAASc,iBAER,GAAIP,KACJK,UAAS,UAAW,gCAAiCL,EAAQQ,oBAAqB,QAAS,WAAYR,GAGxG,QAASM,oBAAmBG,GAE3B,GAAqB,IAAlBA,EAAQC,MAIV,MAFAC,OAAMF,EAAQC,WACdC,OAAMF,EAAQG,QAGf,IAAIC,GAAI5B,OAAO,kBAAkB6B,QAE7BC,EAAO,EACP9B,QAAO+B,QAAQP,EAAQM,KAAKE,QAE/BR,EAAQM,KAAKE,MAAQR,EAAQM,KAAKE,OAGnCzB,IAAMP,OAAO,aAAaS,IAAI,GAAGC,cAAcC,MACrC,KAAPJ,MAEF0B,IAAM1B,IAAI2B,MAAM,KAChBD,IAAIE,MACJF,IAAIE,MACJF,IAAIG,KAAK,IACTC,OAASJ,IAAIK,KAAK,KAClBR,EAAOA,EAAO,mDAAmDO,OAAO,yBAGzE,KAAI,GAAIE,GAAE,EAAEA,EAAEf,EAAQM,KAAKE,KAAKQ,OAAOD,IACvC,CACC,GAAIE,GAAIjB,EAAQM,KAAKE,KAAKO,EAClB,QAALE,GAIW,MAALA,IAMRX,EAAOA,EAAO,mDAAmDvB,IAAIkC,EAAE,QAAQA,EAAE,kBAGnFX,EAAO,OAAOA,EAAK,QACnBF,EAAEc,OAAO1C,OAAO8B,IAIjB,QAASa,YAAWC,GACnB,GAAI7B,KACJA,GAAO6B,SAAWA,EAClBxB,SAAS,QAAS,uBAAwBL,EAAQ8B,mBAAoB,QAAS,WAAY9B,GAC3F+B,KAAOF,EAER,QAASC,mBAAkBrB,GAC1BE,MAAMF,EAAQG,SAEO,KAAjBH,EAAQC,QAEC,eAARqB,KACH9C,OAAO,uBAAuB+C,KAAK,MAAO,2CACzB,eAARD,MACT9C,OAAO,uBAAuB+C,KAAK,MAAO,4CAI7C,QAASC,wBACR,GAAKC,QAAQC,GAAGC,KAAKC,aAArB,CACA,GAAIrC,KACJK,UAAS,QAAQ,8BAA+BL,EAAQsC,uBAEzD,QAASA,sBAAqB7B,GAC7BE,MAAMF,EAAQG,SAGf,QAAS2B,oBACR,GAAKL,QAAQC,GAAGC,KAAKI,0BAArB,CACA,GAAIxC,KACJA,GAAOyC,SAAWC,eAClBrC,SAAS,QAAQ,qBAAsBL,EAAQ2C,yBAEhD,QAASA,0BACRC,SAASC,SAASC,SAzInB7D,OAAO,SAAS8D,GACfA,EAAE,iBAAiBC,KAAK,QAAS,WAChCD,EAAE,oBAAoB1D,IAAI,UAAU,OAoGtC,IAAI0C,MAAO"}
|
||||
3
modules/admin/tpl/js/menu_setup.min.js
vendored
3
modules/admin/tpl/js/menu_setup.min.js
vendored
|
|
@ -1 +1,2 @@
|
|||
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
|
||||
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
|
||||
//# sourceMappingURL=menu_setup.min.map
|
||||
1
modules/admin/tpl/js/menu_setup.min.map
Normal file
1
modules/admin/tpl/js/menu_setup.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"menu_setup.min.js","sources":["menu_setup.js"],"names":["jQuery","$","completeGetActList","obj","$optgroup","moduleList","menuList","menuNameList","x","appendTo","y","append","title","parentSrl","editForm","listForm","click","this","parent","prevAll","val","find","params","response_tags","exec_xml","menu_item_srl","submit","closest","getOffset","elem","offsetParent","top","left","offsetTop","offsetLeft","delegate","$pkey","is_child","$this","length","dragging","$holder","mousedown.st","event","$uls","$ul","width","height","offset","position","offsets","i","dropzone","target","is","which","parentsUntil","filter","eq","pageX","pageY","get","$clone","clone","attr","wrap","each","has","o","push","bottom","$item","remove","end","addClass","css","opacity","zIndex","document","unbind","bind","diff","nTop","c","element","hasClass","state","$dropzone","$li","before","after","prepend","hide","slideDown","removeClass","slideUp","$par","children","trigger","mouseover.st","mouseout.st","display","backgroundColor"],"mappings":"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"}
|
||||
|
|
@ -306,6 +306,7 @@ class autoinstallAdminModel extends autoinstall
|
|||
if($dep->path === '.')
|
||||
{
|
||||
$package->contain_core = TRUE;
|
||||
$package->contain_core_version = $dep->version;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -327,6 +328,7 @@ class autoinstallAdminModel extends autoinstall
|
|||
if($package->path === '.')
|
||||
{
|
||||
$package->contain_core = TRUE;
|
||||
$package->contain_core_version = $package->version;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -362,6 +362,14 @@ class autoinstallAdminView extends autoinstall
|
|||
|
||||
Context::set("package", $package);
|
||||
Context::set('contain_core', $package->contain_core);
|
||||
Context::set('contain_core_version', $package->contain_core_version);
|
||||
|
||||
$does_not_update_xecore = FALSE;
|
||||
if($package->contain_core_version && version_compare($package->contain_core_version, '1.8.0', '>=') && version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<'))
|
||||
{
|
||||
$does_not_update_xecore = TRUE;
|
||||
}
|
||||
Context::set('does_not_update_xecore', $does_not_update_xecore);
|
||||
|
||||
if(!$_SESSION['ftp_password'])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class ModuleInstaller
|
|||
}
|
||||
else
|
||||
{
|
||||
$subpath = substr($this->package->path, 2);
|
||||
$subpath = trim(substr($this->package->path, 2), '/');
|
||||
$this->download_file = $this->temp_dir . $subpath . ".tar";
|
||||
$subpatharr = explode("/", $subpath);
|
||||
array_pop($subpatharr);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,21 @@
|
|||
<load target="js/waiting.js" usecdn="true" />
|
||||
|
||||
<h2>{$package->title} ver. {$package->version}</h2>
|
||||
|
||||
<div class="message error" cond="version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<')">
|
||||
<h2>안전하지 않은 PHP 버전 경고</h2>
|
||||
<p>이 서버는 안전하지 않은 PHP 버전을 사용하고 있으며, PHP를 최신 안정 버전으로의 업그레이드를 권장합니다.</p>
|
||||
<p>이 서버의 PHP 버전 : <strong>{phpversion()}</strong></p>
|
||||
<p><a href="http://php.net/downloads.php" target="_blank">PHP 최신 안정버전 확인하기</a></p>
|
||||
|
||||
<ul>
|
||||
<li>매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.</li>
|
||||
<li>XE 최신 버전을 사용할 수 없습니다.</li>
|
||||
<li>XE 최신 버전 이상을 지원하는 확장 기능을 사용할 수 없습니다.</li>
|
||||
<li>일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div cond="$contain_core" class="x_alert x_alert-block">
|
||||
<h4>{$lang->msg_update_core_title}</h4>
|
||||
<p>{$lang->msg_update_core}</p>
|
||||
|
|
@ -24,7 +39,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<block cond="!$package->installed || $package->need_update">
|
||||
<block cond="!$does_not_update_xecore && (!$package->installed || $package->need_update)">
|
||||
<div cond="!$directModuleInstall->toBool() || $show_ftp_note" class="x_well x_clearfix">
|
||||
<block cond="!$directModuleInstall->toBool()">
|
||||
<p>{$lang->msg_direct_install_not_supported}</p>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class boardAdminController extends board {
|
|||
* @brief insert borad module
|
||||
**/
|
||||
function procBoardAdminInsertBoard($args = null) {
|
||||
// igenerate module model/controller object
|
||||
// generate module model/controller object
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class boardAPI extends board {
|
|||
/**
|
||||
* @brief category list
|
||||
**/
|
||||
function dispBoardCatogoryList(&$oModule) {
|
||||
function dispBoardCategoryList(&$oModule) {
|
||||
$oModule->add('category_list',Context::get('category_list'));
|
||||
}
|
||||
|
||||
|
|
@ -97,10 +97,18 @@ class boardAPI extends board {
|
|||
|
||||
|
||||
function arrangeContent($content) {
|
||||
$oBoardView = getView('board');
|
||||
$output = new stdClass;
|
||||
if($content){
|
||||
$output = $content->gets('document_srl','category_srl','member_srl','nick_name','user_id','user_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
|
||||
|
||||
if(!$oBoardView->grant->view)
|
||||
{
|
||||
unset($output->content);
|
||||
unset($output->tags);
|
||||
unset($output->extra_vars);
|
||||
}
|
||||
|
||||
$t_width = Context::get('thumbnail_width');
|
||||
$t_height = Context::get('thumbnail_height');
|
||||
$t_type = Context::get('thumbnail_type');
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class boardController extends board
|
|||
$obj->commentStatus = $obj->comment_status;
|
||||
|
||||
settype($obj->title, "string");
|
||||
if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
|
||||
if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
|
||||
//setup dpcument title tp 'Untitled'
|
||||
if($obj->title == '') $obj->title = 'Untitled';
|
||||
|
||||
|
|
@ -89,11 +89,12 @@ class boardController extends board
|
|||
$bAnonymous = false;
|
||||
}
|
||||
|
||||
if((!$obj->status && $obj->is_secret == 'Y') || strtoupper($obj->status == 'SECRET'))
|
||||
if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
|
||||
{
|
||||
$use_status = explode('|@|', $this->module_info->use_status);
|
||||
if(!is_array($use_status) || !in_array('SECRET', $use_status))
|
||||
{
|
||||
unset($obj->is_secret);
|
||||
$obj->status = 'PUBLIC';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,11 @@ class boardMobile extends boardView
|
|||
$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
|
||||
|
||||
if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
|
||||
if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
|
||||
if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
|
||||
if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count;
|
||||
if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
|
||||
if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
|
||||
$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
|
||||
|
||||
// $this->_getStatusNameListecret option backward compatibility
|
||||
|
|
|
|||
|
|
@ -212,6 +212,13 @@ class boardView extends board
|
|||
// check if the use_category option is enabled
|
||||
if($this->module_info->use_category=='Y')
|
||||
{
|
||||
// check the grant
|
||||
if(!$this->grant->list)
|
||||
{
|
||||
Context::set('category_list', array());
|
||||
return;
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
Context::set('category_list', $oDocumentModel->getCategoryList($this->module_srl));
|
||||
|
||||
|
|
@ -260,6 +267,15 @@ class boardView extends board
|
|||
}
|
||||
}
|
||||
|
||||
// if the document is TEMP saved, check Grant
|
||||
if($oDocument->getStatus() == 'TEMP')
|
||||
{
|
||||
if(!$oDocument->isGranted())
|
||||
{
|
||||
$oDocument = $oDocumentModel->getDocument(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -323,6 +339,59 @@ class boardView extends board
|
|||
* @brief display the document file list (can be used by API)
|
||||
**/
|
||||
function dispBoardContentFileList(){
|
||||
/**
|
||||
* check the access grant (all the grant has been set by the module object)
|
||||
**/
|
||||
if(!$this->grant->access)
|
||||
{
|
||||
return $this->dispBoardMessage('msg_not_permitted');
|
||||
}
|
||||
|
||||
// check document view grant
|
||||
$this->dispBoardContentView();
|
||||
|
||||
// Check if a permission for file download is granted
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = getModel('module');
|
||||
$file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl);
|
||||
|
||||
$downloadGrantCount = 0;
|
||||
if(is_array($file_module_config->download_grant))
|
||||
{
|
||||
foreach($file_module_config->download_grant AS $value)
|
||||
if($value) $downloadGrantCount++;
|
||||
}
|
||||
|
||||
if(is_array($file_module_config->download_grant) && $downloadGrantCount>0)
|
||||
{
|
||||
if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
$oModuleModel =& getModel('module');
|
||||
$columnList = array('module_srl', 'site_srl');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList);
|
||||
|
||||
if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl))
|
||||
{
|
||||
$oMemberModel =& getModel('member');
|
||||
$member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl);
|
||||
|
||||
$is_permitted = false;
|
||||
for($i=0;$i<count($file_module_config->download_grant);$i++)
|
||||
{
|
||||
$group_srl = $file_module_config->download_grant[$i];
|
||||
if($member_groups[$group_srl])
|
||||
{
|
||||
$is_permitted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$is_permitted) return $this->stop('msg_not_permitted_download');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
|
@ -336,6 +405,9 @@ class boardView extends board
|
|||
* @brief display the document comment list (can be used by API)
|
||||
**/
|
||||
function dispBoardContentCommentList(){
|
||||
// check document view grant
|
||||
$this->dispBoardContentView();
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
|
@ -360,6 +432,13 @@ class boardView extends board
|
|||
* @brief display notice list (can be used by API)
|
||||
**/
|
||||
function dispBoardNoticeList(){
|
||||
// check the grant
|
||||
if(!$this->grant->list)
|
||||
{
|
||||
Context::set('notice_list', array());
|
||||
return;
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $this->module_srl;
|
||||
|
|
@ -395,6 +474,16 @@ class boardView extends board
|
|||
$args->search_target = Context::get('search_target');
|
||||
$args->search_keyword = Context::get('search_keyword');
|
||||
|
||||
$search_option = Context::get('search_option');
|
||||
if($search_option==FALSE)
|
||||
{
|
||||
$search_option = $this->search_option;
|
||||
}
|
||||
if(isset($search_option[$args->search_target])==FALSE)
|
||||
{
|
||||
$args->search_target = '';
|
||||
}
|
||||
|
||||
// if the category is enabled, then get the category
|
||||
if($this->module_info->use_category=='Y')
|
||||
{
|
||||
|
|
@ -639,7 +728,8 @@ class boardView extends board
|
|||
/**
|
||||
* add JS filters
|
||||
**/
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml');
|
||||
if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
|
||||
else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml');
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('category_list.text', 'category_list.title');
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
<action name="dispBoardNoticeList" type="view" />
|
||||
<action name="dispBoardContentList" type="view" />
|
||||
<action name="dispBoardContentView" type="view" />
|
||||
<action name="dispBoardCatogoryList" type="view" />
|
||||
<action name="dispBoardCategoryList" type="view" />
|
||||
<action name="dispBoardContentCommentList" type="view" />
|
||||
<action name="dispBoardContentFileList" type="view" />
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<!--%import("css/mboard.css")-->
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<div class="hx h2">
|
||||
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a> › {$lang->category}</h2>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd rd">
|
||||
<div class="hx h2">
|
||||
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a></h2>
|
||||
|
|
|
|||
|
|
@ -378,8 +378,10 @@ input[type=radio] {
|
|||
}
|
||||
.rp .btn {
|
||||
display: inline-block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
width: 15px !important;
|
||||
height: 15px !important;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
text-indent: 15px;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<div class="hx h2">
|
||||
<h2>{$lang->confirm_delete}</h2>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<div class="hx h2">
|
||||
<h2>{$lang->confirm_delete}</h2>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
<!--%import("css/mboard.css")-->
|
||||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<div class="hx h2">
|
||||
<h2>{$lang->msg_input_password}</h2>
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
|
||||
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
|
||||
//# sourceMappingURL=mboard.min.map
|
||||
1
modules/board/m.skins/default/js/mboard.min.map
Normal file
1
modules/board/m.skins/default/js/mboard.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","parent","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAsBC,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBC,EAAcL,EAAQK,YAEtBC,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FH,KAAaC,EAAMA,EAAIE,SAAS,MAAMH,GAAa,YAAYA,GAElEI,SAASC,KAAOJ,EAGjB,QAASK,0BAAyBX,GAEjC,GAMIM,GAJAL,GAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBQ,EAAeZ,EAAQY,YAS1BN,GANGF,EAMGG,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAMnDI,IAAcN,EAAMA,EAAIE,SAAS,WAAWI,IAE/CH,SAASC,KAAOJ,EAGjB,QAASO,iBAAgBC,GAExBC,OAAO,OAAOC,SACdD,OAAO,SAASC,SAChBD,OAAO,QAAQE,SAASC,MAAMJ,EAAQK,MAGvC,QAASC,UAAShB,EAAciB,GAE/B,GAAIC,KACJA,GAAOC,MAAQF,EACfC,EAAOlB,aAAeA,EACtBkB,EAAOrB,IAAMuB,YACbT,OAAOU,UAAU,4BAA6BH,EAAQT,iBAGvD,QAASa,uBAAsB1B,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBiB,EAAOrB,EAAQqB,KAEff,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5Fa,KAAMf,EAAMA,EAAIE,SAAS,OAAOa,IAEnCZ,SAASC,KAAOJ,EAGjB,QAASqB,wBAAuB3B,GAE/B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdoB,EAAOrB,EAAQqB,KAEff,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFa,KAAMf,EAAMA,EAAIE,SAAS,OAAOa,IAEnCZ,SAASC,KAAOJ"}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<lang>
|
||||
<item name="skip_to_content">
|
||||
<value xml:lang="ko"><![CDATA[본문 건너뛰기]]></value>
|
||||
<value xml:lang="en"><![CDATA[Skip to content]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
@ -1,13 +1,9 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<!--@if($oDocument->isExists())-->
|
||||
<!--#include("read.html")-->
|
||||
<include target="read.html" />
|
||||
<!--@else-->
|
||||
<!--#include("_list.html")-->
|
||||
<include target="_list.html" />
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
{@ Context::loadLang('./modules/board/m.skins/default/lang')}
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="hx h2">
|
||||
<h2><a href="{getUrl('document_srl','','category','','page','')}">{$module_info->browser_title}</a>
|
||||
<!--@if($module_info->use_category == "Y" && $oDocument->get('category_srl'))-->› <a href="{getUrl('document_srl','','category',$oDocument->get('category_srl'))}">{$category_list[$oDocument->get('category_srl')]->title}</a><!--@end--> › {$oDocument->getTitle()}</h2>
|
||||
|
|
@ -62,7 +57,7 @@
|
|||
<em>{htmlspecialchars($val->title)} - {htmlspecialchars($val->blog_name)}</em>
|
||||
<span class="time">{zdate($val->regdate, "Y.m.d")}</span>
|
||||
<!--@if($grant->manager)-->
|
||||
<a href="07_password.html" class="btn de">삭제</a>
|
||||
<a href="07_password.html" class="btn de">{$lang->cmd_delete}</a>
|
||||
<!--@endif-->
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
</description>
|
||||
<version>0.1</version>
|
||||
<date>2010-06-10</date>
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
<name xml:lang="ko">NHN</name>
|
||||
<name xml:lang="en">NHN</name>
|
||||
<name xml:lang="zh-TW">NHN</name>
|
||||
<name xml:lang="tr">NHN</name>
|
||||
<author email_address="developers@xpressengine.com" link="http://www.xpressengine.com/">
|
||||
<name xml:lang="ko">NAVER</name>
|
||||
<name xml:lang="en">NAVER</name>
|
||||
<name xml:lang="zh-TW">NAVER</name>
|
||||
<name xml:lang="tr">NAVER</name>
|
||||
</author>
|
||||
</skin>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/x.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<div class="hx h2">
|
||||
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a></h2>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<!--%import("css/mboard.css")-->
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<h2 class="h2"><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a> › {$lang->category}</h2>
|
||||
<ul class="gn">
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<div class="bd rd">
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd rd">
|
||||
<!--@if($oSourceComment->isExists())-->
|
||||
<div class="origin">{$oSourceComment->getContent(false)}</div>
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<h2 class="ac">{$lang->confirm_delete}</h2>
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, delete_comment)">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<!--%import("js/mboard.js")-->
|
||||
<!--%import("css/mboard.css")-->
|
||||
<load target="js/mboard.js" />
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<h2 class="ac">{$lang->confirm_delete}</h2>
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, delete_document)">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
<!--%import("css/mboard.css")-->
|
||||
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
|
||||
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
|
||||
<load target="css/mboard.css" />
|
||||
|
||||
<div class="bd">
|
||||
<h2 class="h2">{$lang->msg_input_password}</h2>
|
||||
<form action="./" method="POST" onsubmit="return procFilter(this, input_password)" class="requirePassword">
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
|
||||
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
|
||||
//# sourceMappingURL=mboard.min.map
|
||||
1
modules/board/m.skins/simpleGray/js/mboard.min.map
Normal file
1
modules/board/m.skins/simpleGray/js/mboard.min.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAsBC,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBC,EAAcL,EAAQK,YAEtBC,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FH,KAAaC,EAAMA,EAAIE,SAAS,MAAMH,GAAa,YAAYA,GAElEI,SAASC,KAAOJ,EAGjB,QAASK,0BAAyBX,GAEjC,GAKIM,GAHAL,GAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBQ,EAAeZ,EAAQY,YAS1BN,GANGF,EAMGG,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAMnDI,IAAcN,EAAMA,EAAIE,SAAS,WAAWI,IAC/CH,SAASC,KAAOJ,EAGjB,QAASO,iBAAgBC,GAExBC,OAAO,OAAOC,SACdD,OAAO,SAASC,SAChBD,OAAO,QAAQE,MAAMH,EAAQI,MAG9B,QAASC,UAASf,EAAcgB,GAE/B,GAAIC,KAEJA,GAAOC,MAAQF,EACfC,EAAOjB,aAAeA,EACtBiB,EAAOpB,IAAMsB,YACbR,OAAOS,UAAU,4BAA6BH,EAAQR,iBAGvD,QAASY,uBAAsBzB,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBgB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ,EAGjB,QAASoB,wBAAuB1B,GAE/B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdmB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ"}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue