Permalink
Browse files

cast max_age value as positive integer before passing to setter

  • Loading branch information...
1 parent a316949 commit bf52041bb47289d8922b1ec7c73104d14562c45e @niallkennedy niallkennedy committed Nov 14, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 social-plugins/class-facebook-recommendations-bar.php
@@ -298,7 +298,7 @@ public function toHTMLDataArray() {
if ( isset( $this->num_recommendations ) && $this->num_recommendations != 2 ) // default: 2
$data['num-recommendations'] = strval( $this->num_recommendations );
- if ( isset( $this->max_age ) && $this->max_age !== 0 ) // default: 0 (no limit)
+ if ( isset( $this->max_age ) && $this->max_age != 0 ) // default: 0 (no limit)
$data['max-age'] = $this->max_age;
if ( isset( $this->ref ) )
@@ -352,7 +352,7 @@ public static function fromArray( $values ) {
$bar->setNumRecommendations( absint( $values['num_recommendations'] ) );
if ( isset( $values['max_age'] ) )
- $bar->setMaxAge( $values['max_age'] );
+ $bar->setMaxAge( absint( $values['max_age'] ) );
return $bar;
}

0 comments on commit bf52041

Please sign in to comment.