// String or non-string? ;-)
if (is_string($value)) {
// String...
- $line = '$this->' . $prefix . "['".$this->name."']['" . $key . "']" . $extender . " = '" . smartAddSlashes($value) . "';\n";
+ $line = '$this->' . $prefix . "['".$this->name."']['" . $key . "']" . $extender . " = '" . addslashes($value) . "';\n";
} elseif (is_null($value)) {
// Null
$line = '$this->' . $prefix . "['".$this->name."']['" . $key . "']" . $extender . " = null;\n";
} // END - if
if (!SQL_IS_LINK_UP()) {
- // Fall-back to smartAddSlashes() when there is no link
- $ret = smartAddSlashes($str);
+ // Fall-back to addslashes() when there is no link
+ $ret = addslashes($str);
} elseif (function_exists('mysql_real_escape_string')) {
// The new and improved version
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'str='.$str);
// The obsolete function
$ret = mysql_escape_string($str, SQL_GET_LINK());
} else {
- // If nothing else works, fall back to smartAddSlashes() again
- $ret = smartAddSlashes($str);
+ // If nothing else works, fall back to addslashes() again
+ $ret = addslashes($str);
}
// Cache result
}
// Get version from extensions
-function getExtensionVersion ($ext_name) {
+function getExtensionVersion ($ext_name, $force = false) {
// By default no extension is found
- $ext_ver = 'invalid';
+ $ext_ver = 'false';
// Empty extension name should be fixed!
if (empty($ext_name)) {
}
// Extension version should not be invalid
- if ($ext_ver == 'invalid') {
+ if (($ext_ver == 'false') && ($force === false)) {
// Please report this trouble
debug_report_bug(sprintf("Extension <strong>%s</strong> has empty version!", $ext_name));
} // END - if
if ((count($matches) > 0) && (count($matches[3]) > 0)) {
// Replace all matches
foreach ($matches[3] as $key => $cmd) {
- // By default we have no extension installed, so 'false' is assumed
- $replacer = 'false';
+ // Init replacer variable
+ $replacer = '';
// Is the extension installed or code provided?
if ($cmd == 'code') {
// Code asked for
- $replacer = getCode($matches[4][$key]);
- } elseif (isExtensionActive($matches[4][$key])) {
+ $replacer = "\".getCode(\"" . $matches[4][$key] . "\").\"";
+ } else {
// Construct call-back function name
$functionName = 'getExtension' . ucfirst(strtolower($cmd));
- // Call the function
- $replacer = call_user_func_array($functionName, $matches[4][$key]);
- } // END - if
+ // Construct call of the function
+ $replacer = "\".call_user_func_array('" . $functionName . "', array('" . $matches[4][$key] . "', true)).\"";
+ }
// Replace it and insert parameter for GET request
- $code = str_replace($matches[0][$key], sprintf("&%s=%s&rev=%s", $cmd, $replacer, getConfig('CURR_SVN_REVISION')), $code);
+ $code = str_replace($matches[0][$key], sprintf("&%s=%s&rev=\".getConfig('CURR_SVN_REVISION').\"", $cmd, $replacer), $code);
} // END - foreach
} // END - if
// Return compiled code
+ //* DEBUG: */ die('<pre>'.htmlentities($code).'</pre>');
return $code;
}
clearOutputBuffer();
} // END - if
- // Send HTTP header
- sendHeader('HTTP/1.1 200');
-
- // Used later
- $now = gmdate('D, d M Y H:i:s') . ' GMT';
-
- // General headers for no caching
- sendHeader('Expired: ' . $now); // RFC2616 - Section 14.21
- sendHeader('Last-Modified: ' . $now);
- sendHeader('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
- sendHeader('Pragma: no-cache'); // HTTP/1.0
- sendHeader('Connection: Close');
- sendHeader('Content-Type: ' . getContentType() . '; charset=UTF-8');
- sendHeader('Content-language: ' . getLanguage());
-
// Extension 'rewrite' installed?
if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
$GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
} // END - if
- // Init counter
- $cnt = '0';
-
// Compile and run finished rendered HTML code
- while (((strpos($GLOBALS['output'], '{--') > 0) || (strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) {
- // Prepare the content and eval() it...
- $content = array();
- $newContent = '';
-
- // Compile it
- $eval = "\$newContent = \"".compileCode(smartAddSlashes($GLOBALS['output']))."\";";
- eval($eval);
-
- // Was that eval okay?
- if (empty($newContent)) {
- // Something went wrong!
- debug_report_bug('Evaluation error:<pre>' . linenumberCode($eval) . '</pre>');
- } // END - if
- $GLOBALS['output'] = $newContent;
+ compileFinalOutput();
- // Count round
- $cnt++;
- } // END - while
+ // Send all HTTP headers
+ sendHttpHeaders();
// Output code here, DO NOT REMOVE! ;-)
outputRawCode($GLOBALS['output']);
} // END - if
// Compile and run finished rendered HTML code
- while (strpos($GLOBALS['output'], '{!') > 0) {
- eval("\$GLOBALS['output'] = \"".compileCode(smartAddSlashes($GLOBALS['output']))."\";");
- } // END - while
+ compileFinalOutput();
+
+ // Send all HTTP headers
+ sendHttpHeaders();
// Output code here, DO NOT REMOVE! ;-)
outputRawCode($GLOBALS['output']);
}
}
+// Sends out all headers required for HTTP/1.1 reply
+function sendHttpHeaders () {
+ // Used later
+ $now = gmdate('D, d M Y H:i:s') . ' GMT';
+
+ // Send HTTP header
+ sendHeader('HTTP/1.1 200');
+
+ // General headers for no caching
+ sendHeader('Expired: ' . $now); // RFC2616 - Section 14.21
+ sendHeader('Last-Modified: ' . $now);
+ sendHeader('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+ sendHeader('Pragma: no-cache'); // HTTP/1.0
+ sendHeader('Connection: Close');
+ sendHeader('Content-Type: ' . getContentType() . '; charset=UTF-8');
+ sendHeader('Content-Language: ' . getLanguage());
+}
+
+// Compiles the final output
+function compileFinalOutput () {
+ // Init counter
+ $cnt = '0';
+
+ // Compile all out
+ while (((strpos($GLOBALS['output'], '{--') > 0) || (strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) {
+ // Init common variables
+ $content = array();
+ $newContent = '';
+
+ // Compile it
+ $eval = "\$newContent = \"".compileCode(addslashes($GLOBALS['output']))."\";";
+ eval($eval);
+
+ // Was that eval okay?
+ if (empty($newContent)) {
+ // Something went wrong!
+ debug_report_bug('Evaluation error:<pre>' . linenumberCode($eval) . '</pre>');
+ } // END - if
+ $GLOBALS['output'] = $newContent;
+
+ // Count round
+ $cnt++;
+ } // END - while
+
+ // Add final length
+ sendHeader('Content-Length: ' . strlen($GLOBALS['output']));
+}
+
// Output the raw HTML code
function outputRawCode ($htmlCode) {
// Output stripped HTML code to avoid broken JavaScript code, etc.
- print(stripslashes(stripslashes($htmlCode)));
+ print($htmlCode);
// Flush the output if only getPhpCaching() is not 'on'
if (getPhpCaching() != 'on') {
$ret = "<!-- Template " . $template . " - Start -->\n" . $GLOBALS['tpl_content'] . "<!-- Template " . $template . " - End -->\n";
// Prepare eval() command
- $eval = '$ret = "' . compileCode(smartAddSlashes($ret)) . '";';
+ $eval = '$ret = "' . compileCode(addslashes($ret)) . '";';
} elseif (substr($template, 0, 3) == 'js_') {
- // JavaScripts don't like entities
- $eval = '$ret = decodeEntities("' . compileCode(smartAddSlashes($GLOBALS['tpl_content'])) . '");';
+ // JavaScripts don't like entities and timings
+ $eval = '$ret = decodeEntities("' . compileRawCode(addslashes($GLOBALS['tpl_content'])) . '");';
} else {
// Prepare eval() command
- $eval = '$ret = "' . compileCode(smartAddSlashes($GLOBALS['tpl_content'])) . '";';
+ $eval = '$ret = "' . compileCode(addslashes($GLOBALS['tpl_content'])) . '";';
}
} else {
// Add surrounding HTML comments to help finding bugs faster
$ret = "<!-- Template " . $template . " - Start -->\n" . $GLOBALS['tpl_content'] . "<!-- Template " . $template . " - End -->\n";
- $eval = '$ret = "' . smartAddSlashes($ret) . '";';
+ $eval = '$ret = "' . addslashes($ret) . '";';
} // END - if
// Cache the eval() command here
$GLOBALS['tpl_content'] = readFromFile($FQFN);
// Run code
- $GLOBALS['tpl_content'] = "\$newContent = decodeEntities(\"".compileRawCode(smartAddSlashes($GLOBALS['tpl_content']))."\");";
+ $GLOBALS['tpl_content'] = "\$newContent = decodeEntities(\"".compileRawCode(addslashes($GLOBALS['tpl_content']))."\");";
eval($GLOBALS['tpl_content']);
} elseif (!empty($template)) {
// Template file not found!
unset($DATA);
// Compile the code and eval it
- $eval = '$newContent = "' . compileRawCode(smartAddSlashes($newContent)) . '";';
+ $eval = '$newContent = "' . compileRawCode(addslashes($newContent)) . '";';
eval($eval);
// Return content
//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />");
// Compile subject line (for POINTS constant etc.)
- eval("\$subject = decodeEntities(\"".compileRawCode(smartAddSlashes($subject))."\");");
+ eval("\$subject = decodeEntities(\"".compileRawCode(addslashes($subject))."\");");
// Set from header
if ((!eregi('@', $toEmail)) && ($toEmail > 0)) {
}
// Compile "TO"
- eval("\$toEmail = \"".compileRawCode(smartAddSlashes($toEmail))."\";");
+ eval("\$toEmail = \"".compileRawCode(addslashes($toEmail))."\";");
// Compile "MSG"
- eval("\$message = \"".compileRawCode(smartAddSlashes($message))."\";");
+ eval("\$message = \"".compileRawCode(addslashes($message))."\";");
// Fix HTML parameter (default is no!)
if (empty($isHtml)) $isHtml = 'N';
$check = str_replace('/', '', $check);
if (!in_array($check, $GLOBALS['html_tags'])) {
// Invalid tag found!
- return "";
+ return '';
}
$test = substr($test, strpos($test, '>') + 1);
}
$OUT = '';
foreach ($postData as $k => $v) {
// Do not add 'force' !
- if ($k != "force") {
- $OUT .= "<input type=\"hidden\" name=\"".$k."\" value=\"".stripslashes($v)."\" />\n";
- }
- }
+ if ($k != 'force') {
+ $OUT .= "<input type=\"hidden\" name=\"" . SQL_ESCAPE($k) . "\" value=\"" . SQL_ESCAPE($v) . "\" />\n";
+ } // END - if
+ } // END - foreach
+
+ // Remember data
$content['hidden'] = $OUT;
$content['email'] = $postData['email'];
function createNewTask ($subject, $notes, $taskType, $userid = '0', $adminId = '0', $strip = true) {
// Insert the task data into the database
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
- array($adminId, $userid, $taskType, $subject, smartAddSlashes($notes)), __FUNCTION__, __LINE__, true, $strip);
+ array($adminId, $userid, $taskType, $subject, addslashes($notes)), __FUNCTION__, __LINE__, true, $strip);
}
// Updates last module / online time
return $str;
}
-// Smartly adds slashes
-function smartAddSlashes ($unquoted) {
- // Do we have cache?
- if (!isset($GLOBALS['smart_addslashes'][$unquoted])) {
- // Remove slashe
- $unquoted = str_replace("\\", '', $unquoted);
-
- // Put it in cache and add slashes
- $GLOBALS['smart_addslashes'][$unquoted] = addslashes($unquoted);
- } // END - if
-
- // Return result
- return $GLOBALS['smart_addslashes'][$unquoted];
-}
-
// Decode entities in a nicer way
function decodeEntities ($str) {
// Decode the entities to UTF-8 now
function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
-var expando = "jQuery" + now(), uuid = 0, windowData = {};\r
-\r
-jQuery.extend({\r
- cache: {},\r
-\r
- data: function( elem, name, data ) {\r
- elem = elem == window ?\r
- windowData :\r
- elem;\r
-\r
- var id = elem[ expando ];\r
-\r
- // Compute a unique ID for the element\r
- if ( !id )\r
- id = elem[ expando ] = ++uuid;\r
-\r
- // Only generate the data cache if we're\r
- // trying to access or manipulate it\r
- if ( name && !jQuery.cache[ id ] )\r
- jQuery.cache[ id ] = {};\r
-\r
- // Prevent overriding the named cache with undefined values\r
- if ( data !== undefined )\r
- jQuery.cache[ id ][ name ] = data;\r
-\r
- // Return the named cache data, or the ID for the element\r
- return name ?\r
- jQuery.cache[ id ][ name ] :\r
- id;\r
- },\r
-\r
- removeData: function( elem, name ) {\r
- elem = elem == window ?\r
- windowData :\r
- elem;\r
-\r
- var id = elem[ expando ];\r
-\r
- // If we want to remove a specific section of the element's data\r
- if ( name ) {\r
- if ( jQuery.cache[ id ] ) {\r
- // Remove the section of cache data\r
- delete jQuery.cache[ id ][ name ];\r
-\r
- // If we've removed all the data, remove the element's cache\r
- name = "";\r
-\r
- for ( name in jQuery.cache[ id ] )\r
- break;\r
-\r
- if ( !name )\r
- jQuery.removeData( elem );\r
- }\r
-\r
- // Otherwise, we want to remove all of the element's data\r
- } else {\r
- // Clean up the element expando\r
- try {\r
- delete elem[ expando ];\r
- } catch(e){\r
- // IE has trouble directly removing the expando\r
- // but it's ok with using removeAttribute\r
- if ( elem.removeAttribute )\r
- elem.removeAttribute( expando );\r
- }\r
-\r
- // Completely remove the data cache\r
- delete jQuery.cache[ id ];\r
- }\r
- },\r
- queue: function( elem, type, data ) {\r
- if ( elem ){\r
- \r
- type = (type || "fx") + "queue";\r
- \r
- var q = jQuery.data( elem, type );\r
- \r
- if ( !q || jQuery.isArray(data) )\r
- q = jQuery.data( elem, type, jQuery.makeArray(data) );\r
- else if( data )\r
- q.push( data );\r
- \r
- }\r
- return q;\r
- },\r
-\r
- dequeue: function( elem, type ){\r
- var queue = jQuery.queue( elem, type ),\r
- fn = queue.shift();\r
- \r
- if( !type || type === "fx" )\r
- fn = queue[0];\r
- \r
- if( fn !== undefined )\r
- fn.call(elem);\r
- }\r
-});\r
-\r
-jQuery.fn.extend({\r
- data: function( key, value ){\r
- var parts = key.split(".");\r
- parts[1] = parts[1] ? "." + parts[1] : "";\r
-\r
- if ( value === undefined ) {\r
- var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);\r
-\r
- if ( data === undefined && this.length )\r
- data = jQuery.data( this[0], key );\r
-\r
- return data === undefined && parts[1] ?\r
- this.data( parts[0] ) :\r
- data;\r
- } else\r
- return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){\r
- jQuery.data( this, key, value );\r
- });\r
- },\r
-\r
- removeData: function( key ){\r
- return this.each(function(){\r
- jQuery.removeData( this, key );\r
- });\r
- },\r
- queue: function(type, data){\r
- if ( typeof type !== "string" ) {\r
- data = type;\r
- type = "fx";\r
- }\r
-\r
- if ( data === undefined )\r
- return jQuery.queue( this[0], type );\r
-\r
- return this.each(function(){\r
- var queue = jQuery.queue( this, type, data );\r
- \r
- if( type == "fx" && queue.length == 1 )\r
- queue[0].call(this);\r
- });\r
- },\r
- dequeue: function(type){\r
- return this.each(function(){\r
- jQuery.dequeue( this, type );\r
- });\r
- }\r
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+ cache: {},
+
+ data: function( elem, name, data ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // Compute a unique ID for the element
+ if ( !id )
+ id = elem[ expando ] = ++uuid;
+
+ // Only generate the data cache if we're
+ // trying to access or manipulate it
+ if ( name && !jQuery.cache[ id ] )
+ jQuery.cache[ id ] = {};
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined )
+ jQuery.cache[ id ][ name ] = data;
+
+ // Return the named cache data, or the ID for the element
+ return name ?
+ jQuery.cache[ id ][ name ] :
+ id;
+ },
+
+ removeData: function( elem, name ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( jQuery.cache[ id ] ) {
+ // Remove the section of cache data
+ delete jQuery.cache[ id ][ name ];
+
+ // If we've removed all the data, remove the element's cache
+ name = "";
+
+ for ( name in jQuery.cache[ id ] )
+ break;
+
+ if ( !name )
+ jQuery.removeData( elem );
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch(e){
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute )
+ elem.removeAttribute( expando );
+ }
+
+ // Completely remove the data cache
+ delete jQuery.cache[ id ];
+ }
+ },
+ queue: function( elem, type, data ) {
+ if ( elem ){
+
+ type = (type || "fx") + "queue";
+
+ var q = jQuery.data( elem, type );
+
+ if ( !q || jQuery.isArray(data) )
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+ else if( data )
+ q.push( data );
+
+ }
+ return q;
+ },
+
+ dequeue: function( elem, type ){
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift();
+
+ if( !type || type === "fx" )
+ fn = queue[0];
+
+ if( fn !== undefined )
+ fn.call(elem);
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ){
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length )
+ data = jQuery.data( this[0], key );
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
+ jQuery.data( this, key, value );
+ });
+ },
+
+ removeData: function( key ){
+ return this.each(function(){
+ jQuery.removeData( this, key );
+ });
+ },
+ queue: function(type, data){
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined )
+ return jQuery.queue( this[0], type );
+
+ return this.each(function(){
+ var queue = jQuery.queue( this, type, data );
+
+ if( type == "fx" && queue.length == 1 )
+ queue[0].call(this);
+ });
+ },
+ dequeue: function(type){
+ return this.each(function(){
+ jQuery.dequeue( this, type );
+ });
+ }
});/*!
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
-<script type="text/javascript"
- src="{?URL?}/js.php?js=cookies_disabled{%version=sql_patches%}"></script>
+<script src="{?URL?}/js.php?js=cookies_disabled{%version=sql_patches%}" type="text/javascript"></script>
<form accept-charset="utf-8" id="form" action="{?URL?}/modules.php?module=order&order=$content" method="post" target="_parent" onsubmit="return Submit()">
{--MEMBER_ORDER_PLEASE_WAIT_1--}<span id="counter" style="font-weight:bold">10</span>{--MEMBER_ORDER_PLEASE_WAIT_2--}<br />
<input type="submit" class="member_submit" id="ok" name="ok" value="{--MEMBER_DO_ORDER--}" />
-<script type="text/javascript"
- src="{?URL?}/js.php?js=order_send{%version=order%}"></script>
+<script type="text/javascript" src="{?URL?}/js.php?js=order_send{%version=order%}"></script>
</form>
</div>
</div>
-<script type="text/javascript"
- src="{?URL?}/js.php?js=surfbar_member_book{%version=surfbar%}"></form>
+<script src="{?URL?}/js.php?js=surfbar_member_book{%version=surfbar%}" type="text/javascript"></script>
+</form>
<span align="center" class="member_note" style="padding:5px">
Die maximalen Kosten bzw. Einnahmen pro Surfbaraufruf richten sich nach
</div>
</div>
-<script type="text/javascript"
- src="{?URL?}/js.php?js=surfbar_member_book{%version=surfbar%}"></script>
+<script src="{?URL?}/js.php?js=surfbar_member_book{%version=surfbar%}" type="text/javascript"></script>
</form>
</div>
</div>
-<script type="text/javascript"
- src="{?URL?}/js.php?js=surfbar_member_edit{%version=surfbar%}&views_max=$content[views_max]&limited=$content[limited]"></script>
+<script src="{?URL?}/js.php?js=surfbar_member_edit{%version=surfbar%}&views_max=$content[views_max]&limited=$content[limited]"
+ type="text/javascript"></script>
</form>
<meta http-equiv="content-script-type" content="text/javascript" />
<meta http-equiv="language" content="de" />
-<script type="JavaScript" src="{?URL?}/js.php?js=jquery{%version=jquery%}">
-</script>
+<script src="{?URL?}/js.php?js=jquery{%version=jquery%}" type="text/javascript"></script>
</div>
</div>
-<script type="text/javascript"
- src="{?URL?}/js.php?js=surfbar_stopped{%version=surfbar%}&restart=$content[restart]&autostart=$content[autostart]">
-</script>
+<script src="{?URL?}/js.php?js=surfbar_stopped{%version=surfbar%}&restart=$content[restart]&autostart=$content[autostart]"
+ type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
au_ip='$content[REMOTE_ADDR]';
/* ]]> */</script>
-<script type="text/javascript" src="{?URL?}/js.php?js=uberwach{%version=uberwach%}"></script>
+<script src="{?URL?}/js.php?js=uberwach{%version=uberwach%}" type="text/javascript"></script>
<noscript><a href="http://www.uberwach.de/" rel="external" target="_blank" title="Aktion: Überwach!"><img src="http://www.uberwach.de/wanze.gif" alt="Aktion UBERWACH!" width="80" height="15" border="0" /></a></noscript>
<!-- ende uberwach code -->