Skip to content

Commit 4919dc1

Browse files
committed
glype-1.4.5
1 parent 4838174 commit 4919dc1

6 files changed

Lines changed: 26 additions & 11 deletions

File tree

INSTALL.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# INSTALLATION INSTRUCTIONS
33
# ------------------------------------------------------------------------------
44

5-
1. Upload the contents of the /glype-1.4.1/ folder to the desired directory on your server.
5+
1. Upload the contents of the /glype-1.4.5/ folder to the desired directory on your server.
66
2. Visit the URL of your Glype Admin Control Panel (i.e. http://www.domain.com/admin.php).
77
3. Set the desired options and save your settings.

admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
define('ADMIN_URI', $_SERVER['PHP_SELF']);
4343

4444
# Define the current admin version
45-
define('ADMIN_VERSION', '1.4.4');
45+
define('ADMIN_VERSION', '1.4.5');
4646

4747
# Start buffering
4848
ob_start();

edit-browser.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,29 @@
3030
******************************************************************/
3131

3232
// Return without saving button
33-
$return = empty($_GET['return']) ? '' : '<input type="button" value="Cancel" onclick="window.location=\'' . $_GET['return'] . '\'">';
34-
$returnField = empty($_GET['return']) ? '' : '<input type="hidden" value="' . $_GET['return'] . '" name="return">';
33+
$return = empty($_GET['return']) ? '' : '<input type="button" value="Cancel" onclick="window.location=\'' . remove_html($_GET['return']) . '\'">';
34+
$returnField = empty($_GET['return']) ? '' : '<input type="hidden" value="' . remove_html($_GET['return']) . '" name="return">';
35+
$agent = empty($_SERVER['HTTP_USER_AGENT']) ? '' : htmlentities($_SERVER['HTTP_USER_AGENT']);
3536

3637
// Quote strings
37-
function q($value) {
38+
function escape_single_quotes($value) {
3839
return str_replace("'", "\'", $value);
3940
}
41+
function remove_html($x) {
42+
$x = preg_replace('#"#', '', $x);
43+
$x = preg_replace("#'#", '', $x);
44+
$x = preg_replace('#<#', '', $x);
45+
$x = preg_replace('#>#', '', $x);
46+
$x = preg_replace('#\\\\#', '', $x);
47+
return $x;
48+
}
4049

4150
// Get existing values
4251
$browser = $_SESSION['custom_browser'];
4352

44-
$currentUA = q($browser['user_agent']);
53+
$currentUA = escape_single_quotes($browser['user_agent']);
4554
$realReferrer = $browser['referrer'] == 'real' ? 'true' : 'false';
46-
$customReferrer = $browser['referrer'] == 'real' ? '' : q($browser['referrer']);
55+
$customReferrer = $browser['referrer'] == 'real' ? '' : escape_single_quotes($browser['referrer']);
4756

4857
echo <<<OUT
4958
<script type="text/javascript">
@@ -141,7 +150,7 @@ function clearRealReferrer() {
141150
<option value="Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1">Android 2.3.5</option>
142151
<option value="Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.115 Mobile Safari/534.11+">Blackberry</option>
143152
<option value="Opera/9.80 (J2ME/MIDP; Opera Mini/9.80 (S60; SymbOS; Opera Mobi/23.348; U; en) Presto/2.5.25 Version/10.54">Symbian with Opera Mini</option>
144-
<option value="{$_SERVER['HTTP_USER_AGENT']}"> - Current/Real</option>
153+
<option value="{$agent}"> - Current/Real</option>
145154
<option value=""> - None</option>
146155
<option value="custom"> - Custom...</option>
147156
</select>

includes/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
******************************************************************/
9393

9494
# Current version - no need to change this!
95-
$themeReplace['version'] = 'v1.4.4';
95+
$themeReplace['version'] = 'v1.4.5';
9696

9797
# Look for a config.php in the /themes/themeName/ folder
9898
if ( ! defined('MULTIGLYPE') && file_exists($tmp = GLYPE_ROOT . '/themes/' . $CONFIG['theme'] . '/config.php') ) {

includes/parser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,16 @@ function HTMLDocument($input, $insert='', $inject=false, $footer='') {
5252
}
5353
}
5454

55+
# Remove empty script comments
56+
$input = preg_replace('#/\*\s*\*/#s', '', $input);
57+
5558
# Remove conditional comments
5659
$input = preg_replace('#<\!\-\-\[if \!IE\]>\s*\-\->(.*?)<\!\[endif\]\-\->#s','$1',$input);
5760
$input = preg_replace('#<\!\-\-\[if.*?<\!\[endif\]\-\->#s','',$input);
5861

62+
# Prevent websites from calling disableOverride()
63+
$input = preg_replace('#disableOverride#s', 'disabled___disableOverride', $input);
64+
5965
# Remove titles if option is enabled
6066
if ( $this->htmlOptions['stripTitle'] || $this->htmlOptions['encodePage'] ) {
6167
$input = preg_replace('#<title.*?</title>#is', '', $input, 1);

includes/settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22
/*******************************************************************
33
* Glype is copyright and trademark 2007-2013 UpsideOut, Inc. d/b/a Glype
44
* and/or its licensors, successors and assigners. All rights reserved.
@@ -265,7 +265,7 @@
265265

266266
# Settings file version for determining compatability with admin
267267
# tool.
268-
$CONFIG['version'] = '1.4.4';
268+
$CONFIG['version'] = '1.4.5';
269269

270270
//---PRESERVE ME---
271271
// Anything below this line will be preserved when the admin control panel rewrites

0 commit comments

Comments
 (0)