ok, so i have a few domains with similar domain names, and i wasted hours trying to figure out why i couldn't see the installation screen for a new domain, instead just seeing lots of timeouts.
so, i traced it all through, and upon assigning a new prefix, we see this code to generate a new one:
do-prefix.php
while ($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM wphive_hosts WHERE prefix = %s", $prefix)) > 0) {
$i = ($i == false) ? 0 : $i + 1;
$prefix = substr($prefix, 0, 2) . $i . "_";
}
The problem is specifically here:
$i = ($i == false) ? 0 : $i + 1;
on the first run, i is set to 0, so on the second loop i is set to...0 again as false == 0.
so, an additional = sign needs to be added to prevent the loop:
$i = ($i === false) ? 0 : $i + 1;
thanks
