]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #379 from ArthurHoaro/plugin-markdown
authorArthur <arthur@hoa.ro>
Sun, 31 Jan 2016 17:57:29 +0000 (18:57 +0100)
committerArthur <arthur@hoa.ro>
Sun, 31 Jan 2016 17:57:29 +0000 (18:57 +0100)
PLUGIN Markdown

1  2 
application/Utils.php
inc/shaarli.css

diff --combined application/Utils.php
index 551db3e7cf4b74b1a347d7a84002d1472384fa6b,ac8bfbfc07dab77e40261c5b146479ec474ac44d..10d606987c826990e94fad0489f36aad66f6a969
@@@ -3,24 -3,6 +3,24 @@@
   * Shaarli utilities
   */
  
 +/**
 + * Logs a message to a text file
 + *
 + * The log format is compatible with fail2ban.
 + *
 + * @param string $logFile  where to write the logs
 + * @param string $clientIp the client's remote IPv4/IPv6 address
 + * @param string $message  the message to log
 + */
 +function logm($logFile, $clientIp, $message)
 +{
 +    file_put_contents(
 +        $logFile,
 +        date('Y/m/d H:i:s').' - '.$clientIp.' - '.strval($message).PHP_EOL,
 +        FILE_APPEND
 +    );
 +}
 +
  /**
   *  Returns the small hash of a string, using RFC 4648 base64url format
   *
@@@ -61,14 -43,6 +61,6 @@@ function endsWith($haystack, $needle, $
      return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)), $needle) === 0);
  }
  
- /**
-  * Same as nl2br(), but escapes < and >
-  */
- function nl2br_escaped($html)
- {
-     return str_replace('>', '&gt;', str_replace('<', '&lt;', nl2br($html)));
- }
  /**
   * htmlspecialchars wrapper
   */
@@@ -90,14 -64,12 +82,14 @@@ function sanitizeLink(&$link
  
  /**
   * Checks if a string represents a valid date
 +
 + * @param string $format The expected DateTime format of the string
 + * @param string $string A string-formatted date
 + *
 + * @return bool whether the string is a valid date
   *
 - * @param string        a string-formatted date
 - * @param format        the expected DateTime format of the string
 - * @return              whether the string is a valid date
 - * @see                 http://php.net/manual/en/class.datetime.php
 - * @see                 http://php.net/manual/en/datetime.createfromformat.php
 + * @see http://php.net/manual/en/class.datetime.php
 + * @see http://php.net/manual/en/datetime.createfromformat.php
   */
  function checkDateFormat($format, $string)
  {
diff --combined inc/shaarli.css
index 96e2cae1ce5c2d22dbf7fb74e75d47129c7ad4c7,79ba1d693eebbca99348e43b5c820cc35e82ed5f..7a69d575c1f7cbfbe9d005a867082582fd6689ec
@@@ -467,7 -467,6 +467,6 @@@ h1 
      margin-top: 0;
      margin-bottom: 12px;
      font-weight: normal;
-     max-height: 400px;
      overflow: auto;
  }
  
      background: #ffffff;
  }
  
 -div#permalinkQrcode {
 -    padding: 20px;
 -    width: 220px;
 -    height: 220px;
 -    background-color: #ffffff;
 -    border: 1px solid black;
 -    position: absolute;
 -    top: -100px;
 -    left: -100px;
 -    text-align: center;
 -    font-size: 8pt;
 -    z-index: 50;
 -    -webkit-box-shadow: 2px 2px 20px 2px #333333;
 -    -moz-box-shadow: 2px 2px 20px 2px #333333;
 -    -o-box-shadow: 2px 2px 20px 2px #333333;
 -    -ms-box-shadow: 2px 2px 20px 2px #333333;
 -    box-shadow: 2px 2px 20px 2px #333333;
 -}
 -
  div.daily {
      font-family: Georgia, 'DejaVu Serif', Norasi, serif;
      background-color: #E6D6BE;
@@@ -1101,17 -1119,4 +1100,17 @@@ div.dailyNoEntry 
  ul.errors {
      color: red;
      float: left;
 -}
 +}
 +
 +/* 404 page */
 +.error-container {
 +
 +    margin: 50px;
 +    margin-top: 20px;
 +}
 +
 +.error-container h1 {
 +    text-decoration: none;
 +    font-style: normal;
 +    color: #80AD48;
 +}