Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Smarter domain convention in examples and source
Browse files Browse the repository at this point in the history
In config, readmes, editable files: the generic YOURLS install will be http://your-own-domain-here.com/ so that noob users get an obvious warning when they misconfigure something

In source comments, presumably read by hackers who have a clue, the generic YOURLS install will be http://sho.rt/. The generic long URL can be http://example.com/something-whatever

Closes YOURLS#1841
  • Loading branch information
ozh committed Apr 10, 2015
1 parent abc7d6c commit 7225f8d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion includes/functions-formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function yourls_string2htmlid( $string ) {
}

/**
* Make sure a link keyword (ie "1fv" as in "site.com/1fv") is valid.
* Make sure a link keyword (ie "1fv" as in "http://sho.rt/1fv") is valid.
*
*/
function yourls_sanitize_string( $string ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ function yourls_is_mobile_device() {
}

/**
* Get request in YOURLS base (eg in 'http://site.com/yourls/abcd' get 'abdc')
* Get request in YOURLS base (eg in 'http://sho.rt/yourls/abcd' get 'abdc')
*
*/
function yourls_get_request() {
Expand Down
8 changes: 4 additions & 4 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ <h2 class='first' id="fresh">Fresh Install</h2>
<li>Open <code>user/config.php</code> with a raw text editor (like Notepad) and fill in the required settings</li>
<li>Upload the unzipped files to your domain <code>public_html</code> or <code>www</code> folder</li>
<li>Create a new database (see <a href="#Config" onclick="toggle(this);">Configuration</a> &ndash; you can also use an existing one)</li>
<li>Point your browser to <code>http://yoursite.com/admin/</code></li>
<li>Point your browser to <code>http://your-own-domain-here.com/admin/</code></li>
</ol>

<h2 id="upgrade">Upgrade</h2>
<ol>
<li><strong>Backup the database!</strong></li>
<li>Unzip the YOURLS archive</li>
<li>Upload files to your server, overwriting your existing install</li>
<li>Point your browser to <code>http://yoursite.com/admin/</code></li>
<li>Point your browser to <code>http://your-own-domain-here.com/admin/</code></li>
<li>Tip: you can now move your <code>config.php</code> file to the <code>/user</code> directory</li>
</ol>

Expand All @@ -357,7 +357,7 @@ <h2 id="upgrade13">Upgrade from YOURLS 1.3 or earlier</h2>
<li>Unzip the YOURLS archive, upload the files</li>
<li>Copy <code>config-sample.php</code> to <code>config.php</code> and fill in details. <strong>Don't start with your old config file</strong>, use the new sample config file.</li>
<li>In your new <code>config.php</code>, add the <em>defines</em> for <code>YOURLS_DB_TABLE_URL</code> and <code>YOURLS_DB_TABLE_NEXTDEC</code> you had in your previous config file
<li>Point your browser to <code>http://yoursite.com/admin/</code> and follow instructions</li>
<li>Point your browser to <code>http://your-own-domain-here.com/admin/</code> and follow instructions</li>
<li>After upgrade is well and over, remove the define <code>YOURLS_DB_TABLE_NEXTDEC</code> from your config file</li>
</ol>

Expand Down Expand Up @@ -469,7 +469,7 @@ <h3 id="apifeatures">Features</h3>
</ul>

<h3 id="apiusage">Usage</h3>
<p>You need to send parameters to <code>http://yoursite.com/yourls-api.php</code> either via <code>GET</code> or <code>POST</code> (remember to <strong></strong>URL encode parameters</strong> if via GET). These parameters are:</p>
<p>You need to send parameters to <code>http://your-own-domain-here.com/yourls-api.php</code> either via <code>GET</code> or <code>POST</code> (remember to <strong></strong>URL encode parameters</strong> if via GET). These parameters are:</p>
<ul>
<li>A valid <code>username</code> / <code>password</code> pair, or your <code>signature</code> (see <a href="http://yourls.org/passwordlessapi">Passwordless API requests</a>)</li>
<li>The requested <code>action</code>: <tt>"shorturl"</tt> (get short URL for a link), <tt>"expand"</tt> (get long URL of a shorturl), <tt>"url-stats"</tt> (get stats about one short URL), <tt>"stats"</tt> (get stats about your links) or <tt>"db-stats"</tt> (get global link and click count)</li>
Expand Down
2 changes: 1 addition & 1 deletion sample-public-front-page.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Start YOURLS engine
require_once( dirname(__FILE__).'/includes/load-yourls.php' );

// Change this to match the URL of your public interface. Something like: http://yoursite.com/index.php
// Change this to match the URL of your public interface. Something like: http://your-own-domain-here.com/index.php
$page = YOURLS_SITE . '/sample-public-front-page.php' ;

// Part to be executed if FORM has been submitted
Expand Down
2 changes: 1 addition & 1 deletion sample-remote-api-call.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $title = 'Super blog!'; // optional, if omitted YOURLS will loo
$format = 'json'; // output format: 'json', 'xml' or 'simple'

// EDIT THIS: the URL of the API file
$api_url = 'http://yoursite/yourls-api.php';
$api_url = 'http://your-own-domain-here.com/yourls-api.php';

// Init the CURL session
$ch = curl_init();
Expand Down
4 changes: 2 additions & 2 deletions user/config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
*/

/** YOURLS installation URL -- all lowercase and with no trailing slash.
** If you define it to "http://site.com", don't use "http://www.site.com" in your browser (and vice-versa) */
define( 'YOURLS_SITE', 'http://site.com' );
** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */
define( 'YOURLS_SITE', 'http://your-own-domain-here.com' );

/** Timezone GMT offset */
define( 'YOURLS_HOURS_OFFSET', 0 );
Expand Down
2 changes: 1 addition & 1 deletion yourls-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Start YOURLS
require_once( dirname( __FILE__ ) . '/includes/load-yourls.php' );

// Get request in YOURLS base (eg in 'http://site.com/yourls/abcd' get 'abdc')
// Get request in YOURLS base (eg in 'http://sho.rt/yourls/abcd' get 'abdc')
$request = yourls_get_request();

// Make valid regexp pattern from authorized charset in keywords
Expand Down

0 comments on commit 7225f8d

Please sign in to comment.