diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index bd0a78dd28..ba439ca240 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4219,10 +4219,10 @@ ul.exercise-draggable-answer .touch-items:hover{ background-color: #ffffff; text-align: center; vertical-align: middle; - border-top: #dddddd; + border-top: 1px solid #dddddd; border-left: 1px solid #dddddd; border-right: 1px solid #dddddd; - border-bottom: none !important; + border-bottom: 1px solid #dddddd; } .drag_question .text-right{ text-align: left; @@ -4231,20 +4231,17 @@ ul.exercise-draggable-answer .touch-items:hover{ display: inline-block; position: relative; overflow: hidden; - height: 28px; + height: 35px; width: 60px; text-align: center; border: 1px solid; - border-color: white #f7f7f7 #f5f5f5; border-radius: 3px; - background: #444; - border-color: #111 #0a0a0a black; - background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.4)); - background-image: -moz-linear-gradient(top, transparent, rgba(0, 0, 0, 0.4)); - background-image: -o-linear-gradient(top, transparent, rgba(0, 0, 0, 0.4)); - background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4)); - -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.2); + background: transparent; + border-color: #ECF0F1; + background-image: -webkit-linear-gradient(top, transparent, rgba(236, 240, 241, 1)); + background-image: -moz-linear-gradient(top, transparent, rgba(236, 240, 241, 1)); + background-image: -o-linear-gradient(top, transparent, rgba(236, 240, 241, 1)); + background-image: linear-gradient(to bottom, transparent, rgba(236, 240, 241, 1)); } .drag_question .select-matching:before, .drag_question .select-matching:after { content: ''; @@ -4255,7 +4252,7 @@ ul.exercise-draggable-answer .touch-items:hover{ width: 0; height: 0; border: 4px dashed; - border-color: #888 transparent; + border-color: #666 transparent; pointer-events: none; } .drag_question .select-matching:before { @@ -4273,31 +4270,31 @@ ul.exercise-draggable-answer .touch-items:hover{ position: relative; width: 130%; margin: 0; - padding: 6px 8px 6px 10px; + padding: 5px; height: 28px; line-height: 14px; - font-size: 14px; - color: #ffffff; + font-size: 12px; + color: #666; text-shadow: 0 1px white; /* Fallback for IE 8 */ background: #f2f2f2; /* "transparent" doesn't work with Opera */ - background: rgba(0, 0, 0, 0) !important; + background: none !important; border: 0; border-radius: 0; -webkit-appearance: none; } .drag_question .select-matching select > option{ margin: 3px; - padding: 6px 8px; + padding: 5px; text-shadow: none; - background: #444; - border-radius: 3px; + background: none; + border-radius: 0px; cursor: pointer; - color: #ffffff; + color: #666; } .drag_question .window{ - border:1px solid #dddddd; + border:none; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; diff --git a/app/bootstrap.php.cache b/app/bootstrap.php.cache index ae5ff197bb..72707d8d02 100644 --- a/app/bootstrap.php.cache +++ b/app/bootstrap.php.cache @@ -412,6 +412,7 @@ return $headers; } namespace Symfony\Component\HttpFoundation { +use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; use Symfony\Component\HttpFoundation\Session\SessionInterface; class Request { @@ -764,30 +765,27 @@ $ip = $this->server->get('REMOTE_ADDR'); if (!$this->isFromTrustedProxy()) { return array($ip); } -if (self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) { +$hasTrustedForwardedHeader = self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED]); +$hasTrustedClientIpHeader = self::$trustedHeaders[self::HEADER_CLIENT_IP] && $this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP]); +if ($hasTrustedForwardedHeader) { $forwardedHeader = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]); preg_match_all('{(for)=("?\[?)([a-z0-9\.:_\-/]*)}', $forwardedHeader, $matches); -$clientIps = $matches[3]; -} elseif (self::$trustedHeaders[self::HEADER_CLIENT_IP] && $this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) { -$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); +$forwardedClientIps = $matches[3]; +$forwardedClientIps = $this->normalizeAndFilterClientIps($forwardedClientIps, $ip); +$clientIps = $forwardedClientIps; } -$clientIps[] = $ip; $firstTrustedIp = null; -foreach ($clientIps as $key => $clientIp) { -if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { -$clientIps[$key] = $clientIp = $match[1]; -} -if (!filter_var($clientIp, FILTER_VALIDATE_IP)) { -unset($clientIps[$key]); -continue; -} -if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { -unset($clientIps[$key]); -if (null === $firstTrustedIp) { -$firstTrustedIp = $clientIp; +if ($hasTrustedClientIpHeader) { +$xForwardedForClientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); +$xForwardedForClientIps = $this->normalizeAndFilterClientIps($xForwardedForClientIps, $ip); +$clientIps = $xForwardedForClientIps; } +if ($hasTrustedForwardedHeader && $hasTrustedClientIpHeader && $forwardedClientIps !== $xForwardedForClientIps) { +throw new ConflictingHeadersException('The request has both a trusted Forwarded header and a trusted Client IP header, conflicting with each other with regards to the originating IP addresses of the request. This is the result of a misconfiguration. You should either configure your proxy only to send one of these headers, or configure Symfony to distrust one of them.'); } +if (!$hasTrustedForwardedHeader && !$hasTrustedClientIpHeader) { +return $this->normalizeAndFilterClientIps(array(), $ip); } -return $clientIps ? array_reverse($clientIps) : array($firstTrustedIp); +return $clientIps; } public function getClientIp() { @@ -1055,7 +1053,7 @@ return $this->getMethod() === strtoupper($method); } public function isMethodSafe() { -return in_array($this->getMethod(), array('GET','HEAD')); +return in_array($this->getMethod(), array('GET','HEAD','OPTIONS','TRACE')); } public function getContent($asResource = false) { @@ -1317,6 +1315,26 @@ private function isFromTrustedProxy() { return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies); } +private function normalizeAndFilterClientIps(array $clientIps, $ip) +{ +$clientIps[] = $ip; $firstTrustedIp = null; +foreach ($clientIps as $key => $clientIp) { +if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { +$clientIps[$key] = $clientIp = $match[1]; +} +if (!filter_var($clientIp, FILTER_VALIDATE_IP)) { +unset($clientIps[$key]); +continue; +} +if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { +unset($clientIps[$key]); +if (null === $firstTrustedIp) { +$firstTrustedIp = $clientIp; +} +} +} +return $clientIps ? array_reverse($clientIps) : array($firstTrustedIp); +} } } namespace Symfony\Component\HttpFoundation @@ -2432,11 +2450,11 @@ protected $booted = false; protected $name; protected $startTime; protected $loadClassCache; -const VERSION ='2.8.7'; -const VERSION_ID = 20807; +const VERSION ='2.8.9'; +const VERSION_ID = 20809; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; -const RELEASE_VERSION = 7; +const RELEASE_VERSION = 9; const EXTRA_VERSION =''; const END_OF_MAINTENANCE ='11/2018'; const END_OF_LIFE ='11/2019'; @@ -3141,6 +3159,7 @@ return parent::isFresh(); namespace Symfony\Component\HttpKernel { use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Event\FilterControllerEvent; @@ -3150,6 +3169,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Event\PostResponseEvent; +use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; @@ -3171,6 +3191,9 @@ $request->headers->set('X-Php-Ob-Level', ob_get_level()); try { return $this->handleRaw($request, $type); } catch (\Exception $e) { +if ($e instanceof ConflictingHeadersException) { +$e = new BadRequestHttpException('The request headers contain conflicting information regarding the origin of this request.', $e); +} if (false === $catch) { $this->finishRequest($request, $type); throw $e; diff --git a/src/Chamilo/ContactBundle/Entity/CategoryTranslation.php b/src/Chamilo/ContactBundle/Entity/CategoryTranslation.php index fb522b3484..4fc9587b1e 100644 --- a/src/Chamilo/ContactBundle/Entity/CategoryTranslation.php +++ b/src/Chamilo/ContactBundle/Entity/CategoryTranslation.php @@ -19,7 +19,15 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors; class CategoryTranslation { use ORMBehaviors\Translatable\Translation; - + /** + * @var integer + * + * @ORM\Column(name="id", type="integer") + * @ORM\Id + * @ORM\GeneratedValue() + */ + protected $id; + /** * * @ORM\Column(type="string", length=255, nullable=false)