Example #1
0
function multi_implode($array, $glue)
{
    $ret = '';
    foreach ($array as $item) {
        if (is_array($item)) {
            $ret .= multi_implode($item, $glue) . $glue;
        } else {
            $ret .= $item . $glue;
        }
    }
    $ret = substr($ret, 0, 0 - strlen($glue));
    return $ret;
}
Example #2
0
function multi_implode($array, $glue, $excludeFilelist)
{
    $ret = '';
    foreach ($array as $postval) {
        if (is_array($postval)) {
            $ret = multi_implode($postval, '');
        } else {
            $ret = $postval;
        }
        //end else
        if (!in_array(basename($_SERVER['PHP_SELF']), $excludeFilelist)) {
            if (stripos($ret, "SELECT") !== false || strpos($ret, "UNION") !== false) {
                header('location:index.php');
                exit;
            }
            //end if
        }
    }
    //end foreach
    //$ret = substr($ret, 0, 0-strlen($glue));
}
Example #3
0
 public function findOrCreateQuery($data)
 {
     $id = $this->queryRepository->findOrCreate($data, ['query'], $created);
     if ($created) {
         foreach ($data['arguments'] as $argument => $value) {
             if (is_array($value)) {
                 $value = multi_implode(',', $value);
             }
             $this->queryArgumentRepository->create(['query_id' => $id, 'argument' => $argument, 'value' => $value]);
         }
     }
     return $id;
 }
Example #4
0
             // One-time only cron.
             $period = __('one time only', 'it-l10n-backupbuddy');
         }
         // Determine interval.
         if (!empty($item['interval'])) {
             $interval = $item['interval'] . ' seconds';
         } else {
             $interval = __('one time only', 'it-l10n-backupbuddy');
         }
         // Determine arguments.
         if (!empty($item['args'])) {
             //$arguments = implode( ',', $item['args'] );
             $arguments = '';
             foreach ($item['args'] as $arg) {
                 if (is_array($arg)) {
                     $arguments .= '[' . multi_implode($arg, '; ') . ']';
                 } else {
                     $arguments .= $arg;
                 }
             }
         } else {
             $arguments = __('none', 'it-l10n-backupbuddy');
         }
         // Populate crons array for displaying later.
         $crons[$time . '|' . $hook_name . '|' . $item_name] = array('<span title=\'Key: ' . $item_name . '\'>' . $hook_name . '</span>', '<span title="Timestamp: ' . $time . '">' . pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($time)) . '</span>', $period, $interval, $arguments);
     }
     // End foreach.
     unset($item);
     unset($item_name);
 }
 // End foreach.
function multi_implode($glue, $array)
{
    $ret = '';
    if (is_array($array)) {
        foreach ($array as $key => $item) {
            if (is_array($item)) {
                $ret .= multi_implode($item, $glue) . $glue;
            } else {
                $ret .= $key . ' => ' . $item . $glue;
            }
        }
        $ret = substr($ret, 0, 0 - strlen($glue));
        return $ret;
    } else {
        return $array;
    }
}