Explorar el Código

fix replace

tags/2.0.3
0nepeop1e hace 5 años
padre
commit
714d7d6b34
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      src/SenangPayDriver.php

+ 2
- 1
src/SenangPayDriver.php Ver fichero

89
     public function computeHash($payload)
89
     public function computeHash($payload)
90
     {
90
     {
91
         $query = http_build_query($payload);
91
         $query = http_build_query($payload);
92
-        $query = preg_replace('/(^|&)hash=[^&]*($|&)/','$1hash=[HASH]$2', $query);
92
+        $key = preg_quote(http_build_query([$this->keyMap['hash']=>'']), '/');
93
+        $query = preg_replace('/(^|&)'.$key.'[^&]*($|&)/','$1hash=[HASH]$2', $query);
93
         return md5($this->secret_key . '?' . $query);
94
         return md5($this->secret_key . '?' . $query);
94
     }
95
     }
95
 }
96
 }

Loading…
Cancelar
Guardar