Pārlūkot izejas kodu

allow content keys to hold more than one value, which will transform the value into an array

master
Dom SP pirms 2 gadiem
vecāks
revīzija
5091344d87
1 mainītis faili ar 13 papildinājumiem un 2 dzēšanām
  1. +13
    -2
      app/modules/filesinfolders.php

+ 13
- 2
app/modules/filesinfolders.php Parādīt failu

@@ -299,7 +299,8 @@ class FilesInFolders {
function get_config_from_content($string) {
$f3 = \Base::instance();
$f = 0;

$tmp = null;
$pattern = "/#\+(\w+):\s?(.*)/";
$f = preg_match_all($pattern, $string,$matches,PREG_PATTERN_ORDER);
for ($i=0;$i<$f;$i++) {
@@ -323,7 +324,17 @@ class FilesInFolders {
$this->config[$key]=$value;
}
} else {
$this->config[$key]=$value;
if (array_key_exists($key, $this->config)) {
if (is_array($this->config[$key])) {
$this->config[$key][]=$value;
} else {
$tmp = $this->config[$key];
$this->config[$key] = [$tmp,$value];
$tmp=null;
}
} else {
$this->config[$key]=$value;
}
}
}


Notiek ielāde…
Atcelt
Saglabāt