X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FBlock.php;h=843ea5448431c0dbd974c034256dc5c4cee66503;hb=72e689e843b839a2eb5d5382301449c69c7e0587;hp=2a04879848cfde155070f120966fd30e60cb7b75;hpb=4a5f646a7fea7cbe0421c5cf38b72bae5c1bcf65;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Block.php b/includes/Block.php index 2a04879848..843ea54484 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -44,40 +44,40 @@ class Block { public $mParentBlockId; /** @var int */ - protected $mId; + private $mId; /** @var bool */ - protected $mFromMaster; + private $mFromMaster; /** @var bool */ - protected $mBlockEmail; + private $mBlockEmail; /** @var bool */ - protected $mDisableUsertalk; + private $mDisableUsertalk; /** @var bool */ - protected $mCreateAccount; + private $mCreateAccount; /** @var User|string */ - protected $target; + private $target; /** @var int Hack for foreign blocking (CentralAuth) */ - protected $forcedTargetID; + private $forcedTargetID; /** @var int Block::TYPE_ constant. Can only be USER, IP or RANGE internally */ - protected $type; + private $type; /** @var User */ - protected $blocker; + private $blocker; /** @var bool */ - protected $isHardblock; + private $isHardblock; /** @var bool */ - protected $isAutoblocking; + private $isAutoblocking; /** @var string|null */ - protected $systemBlockType; + private $systemBlockType; # TYPE constants const TYPE_USER = 1; @@ -958,6 +958,7 @@ class Block { /** * Get the system block type, if any + * @since 1.29 * @return string|null */ public function getSystemBlockType() { @@ -1450,6 +1451,8 @@ class Block { * Set the 'BlockID' cookie to this block's ID and expiry time. The cookie's expiry will be * the same as the block's, to a maximum of 24 hours. * + * @since 1.29 + * * @param WebResponse $response The response on which to set the cookie. */ public function setCookie( WebResponse $response ) { @@ -1472,6 +1475,8 @@ class Block { /** * Unset the 'BlockID' cookie. * + * @since 1.29 + * * @param WebResponse $response The response on which to unset the cookie. */ public static function clearCookie( WebResponse $response ) { @@ -1482,6 +1487,9 @@ class Block { * Get the BlockID cookie's value for this block. This is usually the block ID concatenated * with an HMAC in order to avoid spoofing (T152951), but if wgSecretKey is not set will just * be the block ID. + * + * @since 1.29 + * * @return string The block ID, probably concatenated with "!" and the HMAC. */ public function getCookieValue() { @@ -1493,14 +1501,18 @@ class Block { return $id; } $hmac = MWCryptHash::hmac( $id, $secretKey, false ); - $cookieValue = $id . '!' . $hmac; + $cookieValue = $id . '!' . $hmac; return $cookieValue; } /** * Get the stored ID from the 'BlockID' cookie. The cookie's value is usually a combination of * the ID and a HMAC (see Block::setCookie), but will sometimes only be the ID. + * + * @since 1.29 + * * @param string $cookieValue The string in which to find the ID. + * * @return integer|null The block ID, or null if the HMAC is present and invalid. */ public static function getIdFromCookieValue( $cookieValue ) {