Browse Source

nulls

master
Sergio Álvarez 5 months ago
parent
commit
67859df486
  1. 2
      public/index.php
  2. 10
      src/preg.php

2
public/index.php

@ -20,7 +20,7 @@ try {
$post = json_decode(file_get_contents("php://input"), true);
$redis = new Predis\Client(getenv('REDIS_URL'));
if ($post['hash']) {
if ($post['hash'] ?? false) {
$key = mb_substr($post['hash'], 1, 10);
$state = $redis->hGetAll("xrg.es:". $key);
$redis->expire("xrg.es:". $key, 60*60*24*7); // touch

10
src/preg.php

@ -22,14 +22,14 @@ class Preg
$this->raw = $params;
$this->method = $params["method"];
$this->pattern = $params["pattern"];
$this->replacement = $params["replacement"];
$this->subject = $params["subject"];
$this->offset = mb_strlen($params["offset"])? (int)$params["offset"]: 0;
$this->limit = mb_strlen($params["limit"])? (int)$params["limit"]: -1;
$this->delimeter = mb_strlen($params["delimeter"])? $params["delimeter"]: null;
$this->offset = mb_strlen($params["offset"] ?? '')? (int)$params["offset"]: 0;
$this->limit = mb_strlen($params["limit"] ?? '')? (int)$params["limit"]: -1;
$this->delimeter = mb_strlen($params["delimeter"] ?? '')? $params["delimeter"]: null;
$this->flags = 0;
$this->flags_str = [];

Loading…
Cancel
Save