From 2a874225213420dd309b4fc2e8b52daad357f799 Mon Sep 17 00:00:00 2001 From: Denys N Date: Tue, 20 Mar 2018 23:46:43 +0200 Subject: [PATCH] Update to 6.5.10 --- build.xml | 4 +-- packages/mod_junewsultra/fields/template.php | 18 +++++------ packages/mod_junewsultra/fields/uploadimg.php | 2 +- packages/mod_junewsultra/helper.php | 4 +-- .../mod_junewsultra/helper/com_content.php | 4 +-- packages/mod_junewsultra/lib/julib.php | 4 ++- packages/mod_junewsultra/mod_junewsultra.php | 7 ++--- script.php | 31 ++++--------------- 8 files changed, 26 insertions(+), 48 deletions(-) diff --git a/build.xml b/build.xml index ff73a17..fa48f45 100644 --- a/build.xml +++ b/build.xml @@ -1,12 +1,12 @@ - + - + diff --git a/packages/mod_junewsultra/fields/template.php b/packages/mod_junewsultra/fields/template.php index dda0bb0..ddd0576 100644 --- a/packages/mod_junewsultra/fields/template.php +++ b/packages/mod_junewsultra/fields/template.php @@ -28,7 +28,7 @@ class JFormFieldTemplate extends JFormField */ protected function getInput() { - if (!isset($_GET[ 'id' ])) + if(!isset($_GET[ 'id' ])) { return JText::_('MOD_JUNEWS_NOT_EDIT_TEMPLATE'); } @@ -43,15 +43,15 @@ protected function getInput() ); $rows = $db->loadResult(); - if (preg_match('#"template":"_:(.*?)"#is', $rows, $ok)) + if(preg_match('#"template":"_:(.*?)"#is', $rows, $ok)) { - if ($ok[1] == 1) + if($ok[ 1 ] == 1) { $tmpl = 'default'; } else { - $tmpl = $ok[1]; + $tmpl = $ok[ 1 ]; } } else @@ -62,21 +62,21 @@ protected function getInput() $html = array(); $link = str_replace('/administrator', '', JURI::base()) . 'modules/mod_junewsultra/fields/edittemplate.php?file=' . $tmpl . '.php'; - if ($error = $db->getErrorMsg()) + if($error = $db->getErrorMsg()) { JFactory::getApplication()->enqueueMessage($error, 'error'); } - if ($_GET[ 'id' ]) + if($_GET[ 'id' ]) { - $html[] = ' ' . JText::_('MOD_JUNEWS_TEMPLATE_BUTTON') . ''; + $html[] = ' ' . JText::_('MOD_JUNEWS_TEMPLATE_BUTTON') . ''; } else { $html[] = JText::_('MOD_JUNEWS_NOT_EDIT_TEMPLATE'); } - if (0 == (int) $this->value) + if(0 == (int) $this->value) { $value = ''; } @@ -86,7 +86,7 @@ protected function getInput() } $class = ''; - if ($this->required) + if($this->required) { $class = ' class="required modal-value"'; } diff --git a/packages/mod_junewsultra/fields/uploadimg.php b/packages/mod_junewsultra/fields/uploadimg.php index ec122a2..b3705ac 100644 --- a/packages/mod_junewsultra/fields/uploadimg.php +++ b/packages/mod_junewsultra/fields/uploadimg.php @@ -131,7 +131,7 @@ function alert($text, $error) } else { - $size = GetImageSize($filename); + $size = getimagesize($filename); if ($size && ($size[ 0] < $max_image_width) && ($size[ 1] < $max_image_height)) { if (@move_uploaded_file($filename, $path . '/jn_' . $_FILES['userfile']['name'])) diff --git a/packages/mod_junewsultra/helper.php b/packages/mod_junewsultra/helper.php index 699f574..5bab105 100644 --- a/packages/mod_junewsultra/helper.php +++ b/packages/mod_junewsultra/helper.php @@ -31,8 +31,6 @@ abstract class modJUNewsUltraHelper */ public static function getList($params, $junews) { - $items = 'ROOT'; - - return $items; + return 'ROOT'; } } \ No newline at end of file diff --git a/packages/mod_junewsultra/helper/com_content.php b/packages/mod_junewsultra/helper/com_content.php index e80829f..406aef9 100644 --- a/packages/mod_junewsultra/helper/com_content.php +++ b/packages/mod_junewsultra/helper/com_content.php @@ -154,7 +154,7 @@ public static function getList($params, $junews) { if((int) $curr) { - $cat_arr[ $key ] = intval($curr); + $cat_arr[ $key ] = (int) $curr; } } } @@ -164,7 +164,7 @@ public static function getList($params, $junews) if((int) $catid) { - $cat_arr[] = intval($catid); + $cat_arr[] = (int) $catid; } } diff --git a/packages/mod_junewsultra/lib/julib.php b/packages/mod_junewsultra/lib/julib.php index 490d1cf..2d59177 100644 --- a/packages/mod_junewsultra/lib/julib.php +++ b/packages/mod_junewsultra/lib/julib.php @@ -221,7 +221,7 @@ public static function ParceXML($feed_url, $xmlcount, $cache_file, $time, $path, if(file_exists($cache_file) && $timedif < $time) { - $string = file_get_contents(JURI::root() . $cache_file); + $string = @file_get_contents(JURI::root() . $cache_file); $error = 0; } else @@ -323,6 +323,8 @@ public static function video($url) } else { + $feature = ''; + parse_str($urls['query'], $output); $yid = $output['v']; if(!empty($feature)) diff --git a/packages/mod_junewsultra/mod_junewsultra.php b/packages/mod_junewsultra/mod_junewsultra.php index d6153d6..ca7eb07 100644 --- a/packages/mod_junewsultra/mod_junewsultra.php +++ b/packages/mod_junewsultra/mod_junewsultra.php @@ -94,12 +94,9 @@ $object = new $component; $list = $object->getList($params, $junews); -if($params->get('empty_mod', 0) == 0) +if($params->get('empty_mod', 0) == 0 && count($list) == 0) { - if(count($list) == 0) - { - return; - } + return; } $layoutpath = JModuleHelper::getLayoutPath('mod_junewsultra', $params->def('template')); diff --git a/script.php b/script.php index 2cbf1d1..8e8c1cf 100644 --- a/script.php +++ b/script.php @@ -17,8 +17,6 @@ */ class Pkg_JUNewsUltraInstallerScript { - protected $dbSupport = array('mysql', 'mysqli', 'postgresql', 'sqlsrv', 'sqlazure'); - protected $message; protected $status; @@ -42,13 +40,6 @@ public function preflight($type, $parent) return false; } - if(!in_array(JFactory::getDbo()->name, $this->dbSupport, true)) - { - JFactory::getApplication()->enqueueMessage(JText::_('MOD_JUNEWS_ERROR_DB_SUPPORT'), 'error'); - - return false; - } - $this->MakeDirectory($dir = JPATH_SITE . '/img', $mode = 0777); if(!is_dir(JPATH_SITE . '/img/')) @@ -188,8 +179,7 @@ public function postflight($type, $parent, $results) $html .= $extension; } - $html .= ' - '; + $html .= ''; if($result['result'] == true) { @@ -200,8 +190,7 @@ public function postflight($type, $parent, $results) $html .= '' . JText::_('MOD_JUNEWS_NOT_INSTALLED') . ''; } - $html .= ' - '; + $html .= ''; if($enabled[$extension] == 1) { @@ -287,8 +276,7 @@ public function postflight($type, $parent, $results) if(($i + $j) > 0) { - $html .= '

' . JText::_('MOD_JUNEWS_REMOVE_OLD_FILES') . '

- '; + $html .= '

' . JText::_('MOD_JUNEWS_REMOVE_OLD_FILES') . '

'; foreach ($files AS $file) { @@ -297,10 +285,7 @@ public function postflight($type, $parent, $results) $filepath = str_replace($path, '', $file); unlink($file); - $html .= ' - - - '; + $html .= ''; } } @@ -311,18 +296,14 @@ public function postflight($type, $parent, $results) $folderpath = str_replace($path, '', $folder); $this->unlinkRecursive($folder, 1); - $html .= ' - - - '; + $html .= ''; } } $html .= '
File: ' . $filepath . 'Delete
File: ' . $filepath . 'Delete
Folder: ' . $folderpath . 'Delete
Folder: ' . $folderpath . 'Delete
'; } - $html .= ' - '; + $html .= ''; if($joomla < '3.4') {