This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* This sometimes fixes the error "A valid URL was not provided." wen connecting to self | |
* hosted CRMs like Mautic, FluentCRM, or FunnelKit. | |
* | |
* @param array $args HTTP request arguments. | |
* @param string $url The request URL. | |
* @return array HTTP request arguments. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
def decode_struct(data): | |
ret = [] | |
i = 0 | |
while i < len(data): | |
tag = data[i:i+4].decode('ascii') | |
length = struct.unpack('>I', data[i+4:i+8])[0] | |
value = data[i+8:i+8+length] | |
value = decode(value, tag=tag) |