Permalink
Browse files

Fixing undeclared variables

Undeclared variables $rating['rate'], $reviewrating['rate'], and $reviewonoff['onoff']
  • Loading branch information...
1 parent 9d7ec06 commit d4e18904329faabb84f6c47a7011a261c973b6bf @semplon semplon committed Jan 23, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 itemprop_review.php
View
@@ -63,9 +63,12 @@ public function review($content){
$pricerows='';
$reviewratingrow='';
- $itemrating = $reviewrating['rate'];
-
- if($reviewonoff['onoff']=="on"){
+ if(isset($reviewrating['rate'])){
+ $itemrating = $reviewrating['rate'];
+ }else{
+ $itemrating = 0;
+ }
+ if(isset($reviewonoff['onoff'])=="on"){
if(!$reviewname){$reviewname = $reviewpost->post_title;}
if($reviewprice && $reviewcurrency){
$pricerows = '<span itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="price" content="'.$reviewprice.'"><meta itemprop="priceCurrency" content="'.$reviewcurrency.'"><link itemprop="availability" href="http://schema.org/InStock"></span>';
@@ -158,6 +161,9 @@ function ipwp_cpbox( $post ) {
echo '<tr><th scope="row"><div class="'.$ipwprprefix.'postcbox-label">';
echo '<label for="'.$ipwprprefix.'rating">'.__("Rating of item","itempropwp" ).'</label> ';
echo '</div></th>';
+ if(!isset($rating['rate'])){
+ $rating['rate'] = 0;
+ }
echo '<td><div class="'.$ipwprprefix.'postcbox-input">
<select name="'.$ipwprprefix.'rating[rate]" id="'.$ipwprprefix.'reviewonoff">
<option value="0" '.selected($rating['rate'], "0", false).'>0.0</option>

0 comments on commit d4e1890

Please sign in to comment.