mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:55:13 +00:00
38 lines
1,010 B
PHP
38 lines
1,010 B
PHP
<?php
|
|
|
|
namespace Code\Update;
|
|
|
|
class _1223
|
|
{
|
|
|
|
public function run()
|
|
{
|
|
foreach (['abconfig', 'config', 'pconfig', 'xconfig', 'iconfig'] as $tbl) {
|
|
while (1) {
|
|
$r = q(
|
|
"select id, v from %s where v like '%s' limit 100 ",
|
|
dbesc($tbl),
|
|
dbesc('a:%')
|
|
);
|
|
if (!$r) {
|
|
break;
|
|
}
|
|
foreach ($r as $rv) {
|
|
$s = unserialize($rv['v']);
|
|
if ($s && is_array($s)) {
|
|
$s = serialise($s);
|
|
} else {
|
|
$s = $rv['v'];
|
|
}
|
|
q(
|
|
"update %s set v = '%s' where id = %d",
|
|
dbesc($tbl),
|
|
dbesc($s),
|
|
dbesc($rv['id'])
|
|
);
|
|
}
|
|
}
|
|
}
|
|
return UPDATE_SUCCESS;
|
|
}
|
|
}
|