Permalink
Commits on Aug 31, 2014
Commits on Oct 1, 2013
  1. Prevent XSS attacks introduced by 213a24a

    Thanks to @tomvangoethem for the report!
    committed Oct 1, 2013
Commits on Aug 22, 2013
  1. Remove GPL license

    MIT is GPL-compatible anyway.
    jaymz committed with Aug 19, 2013
Commits on Aug 19, 2013
  1. Avoid re-shortening URLs

    If the URL is already a short URL on this domain, don’t re-shorten it, but instead return the existing short URL for it.
    
    This is useful in Twitter clients like Tweetbot for iOS that automatically shorten any URL you enter, even if it’s one you’ve shortened before.
    committed Aug 19, 2013
Commits on May 7, 2013
Commits on Feb 7, 2013
Commits on Jul 11, 2012
  1. @B-Scan

    Order by date and by slug, to handle the edge case where the last two…

    … entries have the same date
    
    Ref. #6.
    B-Scan committed with Jul 11, 2012
Commits on Nov 3, 2011
Commits on Jul 13, 2011
Commits on Jul 12, 2011
Commits on Jun 24, 2011
  1. Minify fallback HTML as much as possible (for proxies that strip the …

    …`Location` HTTP headers) as it’s sent with every request.
    committed Jun 24, 2011
Commits on Jun 21, 2011
  1. Rename database-related constants, as suggested by @beverloo.

    Also, some coding style tweaks.
    committed Jun 21, 2011
  2. Apply @beverloo’s advice as much as possible.

    Also, some other minor tweaks:
    
    * Switch to tabs for indentation.
    * Some code style fixes (personal preference).
    * Add Peter as a contributor.
    committed Jun 21, 2011
  3. Merge pull request #4 from beverloo/patch-1

    Some minor changes to your redirect script
    committed Jun 21, 2011
Commits on Jun 20, 2011
  1. @beverloo

    - "require" is a PHP language construct and thus should not use paren…

    …thesis.
    
    - Every code path ends with a call to redirect(), no need to have this as a function (also fixes issue #3).
    - Your usage of rtrim() on the slug is weird at best. I'm guessing that you want to filter these characters out. This version only allows characters and numbers.
    - The redirect to Twitter uses the unescaped request URI. Tweets with an ID < 10m are rare enough to disregard (filters out false positives).
    - Your database-related constants are named oddly. You're connecting to *MySQL* through the *MySQLi* interface. It's still the MySQL username.
    - "SET NAMES" is deprecated in favor of the set_charset member function.
    - You escape the $slug variable twice (trice when there's a hit). It's not like that's going to make it any safer.
    - You should never use backticks around field and table names in a MySQL query. It's a bit eeeuw.
    - The hit-counter can perfectly be within the conditional code. No need to break functionality if we can't update.
    - Always shut down the database connections you open. This also cleans up used query memory.
    - Provide some fallbacks for proxies which filter out redirects;
     (1) a <meta> refresh to the designated URL
     (2) a JavaScript-based redirect, in try/catch for origin reasons.
     (3) a text-link for those that still fail.
    beverloo committed Jun 20, 2011
Commits on Dec 3, 2010
Commits on Nov 30, 2010
  1. Simplified the code a bit.

    committed Nov 30, 2010
Commits on Nov 29, 2010