summaryrefslogtreecommitdiffstats
path: root/modules-available/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/sysconfig')
-rw-r--r--modules-available/sysconfig/addconfig.inc.php4
-rw-r--r--modules-available/sysconfig/addmodule.inc.php3
-rw-r--r--modules-available/sysconfig/addmodule_branding.inc.php6
-rw-r--r--modules-available/sysconfig/inc/configmodule.inc.php2
-rw-r--r--modules-available/sysconfig/inc/configtgz.inc.php9
-rw-r--r--modules-available/sysconfig/inc/ppd.inc.php5
6 files changed, 22 insertions, 7 deletions
diff --git a/modules-available/sysconfig/addconfig.inc.php b/modules-available/sysconfig/addconfig.inc.php
index f66bc508..55944cfa 100644
--- a/modules-available/sysconfig/addconfig.inc.php
+++ b/modules-available/sysconfig/addconfig.inc.php
@@ -22,7 +22,6 @@ abstract class AddConfig_Base
/**
*
* @param string $step
- * @return \AddConfig_Base
*/
public static function setStep($step)
{
@@ -186,6 +185,9 @@ class AddConfig_Start extends AddConfig_Base
*/
class AddConfig_Finish extends AddConfig_Base
{
+ /**
+ * @var ConfigTgz
+ */
private $config = false;
protected function preprocessInternal()
diff --git a/modules-available/sysconfig/addmodule.inc.php b/modules-available/sysconfig/addmodule.inc.php
index 30ca1d2c..1f78de81 100644
--- a/modules-available/sysconfig/addmodule.inc.php
+++ b/modules-available/sysconfig/addmodule.inc.php
@@ -21,8 +21,7 @@ abstract class AddModule_Base
/**
*
- * @param type $step
- * @return \AddModule_Base
+ * @param string $step name of class representing the current step
*/
public static function setStep($step)
{
diff --git a/modules-available/sysconfig/addmodule_branding.inc.php b/modules-available/sysconfig/addmodule_branding.inc.php
index c2f9e690..6e628926 100644
--- a/modules-available/sysconfig/addmodule_branding.inc.php
+++ b/modules-available/sysconfig/addmodule_branding.inc.php
@@ -116,8 +116,10 @@ class Branding_ProcessFile extends AddModule_Base
// [wikipedia] Try to be nice and detect links that might give a hint where the svg can be found
if (preg_match_all('#href="([^"]*upload.wikimedia.org/[^"]*/[^"]*/[^"]*\.svg|[^"]+/[^"]+:[^"]+\.svg[^"]*)"#', $content, $out, PREG_PATTERN_ORDER)) {
- if ($title === false && preg_match('#<title>([^<]*)</title>#i', $content, $tout))
+ if ($title === false && preg_match('#<title>([^<]*)</title>#i', $content, $tout)) {
$title = trim(preg_replace('/\W*Wikipedia.*/', '', $tout[1]));
+ }
+ $new = false;
foreach ($out[1] as $res) {
if (strpos($res, 'action=edit') !== false)
continue;
@@ -125,7 +127,7 @@ class Branding_ProcessFile extends AddModule_Base
if ($new !== $url)
break;
}
- if ($new === $url)
+ if ($new === $url || $new === false)
break;
$url = $new;
continue;
diff --git a/modules-available/sysconfig/inc/configmodule.inc.php b/modules-available/sysconfig/inc/configmodule.inc.php
index 54d06afe..cfe79802 100644
--- a/modules-available/sysconfig/inc/configmodule.inc.php
+++ b/modules-available/sysconfig/inc/configmodule.inc.php
@@ -135,7 +135,7 @@ abstract class ConfigModule
* Get module instances from module type.
*
* @param int $moduleType module type to get
- * @return \ConfigModule[] The requested modules from DB, or false on error
+ * @return \ConfigModule[]|false The requested modules from DB, or false on error
*/
public static function getAll($moduleType = false)
{
diff --git a/modules-available/sysconfig/inc/configtgz.inc.php b/modules-available/sysconfig/inc/configtgz.inc.php
index dbf1bc99..09ea999c 100644
--- a/modules-available/sysconfig/inc/configtgz.inc.php
+++ b/modules-available/sysconfig/inc/configtgz.inc.php
@@ -232,6 +232,11 @@ class ConfigTgz
self::recompress([], SysConfig::GLOBAL_MINIMAL_CONFIG);
}
+ /**
+ * @param string $title Title of config
+ * @param int[] $moduleIds Modules to include in config
+ * @return false|ConfigTgz The module instance, false on error
+ */
public static function insert($title, $moduleIds)
{
if (!is_array($moduleIds))
@@ -287,6 +292,10 @@ class ConfigTgz
return $instance;
}
+ /**
+ * @param int $moduleId ID of config module
+ * @return ConfigTgz[]|false
+ */
public static function getAllForModule($moduleId)
{
$res = Database::simpleQuery("SELECT configid, title, filepath FROM configtgz_x_module "
diff --git a/modules-available/sysconfig/inc/ppd.inc.php b/modules-available/sysconfig/inc/ppd.inc.php
index aa2e0e5a..5ccdbd53 100644
--- a/modules-available/sysconfig/inc/ppd.inc.php
+++ b/modules-available/sysconfig/inc/ppd.inc.php
@@ -413,6 +413,8 @@ class Ppd
// StringValue
$value = $vMatch[1];
$valueTranslation = isset($vMatch[2]) ? $this->unhexTranslation($no, substr($vMatch[2], 1)) : $value;
+ } else {
+ $valueTranslation = $value;
}
// Key-value-pair parsed, now the fun part
// Special cases for openening closing certain groups
@@ -691,6 +693,7 @@ class Ppd
$chars = array_reduce(array_unique($array), function ($carry, $item) {
return $carry . '\x' . dechex(ord($item));
}, '');
+ return $chars;
}
private function unhexTranslation($lineNo, $translation)
@@ -703,7 +706,7 @@ class Ppd
}
$string = preg_replace('/[^a-fA-F0-9]/', '', $match[0]);
if (strlen($string) % 2 !== 0) {
- $this->warn('Odd number of hex digits in hex substring');
+ $this->warn($lineNo, 'Odd number of hex digits in hex substring');
$string = substr($string, 0, -1);
}
return pack('H*', $string);