From d6363ba9dd38e98c8f2d48085677c4bafdfdc7cd Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Thu, 27 Sep 2012 04:46:29 -0400
Subject: [PATCH] Fixed: Added missing idn converts to mail functions Added: Changed idn function to support multi-line fields (like mail forward)
---
interface/lib/classes/aps_crawler.inc.php | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/interface/lib/classes/aps_crawler.inc.php b/interface/lib/classes/aps_crawler.inc.php
index 640bb34..99e675f 100644
--- a/interface/lib/classes/aps_crawler.inc.php
+++ b/interface/lib/classes/aps_crawler.inc.php
@@ -34,6 +34,9 @@
class ApsCrawler extends ApsBase
{
+
+ public $app_download_url_list = array();
+
/**
* Constructor
*
@@ -58,7 +61,7 @@
// Check if the cURL module is available
if(!function_exists('curl_version')) throw new Exception('cURL is not available');
- // Check if used folders are writable (chmod 777)
+ // Check if used folders are writable
if($this->interface_mode)
{
if(!is_writable($this->interface_pkg_dir))
@@ -197,7 +200,7 @@
* A method to build query URLs out of a list of vendors
*
*/
- private function formatVendorCallback(&$array_item, $key)
+ private function formatVendorCallback($array_item, $key)
{
$array_item = str_replace(' ', '%20', $array_item);
$array_item = str_replace('http://', '', $array_item);
@@ -271,7 +274,7 @@
// Find out a (possibly) existing package version
$ex_ver = '';
array_walk($existing_apps,
- create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), &$ex_ver);
+ create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), $ex_ver);
$new_ver = $app_version.'-'.$app_release;
$local_intf_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$new_ver.'.app.zip/';
@@ -290,6 +293,8 @@
$app_dl = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@href");
$app_filesize = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@length");
$app_metafile = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='meta']/@href");
+
+ $this->app_download_url_list[$app_name.'-'.$new_ver.'.app.zip'] = $app_dl;
// Skip ASP.net packages because they can't be used at all
$asp_handler = parent::getXPathValue($sxe, '//aspnet:handler');
@@ -476,12 +481,13 @@
$path_query = $this->db->queryAllRecords('SELECT path AS Path FROM aps_packages;');
foreach($path_query as $path) $existing_packages[] = $path['Path'];
$diff = array_diff($existing_packages, $pkg_list);
- foreach($diff as $todelete)
+ foreach($diff as $todelete) {
/*$this->db->query("UPDATE aps_packages SET package_status = '".PACKAGE_ERROR_NOMETA."'
WHERE path = '".$this->db->quote($todelete)."';");*/
$tmp = $this->db->queryOneRecord("SELECT id FROM aps_packages WHERE path = '".$this->db->quote($todelete)."';");
$this->db->datalogUpdate('aps_packages', "package_status = ".PACKAGE_ERROR_NOMETA, 'id', $tmp['id']);
unset($tmp);
+ }
// Register all new packages
$new_packages = array_diff($pkg_list, $existing_packages);
@@ -515,12 +521,12 @@
".$this->db->quote($pkg_release).", ".PACKAGE_ENABLED.");");
*/
- $insert_data = "(`path`, `name`, `category`, `version`, `release`, `package_status`) VALUES
+ $insert_data = "(`path`, `name`, `category`, `version`, `release`, `package_url`, `package_status`) VALUES
('".$this->db->quote($pkg)."', '".$this->db->quote($pkg_name)."',
'".$this->db->quote($pkg_category)."', '".$this->db->quote($pkg_version)."',
- ".$this->db->quote($pkg_release).", ".PACKAGE_ENABLED.");";
+ ".$this->db->quote($pkg_release).", '".$this->db->quote($this->app_download_url_list[$pkg])."', ".PACKAGE_ENABLED.");";
- $app->db->datalogInsert('aps_packages', $insert_data, 'id');
+ $this->app->db->datalogInsert('aps_packages', $insert_data, 'id');
}
}
catch(Exception $e)
--
Gitblit v1.9.1