Created
August 12, 2021 15:04
-
-
Save codename065/66fed509a2b898d4bcddcb12081d9023 to your computer and use it in GitHub Desktop.
This file contains 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 | |
global $wpdb; | |
$files = $wpdb->get_var("select meta_value from {$wpdb->prefix}postmeta where meta_key = '__wpdm_files' and post_id = '{$package['ID']}'"); | |
preg_match_all("/i\:([0-9]+)/", $files, $matches); | |
$find = $matches[0]; | |
$replace = []; | |
foreach($matches[1] as $index) { | |
$replace[] = "s:".strlen($index).':"'.$index.'"'; | |
} | |
$files = str_replace($find, $replace, $files); | |
$files = $package['files'] = unserialize($files); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment