Jump to content

Unused variable in 3.4 -> 4.x-upgrade code


TSP

Recommended Posts

Hi, 

I'm going through the upgrade code for 3.4 -> 4.x. In applications/core/setup/upg_40000/upgrade.php I found what appears to be an unused variable. 

Around line 2410 you have the following code:

<?php
					if( \is_array( $data ) AND $_decoded )
					{
						$newPoll = array();
						
						foreach( $data as $_key => $_data )
						{
							if( isset( $_data['question'] ) )
							{
								$data[ $_key ]['question']	= utf8_encode( $_data['question'] );

								if( \is_array( $_data['choice'] ) )
								{
									foreach( $_data['choice'] as $_idx => $_choice )
									{
										$data[ $_key ]['choice'][ $_idx ]	= utf8_encode( $_choice );
									}
								}
							}
							else
							{
								$newPoll[0]['question']	= $poll['poll_question'];

								$newPoll[0]['choice'][]	= utf8_encode( $_data[1] );
							}
						}
					}

 

You never actually use the $newPoll-variable. 

Link to comment
Share on other sites

@bfarber I figured, I just couldn't keep myself from mentioning it. Maybe we should have a topic to report minor code stuff like this. 

Anyway, I'll soon be upgrading Diskusjon.no from 3.4.9 to 4.4.7. So on a related note I wonder if you're aware of any known issues I should watch out for? 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...