| version 1.11, 2015/07/09 12:18:10 |
version 1.12, 2015/09/07 16:03:26 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.219 2015-07-09 12:15:58 igor Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.220 2015/09/07 16:02:40 igor Exp $ */ |
| |
|
| /* This is a generic table editing program. The table and fields to be |
/* This is a generic table editing program. The table and fields to be |
| edited are defined in the calling program. |
edited are defined in the calling program. |
|
|
| var $tabs; // TAB names |
var $tabs; // TAB names |
| var $timer = null; // phpMyEdit_timer object |
var $timer = null; // phpMyEdit_timer object |
| var $sd; var $ed; // sql start and end delimiters '`' in case of MySQL |
var $sd; var $ed; // sql start and end delimiters '`' in case of MySQL |
| |
var $encoding; // used for htmlspecialchars for now |
| |
var $ext_hsc = null;// external htmlspecialchars: NULL(default PHP) | FALSE(internal) | user_defined_function |
| |
|
| // Predefined variables |
// Predefined variables |
| var $comp_ops = array('<'=>'<','<='=>'<=','='=>'=','>='=>'>=','>'=>'>'); |
var $comp_ops = array('<'=>'<','<='=>'<=','='=>'=','>='=>'>=','>'=>'>'); |
|
|
| var_dump($val); |
var_dump($val); |
| $content = ob_get_contents(); |
$content = ob_get_contents(); |
| ob_end_clean(); |
ob_end_clean(); |
| echo htmlspecialchars($content); |
echo $this->_htmlspecialchars($content); |
| echo "</pre>\n"; |
echo "</pre>\n"; |
| } else { |
} else { |
| echo 'debug_var()::<i>',htmlspecialchars($name),'</i>'; |
echo 'debug_var()::<i>',$this->_htmlspecialchars($name),'</i>'; |
| echo '::<b>',htmlspecialchars($val),'</b>::',"<br />\n"; |
echo '::<b>',$this->_htmlspecialchars($val),'</b>::',"<br />\n"; |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
|
|
| global $debug_query; |
global $debug_query; |
| if ($debug_query || $debug) { |
if ($debug_query || $debug) { |
| $line = intval($line); |
$line = intval($line); |
| echo '<h4>MySQL query at line ',$line,'</h4>',htmlspecialchars($qry),'<hr size="1" />',"\n"; |
echo '<h4>MySQL query at line ',$line,'</h4>',$this->_htmlspecialchars($qry),'<hr size="1" />',"\n"; |
| } |
} |
| if (isset($this->db)) { |
if (isset($this->db)) { |
| $ret = @mysql_db_query($this->db, $qry, $this->dbh); |
$ret = @mysql_db_query($this->db, $qry, $this->dbh); |
|
|
| } |
} |
| if (! $ret) { |
if (! $ret) { |
| echo '<h4>MySQL error ',mysql_errno($this->dbh),'</h4>'; |
echo '<h4>MySQL error ',mysql_errno($this->dbh),'</h4>'; |
| echo htmlspecialchars(mysql_error($this->dbh)),'<hr size="1" />',"\n"; |
echo $this->_htmlspecialchars(mysql_error($this->dbh)),'<hr size="1" />',"\n"; |
| } |
} |
| return $ret; |
return $ret; |
| } /* }}} */ |
} /* }}} */ |
|
|
| 'Search' => 'v', |
'Search' => 'v', |
| 'Hide' => '^', |
'Hide' => '^', |
| 'Clear' => 'X', |
'Clear' => 'X', |
| 'Query' => htmlspecialchars('>')); |
'Query' => $this->_htmlspecialchars('>')); |
| if ((!$this->nav_text_links() && !$this->nav_graphic_links()) |
if ((!$this->nav_text_links() && !$this->nav_graphic_links()) |
| || !isset($ret['Search']) || !isset($ret['Query']) |
|| !isset($ret['Search']) || !isset($ret['Query']) |
| || !isset($ret['Hide']) || !isset($ret['Clear'])) { |
|| !isset($ret['Hide']) || !isset($ret['Clear'])) { |
|
|
| |
|
| function form_begin() /* {{{ */ |
function form_begin() /* {{{ */ |
| { |
{ |
| $page_name = htmlspecialchars($this->page_name); |
$page_name = $this->_htmlspecialchars($this->page_name); |
| if ($this->add_operation() || $this->change_operation() || $this->copy_operation() |
if ($this->add_operation() || $this->change_operation() || $this->copy_operation() |
| || $this->view_operation() || $this->delete_operation()) { |
|| $this->view_operation() || $this->delete_operation()) { |
| $field_to_tab = array(); |
$field_to_tab = array(); |
| Line 976 function '.$this->js['prefix'].'form_con |
|
| Line 978 function '.$this->js['prefix'].'form_con |
|
| echo ' |
echo ' |
| alert("'; |
alert("'; |
| if (isset($this->fdd[$k]['js']['hint'])) { |
if (isset($this->fdd[$k]['js']['hint'])) { |
| echo htmlspecialchars($this->fdd[$k]['js']['hint']); |
echo $this->_htmlspecialchars($this->fdd[$k]['js']['hint']); |
| } else { |
} else { |
| echo $this->labels['Please enter'],' ',$this->fdd[$k]['name'],'.'; |
echo $this->labels['Please enter'],' ',$this->fdd[$k]['name'],'.'; |
| } |
} |
| Line 1117 function '.$this->js['prefix'].'filter_h |
|
| Line 1119 function '.$this->js['prefix'].'filter_h |
|
| echo ($this->readonly($k) ? ' disabled' : ''); |
echo ($this->readonly($k) ? ' disabled' : ''); |
| echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
| echo $len_props,' value="'; |
echo $len_props,' value="'; |
| if($escape) echo htmlspecialchars($this->fdd[$k]['default']); |
if($escape) echo $this->_htmlspecialchars($this->fdd[$k]['default']); |
| else echo $this->fdd[$k]['default']; |
else echo $this->fdd[$k]['default']; |
| echo '" />'; |
echo '" />'; |
| } |
} |
| Line 1246 function '.$this->js['prefix'].'filter_h |
|
| Line 1248 function '.$this->js['prefix'].'filter_h |
|
| echo '<input class="',$css_class_name,'" type="text"'; |
echo '<input class="',$css_class_name,'" type="text"'; |
| echo ($this->readonly($k) ? ' disabled' : ''); |
echo ($this->readonly($k) ? ' disabled' : ''); |
| echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
| if ($escape) echo htmlspecialchars($row["qf$k"], ENT_COMPAT | ENT_HTML401, ''); |
if ($escape) echo $this->_htmlspecialchars($row["qf$k"]); |
| else echo $row["qf$k"]; |
else echo $row["qf$k"]; |
| echo '"',$len_props,' />',"\n"; |
echo '"',$len_props,' />',"\n"; |
| } |
} |
| Line 1270 function '.$this->js['prefix'].'filter_h |
|
| Line 1272 function '.$this->js['prefix'].'filter_h |
|
| echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password"'; |
echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password"'; |
| echo ($this->readonly($k) ? ' disabled' : ''); |
echo ($this->readonly($k) ? ' disabled' : ''); |
| echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
| echo htmlspecialchars($row["qf$k"]),'"',$len_props,' />',"\n"; |
echo $this->_htmlspecialchars($row["qf$k"]),'"',$len_props,' />',"\n"; |
| echo '</td>',"\n"; |
echo '</td>',"\n"; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| Line 1375 function '.$this->js['prefix'].'filter_h |
|
| Line 1377 function '.$this->js['prefix'].'filter_h |
|
| ? $this->substituteVars($this->fdd[$k]['URLdisp'], $ar) |
? $this->substituteVars($this->fdd[$k]['URLdisp'], $ar) |
| : $disp_val; |
: $disp_val; |
| $target = isset($this->fdd[$k]['URLtarget']) |
$target = isset($this->fdd[$k]['URLtarget']) |
| ? 'target="'.htmlspecialchars($this->fdd[$k]['URLtarget']).'" ' |
? 'target="'.$this->_htmlspecialchars($this->fdd[$k]['URLtarget']).'" ' |
| : ''; |
: ''; |
| $prefix_found = false; |
$prefix_found = false; |
| $postfix_found = false; |
$postfix_found = false; |
| Line 1401 function '.$this->js['prefix'].'filter_h |
|
| Line 1403 function '.$this->js['prefix'].'filter_h |
|
| $ret = ' '; |
$ret = ' '; |
| } else { |
} else { |
| if ($escape) { |
if ($escape) { |
| $urldisp = htmlspecialchars($urldisp); |
$urldisp = $this->_htmlspecialchars($urldisp); |
| } |
} |
| $urllink = htmlspecialchars($urllink); |
$urllink = $this->_htmlspecialchars($urllink); |
| $ret = '<a '.$target.'class="'.$css.'" href="'.$urllink.'">'.$urldisp.'</a>'; |
$ret = '<a '.$target.'class="'.$css.'" href="'.$urllink.'">'.$urldisp.'</a>'; |
| } |
} |
| return $ret; |
return $ret; |
| Line 1475 function '.$this->js['prefix'].'filter_h |
|
| Line 1477 function '.$this->js['prefix'].'filter_h |
|
| return ' '; |
return ' '; |
| } |
} |
| if ($escape) { |
if ($escape) { |
| $value = htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, ''); |
$value = $this->_htmlspecialchars($value); |
| } |
} |
| return nl2br($value); |
return nl2br($value); |
| } /* }}} */ |
} /* }}} */ |
| Line 1526 function '.$this->js['prefix'].'filter_h |
|
| Line 1528 function '.$this->js['prefix'].'filter_h |
|
| |
|
| function htmlHidden($name, $value) /* {{{ */ |
function htmlHidden($name, $value) /* {{{ */ |
| { |
{ |
| return '<input type="hidden" name="'.htmlspecialchars($name) |
return '<input type="hidden" name="'.$this->_htmlspecialchars($name) |
| .'" value="'.htmlspecialchars($value).'" />'."\n"; |
.'" value="'.$this->_htmlspecialchars($value).'" />'."\n"; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /** |
/** |
| Line 1547 function '.$this->js['prefix'].'filter_h |
|
| Line 1549 function '.$this->js['prefix'].'filter_h |
|
| function htmlSelect($name, $css, $kv_array, $selected = null, /* ...) {{{ */ |
function htmlSelect($name, $css, $kv_array, $selected = null, /* ...) {{{ */ |
| /* booleans: */ $multiple = false, $readonly = false, $strip_tags = false, $escape = true, $js = NULL) |
/* booleans: */ $multiple = false, $readonly = false, $strip_tags = false, $escape = true, $js = NULL) |
| { |
{ |
| $ret = '<select class="'.htmlspecialchars($css).'" name="'.htmlspecialchars($name); |
$ret = '<select class="'.$this->_htmlspecialchars($css).'" name="'.$this->_htmlspecialchars($name); |
| if ($multiple) { |
if ($multiple) { |
| $ret .= '[]" multiple size="'.$this->multiple; |
$ret .= '[]" multiple size="'.$this->multiple; |
| if (! is_array($selected) && $selected !== null) { |
if (! is_array($selected) && $selected !== null) { |
| Line 1563 function '.$this->js['prefix'].'filter_h |
|
| Line 1565 function '.$this->js['prefix'].'filter_h |
|
| } |
} |
| $found = false; |
$found = false; |
| foreach ($kv_array as $key => $value) { |
foreach ($kv_array as $key => $value) { |
| $ret .= '<option value="'.htmlspecialchars($key).'"'; |
$ret .= '<option value="'.$this->_htmlspecialchars($key).'"'; |
| if ((! $found || $multiple) && in_array((string)$key, $selected, 1) |
if ((! $found || $multiple) && in_array((string)$key, $selected, 1) |
| || (count($selected) == 0 && ! $found && ! $multiple)) { |
|| (count($selected) == 0 && ! $found && ! $multiple)) { |
| $ret .= ' selected="selected"'; |
$ret .= ' selected="selected"'; |
| $found = true; |
$found = true; |
| } |
} |
| $strip_tags && $value = strip_tags($value); |
$strip_tags && $value = strip_tags($value); |
| $escape && $value = htmlspecialchars($value); |
$escape && $value = $this->_htmlspecialchars($value); |
| $ret .= '>'.$value.'</option>'."\n"; |
$ret .= '>'.$value.'</option>'."\n"; |
| } |
} |
| $ret .= '</select>'; |
$ret .= '</select>'; |
| Line 1606 function '.$this->js['prefix'].'filter_h |
|
| Line 1608 function '.$this->js['prefix'].'filter_h |
|
| $found = false; |
$found = false; |
| foreach ($kv_array as $key => $value) { |
foreach ($kv_array as $key => $value) { |
| $ret .= '<input type="'.($multiple ? 'checkbox' : 'radio').'" name="'; |
$ret .= '<input type="'.($multiple ? 'checkbox' : 'radio').'" name="'; |
| $ret .= htmlspecialchars($name).'[]" value="'.htmlspecialchars($key).'"'; |
$ret .= $this->_htmlspecialchars($name).'[]" value="'.$this->_htmlspecialchars($key).'"'; |
| if ((! $found || $multiple) && in_array((string) $key, $selected, 1) |
if ((! $found || $multiple) && in_array((string) $key, $selected, 1) |
| || (count($selected) == 0 && ! $found && ! $multiple)) { |
|| (count($selected) == 0 && ! $found && ! $multiple)) { |
| $ret .= ' checked'; |
$ret .= ' checked'; |
| Line 1616 function '.$this->js['prefix'].'filter_h |
|
| Line 1618 function '.$this->js['prefix'].'filter_h |
|
| $ret .= ' disabled'; |
$ret .= ' disabled'; |
| } |
} |
| $strip_tags && $value = strip_tags($value); |
$strip_tags && $value = strip_tags($value); |
| $escape && $value = htmlspecialchars($value); |
$escape && $value = $this->_htmlspecialchars($value); |
| $ret .= '>'.$value.'<br>'."\n"; |
$ret .= '>'.$value.'<br>'."\n"; |
| } |
} |
| return $ret; |
return $ret; |
| Line 1639 function '.$this->js['prefix'].'filter_h |
|
| Line 1641 function '.$this->js['prefix'].'filter_h |
|
| } |
} |
| $ret .= '>'; |
$ret .= '>'; |
| if ($escape) { |
if ($escape) { |
| $ret .= htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, ''); |
$ret .= $this->_htmlspecialchars($value); |
| } else { |
} else { |
| $ret .= $value; |
$ret .= $value; |
| } |
} |
| Line 1692 function '.$this->js['prefix'].'filter_h |
|
| Line 1694 function '.$this->js['prefix'].'filter_h |
|
| continue; |
continue; |
| } |
} |
| $ret == '' || $ret .= '&'; |
$ret == '' || $ret .= '&'; |
| $ret .= htmlspecialchars(rawurlencode($key)); |
$ret .= $this->_htmlspecialchars(rawurlencode($key)); |
| $ret .= '='; |
$ret .= '='; |
| $ret .= htmlspecialchars(rawurlencode($val)); |
$ret .= $this->_htmlspecialchars(rawurlencode($val)); |
| } |
} |
| } |
} |
| if ($method[strlen($method) - 1] == '+') { |
if ($method[strlen($method) - 1] == '+') { |
| Line 1799 function '.$this->js['prefix'].'filter_h |
|
| Line 1801 function '.$this->js['prefix'].'filter_h |
|
| return null; |
return null; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
function _htmlspecialchars($string) /* {{{ */ |
| |
{ |
| |
if (strlen($this->ext_hsc) > 0) { |
| |
if (!function_exists($this->ext_hsc)) { // reset external function to default |
| |
$tmp = $this->ext_hsc; |
| |
$this->ext_hsc = null; |
| |
$this->error('Undefined function', 'Not exist external function "'.$tmp.'"'); |
| |
} else { // call user defined function |
| |
return call_user_func_array($this->ext_hsc, array($string)); |
| |
} |
| |
} |
| |
if ($this->ext_hsc === false) { // internal |
| |
if (PHP_MAJOR_VERSION == 5 |
| |
&& PHP_MINOR_VERSION == 4) |
| |
{ |
| |
return htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, $this->deduct_htmlspecialchars_encoding($this->encoding)); |
| |
} |
| |
if (PHP_MAJOR_VERSION == 5 |
| |
&& PHP_MINOR_VERSION == 6) |
| |
{ |
| |
return htmlspecialchars($string, ENT_QUOTES | ENT_HTML5 | ENT_DISALLOWED | ENT_SUBSTITUTE, $this->deduct_htmlspecialchars_encoding($this->encoding)); |
| |
} |
| |
} |
| |
// default PHP |
| |
return htmlspecialchars($string); |
| |
} /* }}} */ |
| |
|
| |
function deduct_htmlspecialchars_encoding($encoding) /* {{{ */ |
| |
{ |
| |
// List of supported charsets http://php.net/manual/en/function.htmlspecialchars.php |
| |
$allowed = array( |
| |
'ISO-8859-1', 'ISO8859-1', // Western European, Latin-1. |
| |
'ISO-8859-5', 'ISO8859-5', // Little used cyrillic charset (Latin/Cyrillic). |
| |
'ISO-8859-15', 'ISO8859-15', // Western European, Latin-9. Adds the Euro sign, French and Finnish letters missing in Latin-1 (ISO-8859-1). |
| |
'UTF-8', // ASCII compatible multi-byte 8-bit Unicode. |
| |
'cp866', 'ibm866', '866', // DOS-specific Cyrillic charset. |
| |
'cp1251', 'Windows-1251', 'win-1251', '1251', // Windows-specific Cyrillic charset. |
| |
'cp1252', 'Windows-1252', '1252', // Windows specific charset for Western European. |
| |
'KOI8-R', 'koi8-ru', 'koi8r', // Russian. |
| |
'BIG5', '950', // Traditional Chinese, mainly used in Taiwan. |
| |
'GB2312', '936', // Simplified Chinese, national standard character set. |
| |
'BIG5-HKSCS', // Big5 with Hong Kong extensions, Traditional Chinese. |
| |
'Shift_JIS', 'SJIS', 'SJIS-win', 'cp932', '932', // Japanese |
| |
'EUC-JP', 'EUCJP', 'eucJP-win', // Japanese |
| |
'MacRoman', // Charset that was used by Mac OS. |
| |
'' // An empty string activates detection from script encoding (Zend multibyte), default_charset and current locale (see nl_langinfo() and setlocale()), in this order. Not recommended. |
| |
); |
| |
if (in_array($encoding, $allowed)) { |
| |
return $encoding; |
| |
} |
| |
$encoding_upper = strtoupper($encoding); |
| |
foreach ($allowed as $allow) { |
| |
if (strtoupper($allow) == $encoding_upper) { |
| |
return $allow; |
| |
} |
| |
} |
| |
for ($len = strlen($encoding)-1; $len > 0; $len--) { |
| |
$encoding_prefix = substr($encoding_upper, 0, $len); |
| |
foreach ($allowed as $allow) { |
| |
if (strtoupper(substr($allow, 0, min($len, strlen($allow)))) == $encoding_prefix) { |
| |
return $allow; |
| |
} |
| |
} |
| |
} |
| |
$this->error('Unknown encoding', 'Encoding "'.$encoding.'" is not in allowed'); |
| |
return null; |
| |
} /* }}} */ |
| |
|
| /* |
/* |
| * Debug functions |
* Debug functions |
| */ |
*/ |
| Line 1874 function '.$this->js['prefix'].'filter_h |
|
| Line 1944 function '.$this->js['prefix'].'filter_h |
|
| echo 'fdd=',$this->fdd,' '; |
echo 'fdd=',$this->fdd,' '; |
| echo 'fl=',$this->fl,' '; |
echo 'fl=',$this->fl,' '; |
| echo 'fm=',$this->fm,' '; |
echo 'fm=',$this->fm,' '; |
| echo 'sfn=',htmlspecialchars($this->get_sfn_cgi_vars()),' '; |
echo 'sfn=',$this->_htmlspecialchars($this->get_sfn_cgi_vars()),' '; |
| echo 'qfn=',$this->qfn,' '; |
echo 'qfn=',$this->qfn,' '; |
| echo 'sw=',$this->sw,' '; |
echo 'sw=',$this->sw,' '; |
| echo 'rec=',$this->rec,' '; |
echo 'rec=',$this->rec,' '; |
| Line 2160 function '.$this->js['prefix'].'filter_h |
|
| Line 2230 function '.$this->js['prefix'].'filter_h |
|
| echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_comp', |
echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_comp', |
| $css_class_name, $this->comp_ops, $mc); |
$css_class_name, $this->comp_ops, $mc); |
| } |
} |
| echo '<input class="',$css_class_name,'" value="',htmlspecialchars(@$m); |
echo '<input class="',$css_class_name,'" value="',$this->_htmlspecialchars(@$m); |
| echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$len_props; |
echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$len_props; |
| echo ' onkeypress="return '.$this->js['prefix'].'filter_handler(this.form, event);" />'; |
echo ' onkeypress="return '.$this->js['prefix'].'filter_handler(this.form, event);" />'; |
| } else { |
} else { |
| Line 2180 function '.$this->js['prefix'].'filter_h |
|
| Line 2250 function '.$this->js['prefix'].'filter_h |
|
| echo '<tr class="',$css_class_name,'">',"\n"; |
echo '<tr class="',$css_class_name,'">',"\n"; |
| echo '<td class="',$css_class_name,'" colspan="',$this->sys_cols,'">'; |
echo '<td class="',$css_class_name,'" colspan="',$this->sys_cols,'">'; |
| echo '<a class="',$css_class_name,'" href="'; |
echo '<a class="',$css_class_name,'" href="'; |
| echo htmlspecialchars($this->page_name |
echo $this->_htmlspecialchars($this->page_name |
| .'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
| .'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
.'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
| .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
| Line 2201 function '.$this->js['prefix'].'filter_h |
|
| Line 2271 function '.$this->js['prefix'].'filter_h |
|
| echo '<tr class="',$css_class_name,'">',"\n"; |
echo '<tr class="',$css_class_name,'">',"\n"; |
| echo '<td class="',$css_class_name,'" colspan="',$this->sys_cols,'">'; |
echo '<td class="',$css_class_name,'" colspan="',$this->sys_cols,'">'; |
| echo '<a class="',$css_class_name,'" href="'; |
echo '<a class="',$css_class_name,'" href="'; |
| echo htmlspecialchars($this->get_server_var('PHP_SELF') |
echo $this->_htmlspecialchars($this->get_server_var('PHP_SELF') |
| .'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
| .'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
.'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
| .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
| .'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']); |
.'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']); |
| echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
| echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
| echo $this->labels['Current Query'],': ',htmlspecialchars($text_query),'</td></tr>',"\n"; |
echo $this->labels['Current Query'],': ',$this->_htmlspecialchars($text_query),'</td></tr>',"\n"; |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| Line 2241 function '.$this->js['prefix'].'filter_h |
|
| Line 2311 function '.$this->js['prefix'].'filter_h |
|
| $this->qfn != $this->prev_qfn && $this->fm = 0; |
$this->qfn != $this->prev_qfn && $this->fm = 0; |
| if (0) { // DEBUG |
if (0) { // DEBUG |
| echo 'qfn vs. prev_qfn comparsion '; |
echo 'qfn vs. prev_qfn comparsion '; |
| echo '[<b>',htmlspecialchars($this->qfn),'</b>]'; |
echo '[<b>',$this->_htmlspecialchars($this->qfn),'</b>]'; |
| echo '[<b>',htmlspecialchars($this->prev_qfn),'</b>]<br />'; |
echo '[<b>',$this->_htmlspecialchars($this->prev_qfn),'</b>]<br />'; |
| echo 'comparsion <u>',($this->qfn == $this->prev_qfn ? 'proved' : 'failed'),'</u>'; |
echo 'comparsion <u>',($this->qfn == $this->prev_qfn ? 'proved' : 'failed'),'</u>'; |
| echo '<hr size="1" />'; |
echo '<hr size="1" />'; |
| } |
} |
| Line 2313 function '.$this->js['prefix'].'filter_h |
|
| Line 2383 function '.$this->js['prefix'].'filter_h |
|
| array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k); |
array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k); |
| echo '<th class="',$css_class_name,'">'; |
echo '<th class="',$css_class_name,'">'; |
| echo '<a class="',$css_class_name,'" href="'; |
echo '<a class="',$css_class_name,'" href="'; |
| echo htmlspecialchars($this->page_name.'?'.$this->cgi['prefix']['sys'].'fm'.'=0' |
echo $this->_htmlspecialchars($this->page_name.'?'.$this->cgi['prefix']['sys'].'fm'.'=0' |
| .'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
| .'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn |
| .'&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']); |
.'&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']); |
| Line 2360 function '.$this->js['prefix'].'filter_h |
|
| Line 2430 function '.$this->js['prefix'].'filter_h |
|
| $qpcopy[] = $qp_prefix.'Copy'; |
$qpcopy[] = $qp_prefix.'Copy'; |
| $qpchange[] = $qp_prefix.'Change'; |
$qpchange[] = $qp_prefix.'Change'; |
| $qpdelete[] = $qp_prefix.'Delete'; |
$qpdelete[] = $qp_prefix.'Delete'; |
| $qpviewStr = htmlspecialchars($this->page_name.'?'.join('&',$qpview).$this->qfn); |
$qpviewStr = $this->_htmlspecialchars($this->page_name.'?'.join('&',$qpview).$this->qfn); |
| $qpcopyStr = htmlspecialchars($this->page_name.'?'.join('&',$qpcopy).$this->qfn); |
$qpcopyStr = $this->_htmlspecialchars($this->page_name.'?'.join('&',$qpcopy).$this->qfn); |
| $qpchangeStr = htmlspecialchars($this->page_name.'?'.join('&',$qpchange).$this->qfn); |
$qpchangeStr = $this->_htmlspecialchars($this->page_name.'?'.join('&',$qpchange).$this->qfn); |
| $qpdeleteStr = htmlspecialchars($this->page_name.'?'.join('&',$qpdelete).$this->qfn); |
$qpdeleteStr = $this->_htmlspecialchars($this->page_name.'?'.join('&',$qpdelete).$this->qfn); |
| } |
} |
| |
|
| $fetched = true; |
$fetched = true; |
| Line 2381 function '.$this->js['prefix'].'filter_h |
|
| Line 2451 function '.$this->js['prefix'].'filter_h |
|
| echo '<td class="',$css_class_name,'">'; |
echo '<td class="',$css_class_name,'">'; |
| } |
} |
| if ($this->nav_text_links() || $this->nav_graphic_links()) { |
if ($this->nav_text_links() || $this->nav_graphic_links()) { |
| $queryAppend = htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec); |
$queryAppend = $this->_htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec); |
| $viewQuery = $qpviewStr . $queryAppend; |
$viewQuery = $qpviewStr . $queryAppend; |
| $copyQuery = $qpcopyStr . $queryAppend; |
$copyQuery = $qpcopyStr . $queryAppend; |
| $changeQuery = $qpchangeStr . $queryAppend; |
$changeQuery = $qpchangeStr . $queryAppend; |
| $deleteQuery = $qpdeleteStr . $queryAppend; |
$deleteQuery = $qpdeleteStr . $queryAppend; |
| $viewTitle = htmlspecialchars($this->labels['View']); |
$viewTitle = $this->_htmlspecialchars($this->labels['View']); |
| $changeTitle = htmlspecialchars($this->labels['Change']); |
$changeTitle = $this->_htmlspecialchars($this->labels['Change']); |
| $copyTitle = htmlspecialchars($this->labels['Copy']); |
$copyTitle = $this->_htmlspecialchars($this->labels['Copy']); |
| $deleteTitle = htmlspecialchars($this->labels['Delete']); |
$deleteTitle = $this->_htmlspecialchars($this->labels['Delete']); |
| } |
} |
| if ($this->nav_graphic_links()) { |
if ($this->nav_graphic_links()) { |
| $printed_out = false; |
$printed_out = false; |
| Line 2456 function '.$this->js['prefix'].'filter_h |
|
| Line 2526 function '.$this->js['prefix'].'filter_h |
|
| if ($this->nav_buttons()) { |
if ($this->nav_buttons()) { |
| echo '<td class="',$css_class_name,'"><input class="',$css_class_name; |
echo '<td class="',$css_class_name,'"><input class="',$css_class_name; |
| echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec'; |
echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec'; |
| echo '" value="',htmlspecialchars($key_rec),'"'; |
echo '" value="',$this->_htmlspecialchars($key_rec),'"'; |
| if (($this->rec == '' && $first) || ($this->rec == $key_rec)) { |
if (($this->rec == '' && $first) || ($this->rec == $key_rec)) { |
| echo ' checked'; |
echo ' checked'; |
| $first = false; |
$first = false; |
| Line 3064 function '.$this->js['prefix'].'filter_h |
|
| Line 3134 function '.$this->js['prefix'].'filter_h |
|
| */ |
*/ |
| function error($message, $additional_info = '') /* {{{ */ |
function error($message, $additional_info = '') /* {{{ */ |
| { |
{ |
| echo '<h1>phpMyEdit error: ',htmlspecialchars($message),'</h1>',"\n"; |
echo '<h1>phpMyEdit error: ',$this->_htmlspecialchars($message),'</h1>',"\n"; |
| if ($additional_info != '') { |
if ($additional_info != '') { |
| echo '<hr size="1" />',htmlspecialchars($additional_info); |
echo '<hr size="1" />',$this->_htmlspecialchars($additional_info); |
| } |
} |
| return false; |
return false; |
| } /* }}} */ |
} /* }}} */ |
| Line 3244 function '.$this->js['prefix'].'filter_h |
|
| Line 3314 function '.$this->js['prefix'].'filter_h |
|
| $this->notify = @$opts['notify']; |
$this->notify = @$opts['notify']; |
| $this->logtable = @$opts['logtable']; |
$this->logtable = @$opts['logtable']; |
| $this->page_name = @$opts['page_name']; |
$this->page_name = @$opts['page_name']; |
| |
$this->encoding = @$opts['encoding']; |
| |
$this->ext_hsc = isset($opts['ext_hsc']) ? $opts['ext_hsc'] : null; |
| if (! isset($this->page_name)) { |
if (! isset($this->page_name)) { |
| $this->page_name = basename($this->get_server_var('PHP_SELF')); |
$this->page_name = basename($this->get_server_var('PHP_SELF')); |
| isset($this->page_name) || $this->page_name = $this->tb; |
isset($this->page_name) || $this->page_name = $this->tb; |