diff --git a/addons/oembed/jquery.oembed.js b/addons/oembed/jquery.oembed.js index 06ffa2494..41f9d4509 100755 --- a/addons/oembed/jquery.oembed.js +++ b/addons/oembed/jquery.oembed.js @@ -261,7 +261,7 @@ success: function (data) { var oembedData = $.extend({}, data); oembedData.code = embedProvider.templateData(data); - success(oembedData, externalUrl, container); + if(oembedData.code) success(oembedData, externalUrl, container); }, error: settings.onError.call(container, externalUrl, embedProvider) }, settings.ajaxOptions || {}); @@ -389,8 +389,8 @@ $.fn.oembed.getGenericCode = function (url, oembedData) { var title = (oembedData.title !== null) ? oembedData.title : url, - code = '' + title + ''; - if(oembedData.html) code += "
' + title + ''; return code; }; @@ -849,7 +849,7 @@ templateData: function (data) { if(!data.parse) return false; var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki'); - return '
' + jQuery(oembedData.html).text().substring(0,200) + '... more
' + data.parse['displaytitle'] + '
' +jQuery(text).text().substring(0,200) + '...
Rating: "+a.imdbRating+"
Genre: "+a.Genre+"
Starring: "+a.Actors+'
'+c+"'),d},a.fn.oembed.getOEmbedProvider=function(b){for(var c=0;c
"+jQuery(b.html).text().substring(0,200)+'... more
'+a.parse.displaytitle+"
"+jQuery(b).text().substring(0,200)+"...
Rating: "+a.imdbRating+"
Genre: "+a.Genre+"
Starring: "+a.Actors+'
' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '
'; } diff --git a/classes/httprequest/XEHttpRequest.class.php b/classes/httprequest/XEHttpRequest.class.php index 02ed6b8a3..538956561 100644 --- a/classes/httprequest/XEHttpRequest.class.php +++ b/classes/httprequest/XEHttpRequest.class.php @@ -163,7 +163,7 @@ class XEHttpRequest $chunk_size = hexdec(fgets($sock)); if($chunk_size) { - $body .= fread($sock, $chunk_size); + $body .= fgets($sock, $chunk_size+1); } } else diff --git a/common/css/xe.css b/common/css/xe.css index c8c330fa6..cdddb3605 100644 --- a/common/css/xe.css +++ b/common/css/xe.css @@ -45,6 +45,10 @@ a img { } } +.xe-widget-wrapper { + overflow: hidden; +} + /* Popup Menu Area */ #popup_menu_area { position: absolute; diff --git a/config/config.inc.php b/config/config.inc.php index fc4bcaeba..51f01d863 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -29,7 +29,7 @@ define('__ZBXE__', __XE__); /** * Display XE's full version. */ -define('__XE_VERSION__', '1.7.4'); +define('__XE_VERSION__', '1.7.5-beta1'); /** * @deprecated __ZBXE_VERSION__ will be removed. Use __XE_VERSION__ instead. diff --git a/config/func.inc.php b/config/func.inc.php index a2c4c4d07..6de5b1df7 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -776,7 +776,7 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu } $type = FirePHP::INFO; - $label = sprintf('[%s:%d] %s() (m:%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage())); + $label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage())); // Check a FirePHP option if($display_option === 'TABLE') diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php index d0c69a80d..1c863da8a 100644 --- a/modules/admin/admin.admin.model.php +++ b/modules/admin/admin.admin.model.php @@ -95,6 +95,81 @@ class adminAdminModel extends admin } } + function getFTPPath() + { + $ftp_info = Context::getRequestVars(); + + if(!$ftp_info->ftp_host) + { + $ftp_info->ftp_host = "127.0.0.1"; + } + + if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) + { + $ftp_info->ftp_port = '22'; + } + + $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port); + if(!$connection) + { + return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); + } + + $login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password); + if(!$login_result) + { + ftp_close($connection); + return new Object(-1, 'msg_ftp_invalid_auth_info'); + } + + // create temp file + $pin = $_SERVER['REQUEST_TIME']; + FileHandler::writeFile('./files/cache/ftp_check', $pin); + + // create path candidate + $xe_path = _XE_PATH_; + $path_info = array_reverse(explode('/', _XE_PATH_)); + array_pop($path_info); // remove last '/' + $path_candidate = array(); + + $temp = ''; + foreach($path_info as $path) + { + $temp = '/' . $path . $temp; + $path_candidate[] = $temp; + } + + // try + foreach($path_candidate as $path) + { + // upload check file + if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) + { + continue; + } + + // get check file + $result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html'); + + // delete temp check file + ftp_delete($connection, $path . 'ftp_check.html'); + + // found + if($result == $pin) + { + $found_path = $path; + break; + } + } + + FileHandler::removeFile('./files/cache/ftp_check', $pin); + + if($found_path) + { + $this->add('found_path', $found_path); + } + } + /** * Find XE installed path on ftp */ @@ -130,6 +205,15 @@ class adminAdminModel extends admin return $this->getSFTPPath(); } + if($ftp_info->ftp_pasv == 'N') + { + if(function_exists('ftp_connect')) + { + return $this->getFTPPath(); + } + $ftp_info->ftp_pasv = "Y"; + } + $oFTP = new ftp(); if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) { diff --git a/modules/board/conf/info.xml b/modules/board/conf/info.xml index 36eb8d8cd..ecc2e53a2 100644 --- a/modules/board/conf/info.xml +++ b/modules/board/conf/info.xml @@ -18,8 +18,8 @@