This one isn't actually reachable from the template code, so fixing it is completely optional.Change library/common/form.php (Line 291):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while ($row = mysql_fetch_array($res)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while ($row = mysqli_fetch_array($res)) {
As far as I can tell all the while to foreach conversions are merely cosmetic. I just stumbled upon that strange notation due to similar problems in another project. The while, list, each combo will keep working for arrays, but fails when the variable inside each is actually a traversable object or string. In those cases foreach will properly iterate the items where each will not. If I'm not mistaken all these instances listed here only handle arrays and will continue working unchanged in the future.Change library/common/form.php (Line 10):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($a)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach($a as $key => $value) {
Change library/common/form.php (Line 22):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($in)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach($in as $key => $value) {
Change library/common/form.php (Line 72):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($data)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach($data as $key => $value) {
Change library/common/form.php (Line 144):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($req)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach($req as $key => $value) {
Change library/common/form.php (Line 185):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($form)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach($form as $key => $value) {
Change code/code.playlist.php (Line 26) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $val) = each($temp)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($temp as $key => $val) {
Same procedure in the XML parser:Change library/Common/xml.php (Line 78) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($data)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($data as $key => $value) {
Change library/Common/xml.php (Line 161) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($data)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($data as $key => $value) {
Change library/Common/xml.php (Line 176) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($data)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($data as $key => $value) {
Change library/Common/xml.php (Line 222) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($a)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($a as $key => $value) {
Change library/Common/xml.php (Line 239) from:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $value) = each($data)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($data as $key => $value) {
And one last time while to foreach refactoring.Change code/classes/class.song.php (Line 181):
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
while (list($key, $val) = each($search_words)) {
To:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
foreach ($search_words as $key => $val) {