Merge remote branch 'origin/core-1.1.0' into core
[platal.git] / plugins / modifier.sex.php
index 3644564..5d33c0b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,6 +23,8 @@ function smarty_modifier_sex($male, $female, $sex = null)
 {
     if (is_null($sex)) {
         $sex = S::user()->isFemale();
+    } else if ($sex instanceof PlUser || $sex instanceof Profile) {
+        $sex = $sex->isFemale();
     }
     return $sex ? $female : $male;
 }