file cleanups

This patch cleans up the source code to satisfy the coding guidelines (see
http://wiki.splitbrain.org/wiki:development#coding_style)

It converts files to UNIX lineendings and removes tabs and trailing
whitespace. Not all files were cleaned yet.

darcs-hash:20060217222040-7ad00-bba3d2bee3b5aa7cbb5184258abd50805cd071bf.gz
This commit is contained in:
Andreas Gohr 2006-02-17 23:20:40 +01:00
parent 1c73890c50
commit 98c868589e
38 changed files with 3424 additions and 3424 deletions

View File

@ -26,7 +26,7 @@
$RANGE = $_REQUEST['lines'];
$HIGH = $_REQUEST['s'];
if(empty($HIGH)) $HIGH = getGoogleQuery();
$TEXT = cleanText($_POST['wikitext']);
$PRE = cleanText($_POST['prefix']);
$SUF = cleanText($_POST['suffix']);
@ -49,7 +49,7 @@
html_debug();
exit;
}
//make infos about the selected page available
$INFO = pageinfo();

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ define('HTTP_NL',"\r\n");
* @author Andreas Goetz <cpuidle@gmx.de>
*/
class DokuHTTPClient extends HTTPClient {
/**
* Constructor.
*
@ -187,7 +187,7 @@ class HTTPClient {
// stop time
$start = time();
// open socket
$socket = @fsockopen($server,$port,$errno, $errstr, $this->timeout);
if (!$socket){
@ -269,7 +269,7 @@ class HTTPClient {
}
}
}
// close socket
$status = socket_get_status($socket);
fclose($socket);
@ -286,7 +286,7 @@ class HTTPClient {
// handle headers and cookies
$this->resp_headers = $this->_parseHeaders($r_headers);
if(isset($this->resp_headers['set-cookie'])){
foreach ($this->resp_headers['set-cookie'] as $c){
foreach ($this->resp_headers['set-cookie'] as $c){
list($key, $value, $foo) = split('=', $cookie);
$this->cookies[$key] = $value;
}
@ -389,14 +389,14 @@ class HTTPClient {
* @author Andreas Goetz <cpuidle@gmx.de>
*/
function _getCookies(){
foreach ($this->cookies as $key => $val){
foreach ($this->cookies as $key => $val){
if ($headers) $headers .= '; ';
$headers .= $key.'='.$val;
}
}
if ($headers) $headers = "Cookie: $headers".HTTP_NL;
return $headers;
}
}
/**
* Encode data for posting

View File

@ -1,9 +1,9 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
/**
* Converts to and from JSON format.
*
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
@ -13,7 +13,7 @@
* to programmers of the C-family of languages, including C, C++, C#, Java,
* JavaScript, Perl, TCL, and many others. These properties make JSON an
* ideal data-interchange language.
*
*
* This package provides a simple encoder and decoder for JSON notation. It
* is intended for use with client-side Javascript applications that make
* use of HTTPRequest to perform server communication functions - data can
@ -34,7 +34,7 @@
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
@ -46,9 +46,9 @@
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @category
* @package
*
* @category
* @package
* @author Michal Migurski <mike-json@teczno.com>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
@ -96,21 +96,21 @@ define('JSON_LOOSE_TYPE', 10);
*/
define('JSON_STRICT_TYPE', 11);
/**
/**
* Converts to and from JSON format.
*
* @category
* @package
* @category
* @package
* @author Michal Migurski <mike-json@teczno.com>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
* @copyright 2005 Michal Migurski
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version
* @link
* @see
* @since
* @deprecated
* @version
* @link
* @see
* @since
* @deprecated
*/
class JSON
{
@ -147,17 +147,17 @@ class JSON
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
case 'NULL':
return 'null';
case 'integer':
return sprintf('%d', $var);
case 'double':
case 'float':
return sprintf('%f', $var);
case 'string':
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
$ascii = '';
@ -168,9 +168,9 @@ class JSON
* escaping with a slash or encoding to UTF-8 where necessary
*/
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
switch ($ord_var_c) {
case 0x08: $ascii .= '\b'; break;
case 0x09: $ascii .= '\t'; break;
@ -184,12 +184,12 @@ class JSON
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
break;
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -199,7 +199,7 @@ class JSON
$utf16 = utf8_to_utf16be($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xF0) == 0xE0):
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -211,7 +211,7 @@ class JSON
$utf16 = utf8_to_utf16be($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xF8) == 0xF0):
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -224,7 +224,7 @@ class JSON
$utf16 = utf8_to_utf16be($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xFC) == 0xF8):
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -238,7 +238,7 @@ class JSON
$utf16 = utf8_to_utf16be($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xFE) == 0xFC):
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -255,9 +255,9 @@ class JSON
break;
}
}
return '"'.$ascii.'"';
case 'array':
/*
* As per JSON spec if any array key is not an integer
@ -268,7 +268,7 @@ class JSON
* max_index which can cause memory issues and because
* the keys, which may be relevant, will be remapped
* otherwise.
*
*
* As per the ECMA and JSON specification an object may
* have any string as a property. Unfortunately due to
* a hole in the ECMA specification if the key is a
@ -276,8 +276,8 @@ class JSON
* parameter is only accessible using ECMAScript's
* bracket notation.
*/
// treat as a JSON object
// treat as a JSON object
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
return sprintf('{%s}', join(',', array_map(array($this, 'name_value'),
array_keys($var),
@ -286,18 +286,18 @@ class JSON
// treat it like a regular array
return sprintf('[%s]', join(',', array_map(array($this, 'encode'), $var)));
case 'object':
$vars = get_object_vars($var);
return sprintf('{%s}', join(',', array_map(array($this, 'name_value'),
array_keys($vars),
array_values($vars))));
array_values($vars))));
default:
return '';
}
}
/**
* encodes an arbitrary variable into JSON format, alias for encode()
*/
@ -305,7 +305,7 @@ class JSON
{
return $this->encode($var);
}
/** function name_value
* array-walking function for use in generating JSON-formatted name-value pairs
*
@ -318,7 +318,7 @@ class JSON
function name_value($name, $value)
{
return (sprintf("%s:%s", $this->encode(strval($name)), $this->encode($value)));
}
}
/**
* reduce a string by removing leading and trailing comments and whitespace
@ -331,18 +331,18 @@ class JSON
function reduce_string($str)
{
$str = preg_replace(array(
// eliminate single line comments in '// ...' form
'#^\s*//(.+)$#m',
// eliminate multi-line comments in '/* ... */' form, at start of string
'#^\s*/\*(.+)\*/#Us',
// eliminate multi-line comments in '/* ... */' form, at end of string
'#/\*(.+)\*/\s*$#Us'
), '', $str);
// eliminate extraneous space
return trim($str);
}
@ -362,17 +362,17 @@ class JSON
function decode($str)
{
$str = $this->reduce_string($str);
switch (strtolower($str)) {
case 'true':
return true;
case 'false':
return false;
case 'null':
return null;
default:
if (is_numeric($str)) {
// Lookie-loo, it's a number
@ -385,19 +385,19 @@ class JSON
return ((float)$str == (integer)$str)
? (integer)$str
: (float)$str;
} elseif (preg_match('/^("|\').+("|\')$/s', $str, $m) && $m[1] == $m[2]) {
// STRINGS RETURNED IN UTF-8 FORMAT
$delim = substr($str, 0, 1);
$chrs = substr($str, 1, -1);
$utf8 = '';
$strlen_chrs = strlen($chrs);
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
switch ($substr_chrs_c_2) {
case '\b': $utf8 .= chr(0x08); $c+=1; break;
case '\t': $utf8 .= chr(0x09); $c+=1; break;
@ -414,7 +414,7 @@ class JSON
$utf8 .= $chrs{++$c};
}
break;
default:
if (preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6))) {
// single, escaped unicode character
@ -423,30 +423,30 @@ class JSON
//$utf8 .= mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
$utf8 .= utf16be_to_utf8($utf16);
$c+=5;
} elseif(($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F)) {
$utf8 .= $chrs{$c};
} elseif(($ord_chrs_c & 0xE0) == 0xC0) {
// characters U-00000080 - U-000007FF, mask 110XXXXX
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 2); $c += 1;
} elseif(($ord_chrs_c & 0xF0) == 0xE0) {
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 3); $c += 2;
} elseif(($ord_chrs_c & 0xF8) == 0xF0) {
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 4); $c += 3;
} elseif(($ord_chrs_c & 0xFC) == 0xF8) {
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 5); $c += 4;
} elseif(($ord_chrs_c & 0xFE) == 0xFC) {
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
@ -458,9 +458,9 @@ class JSON
}
}
return $utf8;
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
@ -476,14 +476,14 @@ class JSON
$obj = new stdClass();
}
}
array_push($stk, array('what' => JSON_SLICE,
'where' => 0,
'delim' => false));
$chrs = substr($str, 1, -1);
$chrs = $this->reduce_string($chrs);
if ($chrs == '') {
if (reset($stk) == JSON_IN_ARR) {
return $arr;
@ -495,14 +495,14 @@ class JSON
}
//print("\nparsing {$chrs}\n");
$strlen_chrs = strlen($chrs);
for ($c = 0; $c <= $strlen_chrs; ++$c) {
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
@ -590,16 +590,16 @@ class JSON
// found a comment end, and we're in one now
array_pop($stk);
$c++;
for ($i = $top['where']; $i <= $c; ++$i)
$chrs = substr_replace($chrs, ' ', $i, 1);
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
}
}
if (reset($stk) == JSON_IN_ARR) {
return $arr;
@ -607,11 +607,11 @@ class JSON
return $obj;
}
}
}
}
/**
* decodes a JSON string into appropriate variable; alias for decode()
*/
@ -619,7 +619,7 @@ class JSON
{
return $this->decode($var);
}
}
?>

View File

@ -3,7 +3,7 @@
* JPEG metadata reader/writer
*
* @license PHP license 2.0 (http://www.php.net/license/2_02.txt)
* @link http://www.zonageek.com/software/php/jpeg/index.php
* @link http://www.zonageek.com/software/php/jpeg/index.php
* @author Sebastian Delmont <sdelmont@zonageek.com>
* @author Andreas Gohr <andi@splitbrain.org>
* @todo Add support for Maker Notes, Extend for GIF and PNG metadata
@ -121,7 +121,7 @@ class JpegMeta
return $info;
}
/**
* Convinience function to access nearly all available Data
* through one function
@ -154,7 +154,7 @@ class JpegMeta
}
if($info != false) break;
}
if($info === false) $info = $alt;
if(is_array($info)){
if(isset($info['val'])){
@ -214,7 +214,7 @@ class JpegMeta
if (isset($this->_info['dates'][$field])) {
return $this->_info['dates'][$field];
}
return false;
}
@ -232,7 +232,7 @@ class JpegMeta
if (isset($this->_info['file'][$field])) {
return $this->_info['file'][$field];
}
return false;
}
@ -848,7 +848,7 @@ class JpegMeta
}
return false;
}
/*************************************************************/
/* PRIVATE FUNCTIONS (Internal Use Only!) */
/*************************************************************/
@ -1325,7 +1325,7 @@ class JpegMeta
return false;
}
$pos = 0;
$pos = 0;
$this->_info['jfif'] = array();
@ -1395,7 +1395,7 @@ class JpegMeta
return false;
}
$pos = 0;
$pos = 0;
$this->_info['sof'] = array();
@ -2353,7 +2353,7 @@ class JpegMeta
}
/*************************************************************/
function _write8BIM(&$data, $pos, $type, $header, &$value)
function _write8BIM(&$data, $pos, $type, $header, &$value)
{
$signature = "8BIM";

View File

@ -39,7 +39,7 @@ function act_dispatch(){
//check if user is asking to (un)subscribe a page
if($ACT == 'subscribe' || $ACT == 'unsubscribe')
$ACT = act_subscription($ACT);
//check permissions
$ACT = act_permcheck($ACT);
@ -47,17 +47,17 @@ function act_dispatch(){
if($ACT == 'register' && register()){
$ACT = 'login';
}
if ($ACT == 'resendpwd' && act_resendpwd()) {
$ACT = 'login';
}
//update user profile
if (($ACT == 'profile') && updateprofile()) {
msg($lang['profchanged'],1);
$ACT = 'show';
}
//save
if($ACT == 'save')
$ACT = act_save($ACT);
@ -66,7 +66,7 @@ function act_dispatch(){
if(($ACT == 'edit' || $ACT == 'preview') && $INFO['editable']){
$ACT = act_edit($ACT);
}else{
unlock($ID); //try to unlock
unlock($ID); //try to unlock
}
//handle export
@ -84,12 +84,12 @@ function act_dispatch(){
// retrieve admin plugin name from $_REQUEST['page']
if ($_REQUEST['page']) {
$pluginlist = plugin_list('admin');
if (in_array($_REQUEST['page'], $pluginlist)) {
if (in_array($_REQUEST['page'], $pluginlist)) {
// attempt to load the plugin
if ($plugin =& plugin_load('admin',$_REQUEST['page']) !== NULL)
$plugin->handle();
}
}
}
/*
if($_REQUEST['page'] == 'acl'){
require_once(DOKU_INC.'inc/admin_acl.php');
@ -99,7 +99,7 @@ function act_dispatch(){
}
//call template FIXME: all needed vars available?
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=utf-8');
include(template('main.php'));
// output for the commands is now handled in inc/templates.php
// in function tpl_content()
@ -205,7 +205,7 @@ function act_save($act){
saveWikiText($ID,con($PRE,$TEXT,$SUF,1),$SUM,$_REQUEST['minor']); //use pretty mode for con
//unlock it
unlock($ID);
//show it
session_write_close();
header("Location: ".wl($ID,'',true));
@ -220,7 +220,7 @@ function act_save($act){
function act_auth($act){
global $ID;
global $INFO;
//already logged in?
if($_SERVER['REMOTE_USER'] && $act=='login')
return 'show';
@ -229,9 +229,9 @@ function act_auth($act){
if($act=='logout'){
$lockedby = checklock($ID); //page still locked?
if($lockedby == $_SERVER['REMOTE_USER'])
unlock($ID); //try to unlock
unlock($ID); //try to unlock
// do the logout stuff
// do the logout stuff
auth_logoff();
// rebuild info array
@ -318,7 +318,7 @@ function act_subscription($act){
global $ID;
global $INFO;
global $lang;
$file=metaFN($ID,'.mlist');
if ($act=='subscribe' && !$INFO['subscribed']){
if ($INFO['userinfo']['mail']){

View File

@ -37,7 +37,7 @@ function admin_acl_handler(){
if($cmd == 'save'){
admin_acl_del($scope, $user);
admin_acl_add($scope, $user, $perm);
admin_acl_add($scope, $user, $perm);
}elseif($cmd == 'delete'){
admin_acl_del($scope, $user);
}
@ -60,9 +60,9 @@ function admin_acl_handler(){
*/
function get_acl_config($id){
global $AUTH_ACL;
$acl_config=array();
// match exact name
$matches = preg_grep('/^'.$id.'\s+.*/',$AUTH_ACL);
if(count($matches)){
@ -73,7 +73,7 @@ function get_acl_config($id){
$acl_config[$acl[0]][] = array( 'name' => $acl[1], 'perm' => $acl[2]);
}
}
$specific_found=array();
// match ns
while(($id=getNS($id)) !== false){
@ -88,7 +88,7 @@ function get_acl_config($id){
}
}
}
//include *-config
$matches = preg_grep('/^\*\s+.*/',$AUTH_ACL);
if(count($matches)){
@ -102,11 +102,11 @@ function get_acl_config($id){
}
}
}
//sort
//FIXME: better sort algo: first sort by key, then sort by first value
krsort($acl_config, SORT_STRING);
return($acl_config);
}
@ -118,16 +118,16 @@ function get_acl_config($id){
*/
function admin_acl_add($acl_scope, $acl_user, $acl_level){
$acl_config = join("",file(DOKU_CONF.'acl.auth.php'));
// max level for pagenames is edit
if(strpos($acl_scope,'*') === false) {
if($acl_level > AUTH_EDIT) $acl_level = AUTH_EDIT;
}
$new_acl = "$acl_scope\t$acl_user\t$acl_level\n";
$new_config = $acl_config.$new_acl;
return io_saveFile(DOKU_CONF.'acl.auth.php', $new_config);
}
@ -140,10 +140,10 @@ function admin_acl_del($acl_scope, $acl_user){
$acl_config = file(DOKU_CONF.'acl.auth.php');
$acl_pattern = '^'.preg_quote($acl_scope,'/').'\s+'.$acl_user.'\s+[0-8].*$';
// save all non!-matching #FIXME invert is available from 4.2.0 only!
$new_config = preg_grep("/$acl_pattern/", $acl_config, PREG_GREP_INVERT);
return io_saveFile(DOKU_CONF.'acl.auth.php', join('',$new_config));
}
@ -172,7 +172,7 @@ function admin_acl_html(){
//current config
$acls = get_acl_config($ID);
foreach ($acls as $id => $acl){
admin_acl_html_current($id,$acl);
admin_acl_html_current($id,$acl);
}
ptln('</table>');
@ -246,10 +246,10 @@ function admin_acl_html_new(){
ptln(' <input type="hidden" name="do" value="admin" />',4);
ptln(' <input type="hidden" name="page" value="acl" />',4);
ptln(' <input type="hidden" name="acl_cmd" value="save" />',4);
//scope select
ptln($lang['acl_perms'],4);
ptln(admin_acl_html_dropdown($ID),4);
ptln(admin_acl_html_dropdown($ID),4);
$att = array( 'name' => 'acl_type',
'class' => 'edit',
@ -384,7 +384,7 @@ function admin_acl_html_checkboxes($setperm,$ispage){
'value' => $perm );
//dynamic attributes
if($setperm >= $perm) $atts['checked'] = 'checked';
# if($perm > AUTH_READ) $atts['onchange'] = #FIXME JS to autoadd lower perms
# if($perm > AUTH_READ) $atts['onchange'] = #FIXME JS to autoadd lower perms
if($ispage && $perm > AUTH_EDIT) $atts['disabled'] = 'disabled';
//build code

View File

@ -74,7 +74,7 @@ class Aspell{
var $encoding = 'iso8859-1';
var $mode = PSPELL_NORMAL;
var $version = 0;
var $args='';
/**
@ -86,7 +86,7 @@ class Aspell{
$this->language = $language;
$this->jargon = $jargon;
$this->encoding = $encoding;
}
}
/**
* Set the spelling mode like pspell_config_mode()
@ -187,7 +187,7 @@ class Aspell{
$string = "^".str_replace("\n", "\n^",$text);
fwrite($pipes[0],$string); // send text to Aspell
fclose($pipes[0]);
// read Aspells response from stdin
while (!feof($pipes[1])) {
$out .= fread($pipes[1], 8192);
@ -201,7 +201,7 @@ class Aspell{
$tmp = array();
preg_match('/^\@.*Aspell (\d+)\.(\d+).(\d+)/',$out,$tmp);
$this->version = $tmp[1]*100 + $tmp[2]*10 + $tmp[3];
if ($this->version <= 603) // version 0.60.3
$r = $terse ? "\n*\n\$1" : "\n\$1"; // replacement for broken Aspell
else

View File

@ -2,12 +2,12 @@
/**
* auth/basic.class.php
*
* foundation authorisation class
* foundation authorisation class
* all auth classes should inherit from this class
*
* @author Chris Smith <chris@jalakai.co.uk>
*/
class auth_basic {
var $success = true;
@ -40,11 +40,11 @@ class auth_basic {
* Carry out sanity checks to ensure the object is
* able to operate. Set capabilities in $this->cando
* array here
*
*
* Set $this->success to false if checks fail
*
* @author Christopher Smith <chris@jalakai.co.uk>
*/
*/
function auth_basic() {
// the base class constructor does nothing, derived class
// constructors do the real work
@ -166,7 +166,7 @@ class auth_basic {
msg("no valid authorisation system in use", -1);
return false;
}
/**
* Return user info [ MUST BE OVERRIDDEN ]
*
@ -184,13 +184,13 @@ class auth_basic {
msg("no valid authorisation system in use", -1);
return false;
}
/**
* Create a new User [implement only where required/possible]
*
* Returns false if the user already exists, null when an error
* occured and true if everything went well.
*
*
* The new user HAS TO be added to the default group by this
* function!
*
@ -202,7 +202,7 @@ class auth_basic {
msg("authorisation method does not allow creation of new users", -1);
return null;
}
/**
* Modify user data [implement only where required/possible]
*
@ -217,7 +217,7 @@ class auth_basic {
msg("authorisation method does not allow modifying of user data", -1);
return false;
}
/**
* Delete one or more users [implement only where required/possible]
*
@ -244,7 +244,7 @@ class auth_basic {
msg("authorisation method does not provide user counts", -1);
return 0;
}
/**
* Bulk retrieval of user data [implement only where required/possible]
*
@ -260,10 +260,10 @@ class auth_basic {
msg("authorisation method does not support mass retrieval of user data", -1);
return array();
}
/**
* Define a group [implement only where required/possible]
*
*
* Set addGroup capability when implemented
*
* @author Chris Smith <chris@jalakai.co.uk>
@ -276,7 +276,7 @@ class auth_basic {
/**
* Retrieve groups [implement only where required/possible]
*
*
* Set getGroups capability when implemented
*
* @author Chris Smith <chris@jalakai.co.uk>

View File

@ -2,12 +2,12 @@
/**
* auth/basic.class.php
*
* foundation authorisation class
* foundation authorisation class
* all auth classes should inherit from this class
*
* @author Chris Smith <chris@jalakaic.co.uk>
*/
class auth_ldap extends auth_basic {
var $cnf = null;
var $con = null;
@ -28,17 +28,17 @@ class auth_ldap extends auth_basic {
// capabilities are set
}
/**
* Check user+password
*
* Checks if the given user exists and the given
* plaintext password is correct by trying to bind
/**
* Check user+password
*
* Checks if the given user exists and the given
* plaintext password is correct by trying to bind
* to the LDAP server
*
* @author Andreas Gohr <andi@splitbrain.org>
* @return bool
*/
function checkPass($user,$pass){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @return bool
*/
function checkPass($user,$pass){
// reject empty password
if(empty($pass)) return false;
if(!$this->_openLDAP()) return false;
@ -108,17 +108,17 @@ class auth_ldap extends auth_basic {
}
return false;
}
/**
* Return user info [ MUST BE OVERRIDDEN ]
*
* Returns info about the given user needs to contain
* at least these fields:
*
* name string full name of the user
* mail string email addres of the user
* grps array list of groups the user is in
}
/**
* Return user info [ MUST BE OVERRIDDEN ]
*
* Returns info about the given user needs to contain
* at least these fields:
*
* name string full name of the user
* mail string email addres of the user
* grps array list of groups the user is in
*
* This LDAP specific function returns the following
* addional fields:
@ -130,9 +130,9 @@ class auth_ldap extends auth_basic {
* @author Trouble
* @author Dan Allen <dan.j.allen@gmail.com>
* @auhtor <evaldas.auryla@pheur.org>
* @return array containing user data or false
* @return array containing user data or false
*/
function getUserData($user) {
function getUserData($user) {
global $conf;
if(!$this->_openLDAP()) return false;
@ -227,8 +227,8 @@ class auth_ldap extends auth_basic {
}
return $info;
}
}
/**
* Make LDAP filter strings.
*
@ -237,7 +237,7 @@ class auth_ldap extends auth_basic {
*
* filter string ldap search filter with placeholders
* placeholders array array with the placeholders
*
*
* @author Troels Liebe Bentsen <tlb@rapanden.dk>
* @return string
*/
@ -254,7 +254,7 @@ class auth_ldap extends auth_basic {
$filter = str_replace('%{'.$match.'}', $value, $filter);
}
return $filter;
}
}
/**
* Opens a connection to the configured LDAP server and sets the wnated

View File

@ -7,19 +7,19 @@
* @author Chris Smith <chris@jalakai.co.uk>
* @author Matthias Grimm <matthias.grimmm@sourceforge.net>
*/
define('DOKU_AUTH', dirname(__FILE__));
define('DOKU_AUTH', dirname(__FILE__));
require_once(DOKU_AUTH.'/basic.class.php');
class auth_mysql extends auth_basic {
var $dbcon = 0;
var $dbver = 0; // database version
var $dbrev = 0; // database revision
var $dbsub = 0; // database subrevision
var $cnf = null;
var $defaultgroup = "";
/**
* Constructor
*
@ -30,17 +30,17 @@ class auth_mysql extends auth_basic {
*/
function auth_mysql() {
global $conf;
if (method_exists($this, 'auth_basic'))
parent::auth_basic();
if(!function_exists('mysql_connect')) {
if ($this->cnf['debug'])
msg("MySQL err: PHP MySQL extension not found.",-1);
$this->success = false;
return;
}
$this->cnf = $conf['auth']['mysql'];
$this->defaultgroup = $conf['defaultgroup'];
@ -82,7 +82,7 @@ class auth_mysql extends auth_basic {
}
/**
* Check if the given config strings are set
* Check if the given config strings are set
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
* @return bool
@ -115,16 +115,16 @@ class auth_mysql extends auth_basic {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
*/
function checkPass($user,$pass){
$rc = false;
if($this->_openDB()) {
$sql = str_replace('%{user}',addslashes($user),$this->cnf['checkPass']);
$sql = str_replace('%{pass}',addslashes($pass),$sql);
$sql = str_replace('%{dgroup}',addslashes($this->defaultgroup),$sql);
$result = $this->_queryDB($sql);
if($result !== false && count($result) == 1) {
if($this->cnf['forwardClearPass'] == 1)
$rc = true;
@ -145,7 +145,7 @@ class auth_mysql extends auth_basic {
* mail string email addres of the user
* grps array list of groups the user is in
*
* @param $user user's nick to get data for
* @param $user user's nick to get data for
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
@ -166,7 +166,7 @@ class auth_mysql extends auth_basic {
*
* Create a new User. Returns false if the user already exists,
* null when an error occured and true if everything went well.
*
*
* The new user will be added to the default group by this
* function if grps are not specified (default behaviour).
*
@ -188,7 +188,7 @@ class auth_mysql extends auth_basic {
// set defaultgroup if no groups were given
if ($grps == null)
$grps = array($this->defaultgroup);
$this->_lockTables("WRITE");
$pwd = $this->cnf['forwardClearPass'] ? $pwd : auth_cryptPassword($pwd);
$rc = $this->_addUser($user,$pwd,$name,$mail,$grps);
@ -198,12 +198,12 @@ class auth_mysql extends auth_basic {
}
return null; // return error
}
/**
* Modify user data [public function]
*
* An existing user dataset will be modified. Changes are given in an array.
*
*
* The dataset update will be rejected if the user name should be changed
* to an already existing one.
*
@ -229,10 +229,10 @@ class auth_mysql extends auth_basic {
*/
function modifyUser($user, $changes) {
$rc = false;
if (!is_array($changes) || !count($changes))
return true; // nothing to change
if($this->_openDB()) {
$this->_lockTables("WRITE");
@ -243,17 +243,17 @@ class auth_mysql extends auth_basic {
$groups = $this->_getGroups($user);
$grpadd = array_diff($changes['grps'], $groups);
$grpdel = array_diff($groups, $changes['grps']);
foreach($grpadd as $group)
if (($this->_addUserToGroup($uid, $group, 1)) == false)
$rc = false;
foreach($grpdel as $group)
if (($this->_delUserFromGroup($uid, $group)) == false)
$rc = false;
}
}
}
$this->_unlockTables();
$this->_closeDB();
}
@ -273,7 +273,7 @@ class auth_mysql extends auth_basic {
*/
function deleteUsers($users) {
$count = 0;
if($this->_openDB()) {
if (is_array($users) && count($users)) {
$this->_lockTables("WRITE");
@ -287,7 +287,7 @@ class auth_mysql extends auth_basic {
}
return $count;
}
/**
* [public function]
*
@ -300,10 +300,10 @@ class auth_mysql extends auth_basic {
*/
function getUserCount($filter=array()) {
$rc = 0;
if($this->_openDB()) {
$sql = $this->_createSQLFilter($this->cnf['getUsers'], $filter);
if ($this->dbver >= 4) {
$sql = substr($sql, 6); /* remove 'SELECT' or 'select' */
$sql = "SELECT SQL_CALC_FOUND_ROWS".$sql." LIMIT 1";
@ -312,12 +312,12 @@ class auth_mysql extends auth_basic {
$rc = $result[0]['FOUND_ROWS()'];
} else if (($result = $this->_queryDB($sql)))
$rc = count($result);
$this->_closeDB();
}
return $rc;
}
/**
* Bulk retrieval of user data. [public function]
*
@ -330,7 +330,7 @@ class auth_mysql extends auth_basic {
*/
function retrieveUsers($first=0,$limit=10,$filter=array()) {
$out = array();
if($this->_openDB()) {
$this->_lockTables("READ");
$sql = $this->_createSQLFilter($this->cnf['getUsers'], $filter);
@ -340,7 +340,7 @@ class auth_mysql extends auth_basic {
foreach ($result as $user)
if (($info = $this->_getUserInfo($user['user'])))
$out[$user['user']] = $info;
$this->_unlockTables();
$this->_closeDB();
}
@ -349,16 +349,16 @@ class auth_mysql extends auth_basic {
/**
* Give user membership of a group [public function]
*
*
* @param $user
* @param $group
* @param $group
* @return bool true on success, false on error
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
function joinGroup($user, $group) {
$rc = false;
if ($this->_openDB()) {
$this->_lockTables("WRITE");
$uid = $this->_getUserID($user);
@ -380,7 +380,7 @@ class auth_mysql extends auth_basic {
*/
function leaveGroup($user, $group) {
$rc = false;
if ($this->_openDB()) {
$this->_lockTables("WRITE");
$uid = $this->_getUserID($user);
@ -390,7 +390,7 @@ class auth_mysql extends auth_basic {
}
return $rc;
}
/**
* Adds a user to a group.
*
@ -410,7 +410,7 @@ class auth_mysql extends auth_basic {
*/
function _addUserToGroup($uid, $group, $force=0) {
$newgroup = 0;
if (($this->dbcon) && ($uid)) {
$gid = $this->_getGroupID($group);
if (!$gid) {
@ -421,7 +421,7 @@ class auth_mysql extends auth_basic {
}
if (!$gid) return false; // group didn't exist and can't be created
}
$sql = str_replace('%{uid}', addslashes($uid),$this->cnf['addUserGroup']);
$sql = str_replace('%{user}', addslashes($user),$sql);
$sql = str_replace('%{gid}', addslashes($gid),$sql);
@ -448,7 +448,7 @@ class auth_mysql extends auth_basic {
*/
function _delUserFromGroup($uid, $group) {
$rc = false;
if (($this->dbcon) && ($uid)) {
$gid = $this->_getGroupID($group);
if ($gid) {
@ -461,7 +461,7 @@ class auth_mysql extends auth_basic {
}
return $rc;
}
/**
* Retrieves a list of groups the user is a member off.
*
@ -477,11 +477,11 @@ class auth_mysql extends auth_basic {
*/
function _getGroups($user) {
$groups = array();
if($this->dbcon) {
$sql = str_replace('%{user}',addslashes($user),$this->cnf['getGroups']);
$result = $this->_queryDB($sql);
if(count($result)) {
foreach($result as $row)
$groups[] = $row['group'];
@ -493,7 +493,7 @@ class auth_mysql extends auth_basic {
/**
* Retrieves the user id of a given user name
*
*
* The database connection must already be established
* for this function to work. Otherwise it will return
* 'false'.
@ -511,7 +511,7 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Adds a new User to the database.
*
@ -535,16 +535,16 @@ class auth_mysql extends auth_basic {
$sql = str_replace('%{user}', addslashes($user),$this->cnf['addUser']);
$sql = str_replace('%{pass}', addslashes($pwd),$sql);
$sql = str_replace('%{name}', addslashes($name),$sql);
$sql = str_replace('%{email}',addslashes($mail),$sql);
$sql = str_replace('%{email}',addslashes($mail),$sql);
$uid = $this->_modifyDB($sql);
if ($uid) {
foreach($grps as $group) {
$uid = $this->_getUserID($user);
$gid = $this->_addUserToGroup($uid, $group, 1);
if ($gid === false) break;
}
if ($gid) return true;
else {
/* remove the new user and all group relations if a group can't
@ -560,10 +560,10 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Deletes a given user and all his group references.
*
*
* The database connection must already be established
* for this function to work. Otherwise it will return
* 'false'.
@ -638,7 +638,7 @@ class auth_mysql extends auth_basic {
if($this->dbcon) {
foreach ($changes as $item => $value) {
if ($item == 'user') {
if ($item == 'user') {
if (($this->_getUserID($changes['user']))) {
$err = 1; /* new username already exists */
break; /* abort update */
@ -673,7 +673,7 @@ class auth_mysql extends auth_basic {
/**
* Retrieves the group id of a given group name
*
*
* The database connection must already be established
* for this function to work. Otherwise it will return
* 'false'.
@ -691,19 +691,19 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Opens a connection to a database and saves the handle for further
* usage in the object. The successful call to this functions is
* essential for most functions in this object.
*
*
* @return bool
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
function _openDB() {
if (!$this->dbcon) {
$con = @mysql_connect ($this->cnf['server'], $this->cnf['user'], $this->cnf['password']);
$con = @mysql_connect ($this->cnf['server'], $this->cnf['user'], $this->cnf['password']);
if ($con) {
if ((mysql_select_db($this->cnf['database'], $con))) {
if ((preg_match("/^(\d+)\.(\d+)\.(\d+).*/", mysql_get_server_info ($con), $result)) == 1) {
@ -711,13 +711,13 @@ class auth_mysql extends auth_basic {
$this->dbrev = $result[2];
$this->dbsub = $result[3];
}
$this->dbcon = $con;
$this->dbcon = $con;
return true; // connection and database successfully opened
} else {
mysql_close ($con);
if ($this->cnf['debug'])
msg("MySQL err: No access to database {$this->cnf['database']}.", -1);
}
}
} else if ($this->cnf['debug'])
msg ("MySQL err: Connection to {$this->cnf['user']}@{$this->cnf['server']} not possible.", -1);
@ -725,7 +725,7 @@ class auth_mysql extends auth_basic {
}
return true; // connection already open
}
/**
* Closes a database connection.
*
@ -737,19 +737,19 @@ class auth_mysql extends auth_basic {
$this->dbcon = 0;
}
}
/**
* Sends a SQL query to the database and transforms the result into
* an associative array.
*
* This function is only able to handle queries that returns a
*
* This function is only able to handle queries that returns a
* table such as SELECT.
*
* @param $query SQL string that contains the query
* @return array with the result table
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
*/
function _queryDB($query) {
if ($this->dbcon) {
$result = @mysql_query($query,$this->dbcon);
@ -764,10 +764,10 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Sends a SQL query to the database
*
*
* This function is only able to handle queries that returns
* either nothing or an id value such as INPUT, DELETE, UPDATE, etc.
*
@ -775,7 +775,7 @@ class auth_mysql extends auth_basic {
* @return insert id or 0, false on error
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
*/
function _modifyDB($query) {
if ($this->dbcon) {
$result = @mysql_query($query,$this->dbcon);
@ -788,7 +788,7 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Locked a list of tables for exclusive access so that modifications
* to the database can't be disturbed by other threads. The list
@ -806,7 +806,7 @@ class auth_mysql extends auth_basic {
* @param $mode could be 'READ' or 'WRITE'
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
*/
function _lockTables($mode) {
if ($this->dbcon) {
if (is_array($this->cnf['TablesToLock']) && !empty($this->cnf['TablesToLock'])) {
@ -830,7 +830,7 @@ class auth_mysql extends auth_basic {
* abrogated.
*
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
*/
*/
function _unlockTables() {
if ($this->dbcon) {
$this->_modifyDB("UNLOCK TABLES");
@ -838,7 +838,7 @@ class auth_mysql extends auth_basic {
}
return false;
}
/**
* Transforms the filter settings in an filter string for a SQL database
* The database connection must already be established, otherwise the
@ -854,7 +854,7 @@ class auth_mysql extends auth_basic {
function _createSQLFilter($sql, $filter) {
$SQLfilter = "";
$cnt = 0;
if ($this->dbcon) {
foreach ($filter as $item => $pattern) {
$tmp = addslashes('%'.mysql_real_escape_string($pattern, $this->dbcon).'%');
@ -872,11 +872,11 @@ class auth_mysql extends auth_basic {
$SQLfilter .= str_replace('%{group}',$tmp,$this->cnf['FilterGroup']);
}
}
// we have to check SQLfilter here and must not use $cnt because if
// any of cnf['Filter????'] is not defined, a malformed SQL string
// would be generated.
if (strlen($SQLfilter)) {
$glue = strpos(strtolower($sql),"where") ? " AND " : " WHERE ";
$sql = $sql.$glue.$SQLfilter;
@ -885,8 +885,8 @@ class auth_mysql extends auth_basic {
return $sql;
}
}
//Setup VIM: ex: et ts=2 enc=utf-8 :

View File

@ -6,8 +6,8 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Chris Smith <chris@jalakai.co.uk>
*/
define('DOKU_AUTH', dirname(__FILE__));
define('DOKU_AUTH', dirname(__FILE__));
require_once(DOKU_AUTH.'/basic.class.php');
define('AUTH_USERFILE',DOKU_CONF.'users.auth.php');
@ -15,22 +15,22 @@ define('AUTH_USERFILE',DOKU_CONF.'users.auth.php');
// we only accept page ids for auth_plain
if(isset($_REQUEST['u']))
$_REQUEST['u'] = cleanID($_REQUEST['u']);
class auth_plain extends auth_basic {
var $users = null;
var $_pattern = array();
/**
* Constructor
*
* Carry out sanity checks to ensure the object is
* able to operate. Set capabilities.
*
/**
* Constructor
*
* Carry out sanity checks to ensure the object is
* able to operate. Set capabilities.
*
* @author Christopher Smith <chris@jalakai.co.uk>
*/
function auth_plain() {
if (!@is_readable(AUTH_USERFILE)){
*/
function auth_plain() {
if (!@is_readable(AUTH_USERFILE)){
$this->success = false;
}else{
if(@is_writable(AUTH_USERFILE)){
@ -45,7 +45,7 @@ class auth_plain extends auth_basic {
$this->cando['getUsers'] = true;
$this->cando['getUserCount'] = true;
}
}
}
/**
* Check user+password [required auth function]
@ -57,10 +57,10 @@ class auth_plain extends auth_basic {
* @return bool
*/
function checkPass($user,$pass){
$userinfo = $this->getUserData($user);
if ($userinfo === false) return false;
return auth_verifyPassword($pass,$this->users[$user]['pass']);
}
@ -87,7 +87,7 @@ class auth_plain extends auth_basic {
*
* Returns false if the user already exists, null when an error
* occured and true if everything went well.
*
*
* The new user will be added to the default group by this
* function if grps are not specified (default behaviour).
*
@ -96,28 +96,28 @@ class auth_plain extends auth_basic {
*/
function createUser($user,$pwd,$name,$mail,$grps=null){
global $conf;
// user mustn't already exist
if ($this->getUserData($user) !== false) return false;
$pass = auth_cryptPassword($pwd);
// set default group if no groups specified
if (!is_array($grps)) $grps = array($conf['defaultgroup']);
// prepare user line
$groups = join(',',$grps);
$groups = join(',',$grps);
$userline = join(':',array($user,$pass,$name,$mail,$groups))."\n";
if (io_saveFile(AUTH_USERFILE,$userline,true)) {
$this->users[$user] = compact('pass','name','mail','grps');
return $pwd;
}
msg('The '.AUTH_USERFILE.' file is not writable. Please inform the Wiki-Admin',-1);
return null;
}
/**
* Modify user data
*
@ -130,7 +130,7 @@ class auth_plain extends auth_basic {
global $conf;
global $ACT;
global $INFO;
// sanity checks, user must already exist and there must be something to change
if (($userinfo = $this->getUserData($user)) === false) return false;
if (!is_array($changes) || !count($changes)) return true;
@ -138,31 +138,31 @@ class auth_plain extends auth_basic {
// update userinfo with new data, remembering to encrypt any password
$newuser = $user;
foreach ($changes as $field => $value) {
if ($field == 'user') {
if ($field == 'user') {
$newuser = $value;
continue;
}
if ($field == 'pass') $value = auth_cryptPassword($value);
$userinfo[$field] = $value;
}
$groups = join(',',$userinfo['grps']);
$userline = join(':',array($newuser, $userinfo['pass'], $userinfo['name'], $userinfo['mail'], $groups))."\n";
if (!$this->deleteUsers(array($user))) {
msg('Unable to modify user data. Please inform the Wiki-Admin',-1);
return false;
}
if (!io_saveFile(AUTH_USERFILE,$userline,true)) {
msg('There was an error modifying your user data. You should register again.',-1);
// FIXME, user has been deleted but not recreated, should force a logout and redirect to login page
$ACT == 'register';
return false;
}
$this->users[$newuser] = $userinfo;
return true;
return true;
}
/**
@ -173,18 +173,18 @@ class auth_plain extends auth_basic {
* @return int the number of users deleted
*/
function deleteUsers($users) {
if (!is_array($users) || empty($users)) return 0;
if ($this->users === null) $this->_loadUserData();
$deleted = array();
foreach ($users as $user) {
if (isset($this->users[$user])) $deleted[] = preg_quote($user,'/');
}
if (empty($deleted)) return 0;
$pattern = '/^('.join('|',$deleted).'):/';
if (io_deleteFromFile(AUTH_USERFILE,$pattern,true)) {
@ -198,7 +198,7 @@ class auth_plain extends auth_basic {
$count -= $count($this->users());
return $count;
}
/**
* Return a count of the number of user which meet $filter criteria
*
@ -208,18 +208,18 @@ class auth_plain extends auth_basic {
if($this->users === null) $this->_loadUserData();
if (!count($filter)) return count($this->users);
if (!count($filter)) return count($this->users);
$count = 0;
$this->_constructPattern($filter);
foreach ($this->users as $user => $info) {
$count += $this->_filter($user, $info);
}
return $count;
}
/**
* Bulk retrieval of user data
*
@ -234,12 +234,12 @@ class auth_plain extends auth_basic {
if ($this->users === null) $this->_loadUserData();
ksort($this->users);
$i = 0;
$count = 0;
$out = array();
$this->_constructPattern($filter);
foreach ($this->users as $user => $info) {
if ($this->_filter($user, $info)) {
if ($i >= $start) {
@ -253,7 +253,7 @@ class auth_plain extends auth_basic {
return $out;
}
/**
* Load all user data
*
@ -265,23 +265,23 @@ class auth_plain extends auth_basic {
$this->users = array();
if(!@file_exists(AUTH_USERFILE)) return;
$lines = file(AUTH_USERFILE);
foreach($lines as $line){
$line = preg_replace('/#.*$/','',$line); //ignore comments
$line = trim($line);
if(empty($line)) continue;
$row = split(":",$line,5);
$groups = split(",",$row[4]);
$this->users[$row[0]]['pass'] = $row[1];
$this->users[$row[0]]['name'] = urldecode($row[2]);
$this->users[$row[0]]['mail'] = $row[3];
$this->users[$row[0]]['grps'] = $groups;
}
}
/**
* return 1 if $user + $info match $filter criteria, 0 otherwise
*
@ -300,14 +300,14 @@ class auth_plain extends auth_basic {
}
return 1;
}
function _constructPattern($filter) {
$this->_pattern = array();
foreach ($filter as $item => $pattern) {
// $this->_pattern[$item] = '/'.preg_quote($pattern,"/").'/'; // don't allow regex characters
$this->_pattern[$item] = '/'.str_replace('/','\/',$pattern).'/'; // allow regex characters
}
}
}
}
//Setup VIM: ex: et ts=2 enc=utf-8 :

View File

@ -24,8 +24,8 @@ class auth_punbb extends auth_mysql {
*/
function auth_punbb(){
global $conf;
$this->cando['external'] = true;
$this->cando['logoff'] = true;
$this->cando['external'] = true;
$this->cando['logoff'] = true;
// make sure we use a crypt understood by punbb
if(function_exists('sha1')){
@ -73,7 +73,7 @@ class auth_punbb extends auth_mysql {
(username, password, email, realname)
VALUES ('%{user}', '%{pass}', '%{email}', '%{name}')";
$conf['auth']['mysql']['addGroup'] = "INSERT INTO ${db_prefix}groups (g_title) VALUES ('%{group}')";
$conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
$conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
SET group_id=%{gid}
WHERE id='%{uid}'";
$conf['auth']['mysql']['delGroup'] = "DELETE FROM ${db_prefix}groups WHERE g_id='%{gid}'";

View File

@ -32,18 +32,18 @@ if (version_compare(phpversion(), '4.3.0', '<') || php_sapi_name() == 'cgi') {
// Handle output buffering
@ob_end_flush();
ob_implicit_flush(TRUE);
// PHP ini settings
set_time_limit(0);
ini_set('track_errors', TRUE);
ini_set('html_errors', FALSE);
ini_set('magic_quotes_runtime', FALSE);
// Define stream constants
define('STDIN', fopen('php://stdin', 'r'));
define('STDOUT', fopen('php://stdout', 'w'));
define('STDERR', fopen('php://stderr', 'w'));
// Close the streams on script termination
register_shutdown_function(
create_function('',
@ -69,7 +69,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
*
*/
class Doku_Cli_Opts {
/**
* <?php ?>
* @see http://www.sitepoint.com/article/php-command-line-1/3
@ -80,40 +80,40 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
*/
function & getOptions($bin_file, $short_options, $long_options = null) {
$args = Doku_Cli_Opts::readPHPArgv();
if ( Doku_Cli_Opts::isError($args) ) {
return $args;
}
// Compatibility between "php extensions.php" and "./extensions.php"
if ( realpath($_SERVER['argv'][0]) == $bin_file ) {
$options = Doku_Cli_Opts::getOpt($args,$short_options,$long_options);
} else {
$options = Doku_Cli_Opts::getOpt2($args,$short_options,$long_options);
}
if ( Doku_Cli_Opts::isError($options) ) {
return $options;
}
$container = new Doku_Cli_Opts_Container($options);
return $container;
}
function getopt2($args, $short_options, $long_options = null) {
return Doku_Cli_Opts::doGetopt(
2, $args, $short_options, $long_options
);
}
function getopt($args, $short_options, $long_options = null) {
return Doku_Cli_Opts::doGetopt(
1, $args, $short_options, $long_options
);
}
function doGetopt($version, $args, $short_options, $long_options = null) {
// in case you pass directly readPHPArgv() as the first arg
if (Doku_Cli_Opts::isError($args)) {
return $args;
@ -123,13 +123,13 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
}
$opts = array();
$non_opts = array();
settype($args, 'array');
if ($long_options && is_array($long_options)) {
sort($long_options);
}
/*
* Preserve backwards compatibility with callers that relied on
* erroneous POSIX fix.
@ -139,10 +139,10 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
array_shift($args);
}
}
reset($args);
while (list($i, $arg) = each($args)) {
/* The special element '--' means explicit end of
options. Treat the rest of the arguments as non-options
and end the loop. */
@ -150,7 +150,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
$non_opts = array_merge($non_opts, array_slice($args, $i + 1));
break;
}
if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
$non_opts = array_merge($non_opts, array_slice($args, $i));
break;
@ -164,15 +164,15 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
return $error;
}
}
return array($opts, $non_opts);
}
function _parseShortOption($arg, $short_options, &$opts, &$args) {
for ($i = 0; $i < strlen($arg); $i++) {
$opt = $arg{$i};
$opt_arg = null;
/* Try to find the short option in the specifier string. */
if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':')
{
@ -181,7 +181,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
"Unrecognized option -- $opt"
);
}
if (strlen($spec) > 1 && $spec{1} == ':') {
if (strlen($spec) > 2 && $spec{2} == ':') {
if ($i + 1 < strlen($arg)) {
@ -205,25 +205,25 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
);
}
}
$opts[] = array($opt, $opt_arg);
}
}
function _parseLongOption($arg, $long_options, &$opts, &$args) {
@list($opt, $opt_arg) = explode('=', $arg);
$opt_len = strlen($opt);
for ($i = 0; $i < count($long_options); $i++) {
$long_opt = $long_options[$i];
$opt_start = substr($long_opt, 0, $opt_len);
/* Option doesn't match. Go on to the next one. */
if ($opt_start != $opt)
continue;
$opt_rest = substr($long_opt, $opt_len);
/* Check that the options uniquely matches one of the allowed
options. */
if ($opt_rest != '' && $opt{0} != '=' &&
@ -234,7 +234,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
"Option --$opt is ambiguous"
);
}
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
/* Long option requires an argument.
@ -252,17 +252,17 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
"Option --$opt doesn't allow an argument"
);
}
$opts[] = array('--' . $opt, $opt_arg);
return;
}
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_UNKNOWN_OPT,
"Unrecognized option --$opt"
);
}
function readPHPArgv() {
global $argv;
if (!is_array($argv)) {
@ -279,11 +279,11 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
}
return $argv;
}
function raiseError($code, $msg) {
return new Doku_Cli_Opts_Error($code, $msg);
}
function isError($obj) {
return is_a($obj, 'Doku_Cli_Opts_Error');
}
@ -292,31 +292,31 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
//------------------------------------------------------------------------------
class Doku_Cli_Opts_Error {
var $code;
var $msg;
function Doku_Cli_Opts_Error($code, $msg) {
$this->code = $code;
$this->msg = $msg;
}
function getMessage() {
return $this->msg;
}
function isError() {
return TRUE;
}
}
//------------------------------------------------------------------------------
class Doku_Cli_Opts_Container {
var $options = array();
var $args = array();
function Doku_Cli_Opts_Container($options) {
foreach ( $options[0] as $option ) {
if ( FALSE !== ( strpos($option[0], '--') ) ) {
@ -326,35 +326,35 @@ class Doku_Cli_Opts_Container {
}
$this->options[$opt_name] = $option[1];
}
$this->args = $options[1];
}
function has($option) {
return array_key_exists($option, $this->options);
}
function get($option) {
if ( isset($this->options[$option]) ) {
return ( $this->options[$option] ) ;
}
}
function arg($index) {
if ( isset($this->args[$index]) ) {
return $this->args[$index];
}
}
function numArgs() {
return count($this->args);
}
function hasArgs() {
return count($this->args) !== 0;
}
function isError() {
return FALSE;
}

View File

@ -1,7 +1,7 @@
<?php
/**
* Utilities for collecting data from config files
*
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Harry Fuecks <hfuecks@gmail.com>
*/
@ -159,7 +159,7 @@ function confToHash($file,$lower=false) {
$conf[$line[0]] = $line[1];
}
}
return $conf;
}

File diff suppressed because it is too large Load Diff

View File

@ -159,7 +159,7 @@ function ft_pageLookup($id,$pageonly=true){
if(!preg_match('/'.$id.'/',noNS($pages[$i]))){
unset($pages[$i]);
continue;
}
}
}
if(!@file_exists(wikiFN($pages[$i]))){
unset($pages[$i]);
@ -257,7 +257,7 @@ function ft_queryParser($query){
$q['phrases'] = array();
$q['and'] = array();
$q['not'] = array();
// handle phrase searches
while(preg_match('/"(.*?)"/',$query,$match)){
$q['phrases'][] = $match[1];

View File

@ -19,7 +19,7 @@ function html_wikilink($id,$name=NULL,$search=''){
static $xhtml_renderer = NULL;
if(is_null($xhtml_renderer)){
require_once(DOKU_INC.'inc/parser/xhtml.php');
$xhtml_renderer = new Doku_Renderer_xhtml();
$xhtml_renderer = new Doku_Renderer_xhtml();
}
return $xhtml_renderer->internallink($id,$name,$search,true);
@ -47,7 +47,7 @@ function html_login(){
global $lang;
global $conf;
global $ID;
global $auth;
global $auth;
print p_locale_xhtml('login');
?>
@ -186,15 +186,15 @@ function html_topbtn(){
function html_backtomedia_button($params,$akey=''){
global $conf;
global $lang;
$ret = '<form class="button" method="get" action="'.DOKU_BASE.'lib/exe/media.php"><div class="no">';
reset($params);
while (list($key, $val) = each($params)) {
$ret .= '<input type="hidden" name="'.$key.'" ';
$ret .= 'value="'.htmlspecialchars($val).'" />';
}
$ret .= '<input type="submit" value="'.htmlspecialchars($lang['btn_backtomedia']).'" class="button" ';
if($akey){
$ret .= 'title="ALT+'.strtoupper($akey).'" ';
@ -214,15 +214,15 @@ function html_backtomedia_button($params,$akey=''){
function html_btn($name,$id,$akey,$params,$method='get'){
global $conf;
global $lang;
$label = $lang['btn_'.$name];
$ret = '';
//filter id (without urlencoding)
$id = idfilter($id,false);
//make nice URLs even for buttons
//make nice URLs even for buttons
if($conf['userewrite'] == 2){
$script = DOKU_BASE.DOKU_SCRIPT.'/'.$id;
}elseif($conf['userewrite']){
@ -231,15 +231,15 @@ function html_btn($name,$id,$akey,$params,$method='get'){
$script = DOKU_BASE.DOKU_SCRIPT;
$params['id'] = $id;
}
$ret .= '<form class="button" method="'.$method.'" action="'.$script.'"><div class="no">';
reset($params);
while (list($key, $val) = each($params)) {
$ret .= '<input type="hidden" name="'.$key.'" ';
$ret .= 'value="'.htmlspecialchars($val).'" />';
}
$ret .= '<input type="submit" value="'.htmlspecialchars($label).'" class="button" ';
if($akey){
$ret .= 'title="ALT+'.strtoupper($akey).'" ';
@ -266,7 +266,7 @@ function html_show($txt=''){
}else{
$secedit = true;
}
if ($txt){
//PreviewHeader
print '<br id="scroll__here" />';
@ -300,11 +300,11 @@ function html_hilight($html,$query){
return $html;
}
/**
/**
* Callback used by html_hilight()
*
* @author Harry Fuecks <hfuecks@gmail.com>
*/
*/
function html_hilight_callback($m) {
$hlight = unslash($m[0]);
if ( !isset($m[2])) {
@ -391,7 +391,7 @@ function html_locked(){
global $conf;
global $lang;
global $INFO;
$locktime = filemtime(wikiFN($ID).'.lock');
$expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
$min = round(($conf['locktime'] - (time() - $locktime) )/60);
@ -413,9 +413,9 @@ function html_revisions(){
global $INFO;
global $conf;
global $lang;
$revisions = getRevisions($ID);
$revisions = getRevisions($ID);
$date = @date($conf['dformat'],$INFO['lastmod']);
print p_locale_xhtml('revisions');
print '<ul>';
if($INFO['exists']){
@ -494,11 +494,11 @@ function html_recent($first=0){
$first=0;
$recents = getRecents(0,$conf['recent'] + 1,getNS($ID));
}
$cnt = count($recents) <= $conf['recent'] ? count($recents) : $conf['recent'];
$cnt = count($recents) <= $conf['recent'] ? count($recents) : $conf['recent'];
print p_locale_xhtml('recent');
print '<ul>';
foreach($recents as $recent){
$date = date($conf['dformat'],$recent['date']);
print ($recent['minor']) ? '<li class="minor">' : '<li>';
@ -549,7 +549,7 @@ function html_recent($first=0){
print '<div class="pagenav">';
$last = $first + $conf['recent'];
if ($first > 0) {
$first -= $conf['recent'];
$first -= $conf['recent'];
if ($first < 0) $first = 0;
print '<div class="pagenav-prev">';
print html_btn('newer','',"p",array('do' => 'recent', 'first' => $first));
@ -674,7 +674,7 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
$ret .= "</li>\n";
}
//remember current level
//remember current level
$level = $item['level'];
//print item
@ -832,7 +832,7 @@ function html_register(){
<?php echo $lang['user']?>
<input type="text" name="login" class="edit" size="50" value="<?php echo formText($_POST['login'])?>" />
</label><br />
<?php
if (!$conf['autopasswd']) {
?>
@ -877,7 +877,7 @@ function html_updateprofile(){
global $auth;
print p_locale_xhtml('updateprofile');
if (empty($_POST['fullname'])) $_POST['fullname'] = $INFO['userinfo']['name'];
if (empty($_POST['email'])) $_POST['email'] = $INFO['userinfo']['mail'];
?>
@ -891,7 +891,7 @@ function html_updateprofile(){
<label class="block">
<?php echo $lang['user']?>
<input type="text" name="fullname" disabled="disabled" class="edit" size="50" value="<?php echo formText($_SERVER['REMOTE_USER'])?>" />
</label><br />
</label><br />
<label class="block">
<?php echo $lang['fullname']?>
<input type="text" name="fullname" <?php if(!$auth->canDo('modName')) echo 'disabled="disabled"'?> class="edit" size="50" value="<?php echo formText($_POST['fullname'])?>" />
@ -911,15 +911,15 @@ function html_updateprofile(){
<input type="password" name="passchk" class="edit" size="50" />
</label><br />
<?php } ?>
<?php if ($conf['profileconfirm']) { ?>
<br />
<label class="block">
<?php echo $lang['oldpass']?>
<input type="password" name="oldpass" class="edit" size="50" />
<input type="password" name="oldpass" class="edit" size="50" />
</label><br />
<?php } ?>
<input type="submit" class="button" value="<?php echo $lang['btn_save']?>" />
<input type="reset" class="button" value="<?php echo $lang['btn_reset']?>" />
</fieldset>
@ -982,7 +982,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
}
if(!$DATE) $DATE = $INFO['lastmod'];
?>
<div style="width:99%;">
<form id="dw__editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>"><div class="no">
@ -1038,7 +1038,7 @@ function html_minoredit(){
// minor edits are for logged in users only
if(!$conf['useacl'] || !$_SERVER['REMOTE_USER']){
return;
}
}
$p = array();
$p['name'] = 'minor';
@ -1087,11 +1087,11 @@ function html_debug(){
print '<b>DOKU_BASE:</b><pre>';
print DOKU_BASE;
print '</pre>';
print '<b>abs DOKU_BASE:</b><pre>';
print DOKU_URL;
print '</pre>';
print '<b>rel DOKU_BASE:</b><pre>';
print dirname($_SERVER['PHP_SELF']).'/';
print '</pre>';
@ -1142,7 +1142,7 @@ function html_admin(){
$menu = array();
foreach ($pluginlist as $p) {
if($obj =& plugin_load('admin',$p) === NULL) continue;
$menu[] = array('plugin' => $p,
$menu[] = array('plugin' => $p,
'prompt' => $obj->getMenuText($conf['lang']),
'sort' => $obj->getMenuSort()
);
@ -1162,7 +1162,7 @@ function html_admin(){
if (!$conf['openregister']){
ptln('<li><div class="li"><a href="'.wl($ID,'do=register').'">'.$lang['admin_register'].'</a></div></li>');
}
ptln('</ul>');
}
@ -1175,7 +1175,7 @@ function html_resendpwd() {
global $lang;
global $conf;
global $ID;
print p_locale_xhtml('resendpwd');
?>
<div class="centeralign">

View File

@ -50,31 +50,31 @@ function idx_getPageWords($page){
$words = array();
foreach ($tokens as $word => $count) {
// simple filter to restrict use of utf8_stripspecials
// simple filter to restrict use of utf8_stripspecials
if (preg_match('/[^0-9A-Za-z]/u', $word)) {
// handle asian chars as single words (may fail on older PHP version)
$asia = @preg_replace('/('.IDX_ASIAN.')/u','\1 ',$word);
if(!is_null($asia)) $word = $asia; //recover from regexp failure
$arr = explode(' ', utf8_stripspecials($word,' ','._\-:\*'));
$arr = array_count_values($arr);
foreach ($arr as $w => $c) {
if (!is_numeric($w) && strlen($w) < 3) continue;
$w = utf8_strtolower($w);
$w = utf8_strtolower($w);
$words[$w] = $c * $count + (isset($words[$w]) ? $words[$w] : 0);
}
} else {
if (!is_numeric($word) && strlen($word) < 3) continue;
$word = strtolower($word);
$word = strtolower($word);
$words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0);
}
}
// arrive here with $words = array(word => frequency)
$index = array(); //resulting index
foreach ($words as $word => $freq) {
if (is_int(array_search("$word\n",$stopwords))) continue;
if (is_int(array_search("$word\n",$stopwords))) continue;
$wid = array_search("$word\n",$word_idx);
if(!is_int($wid)){
$word_idx[] = "$word\n";
@ -82,7 +82,7 @@ function idx_getPageWords($page){
}
$index[$wid] = $freq;
}
// save back word index
$fh = fopen($conf['cachedir'].'/word.idx','w');
if(!$fh){
@ -91,7 +91,7 @@ function idx_getPageWords($page){
}
fwrite($fh,join('',$word_idx));
fclose($fh);
return $index;
}
@ -133,7 +133,7 @@ function idx_addPage($page){
if(!$idx || !$tmp){
trigger_error("Failed to open index files", E_USER_ERROR);
return false;
}
}
// copy from index to temp file, modifying were needed
$lno = 0;
@ -233,7 +233,7 @@ function idx_lookup($words){
foreach($words as $word){
$result[$word] = array();
$wild = 0;
$xword = $word;
$xword = $word;
// check for wildcards
if(substr($xword,0,1) == '*'){
@ -244,7 +244,7 @@ function idx_lookup($words){
$xword = substr($xword,0,-1);
$wild += 2;
}
// look for the ID(s) for the given word
if($wild){ // handle wildcard search
$cnt = count($word_idx);
@ -276,7 +276,7 @@ function idx_lookup($words){
if(!$idx){
msg("Failed to open index file",-1);
return false;
}
}
// Walk the index til the lines are found
$docs = array(); // hold docs found
@ -288,7 +288,7 @@ function idx_lookup($words){
$line .= fgets($idx, 4096);
if(substr($line,-1) != "\n") continue;
if($lno > $srch) break; // shouldn't happen
// do we want this line?
if($lno == $srch){
@ -358,7 +358,7 @@ function idx_parseIndexLine(&$page_idx,$line){
* @param string $string the query as given by the user
* @param arrayref $stopwords array of stopwords
* @param boolean $wc are wildcards allowed?
*
*
* @todo make combined function to use alone or in getPageWords
*/
function idx_tokenizer($string,&$stopwords,$wc=false){

View File

@ -181,7 +181,7 @@ function getBaseURL($abs=false){
$dir = str_replace('\\','/',$dir); #bugfix for weird WIN behaviour
$dir = preg_replace('#//+#','/',$dir);
//handle script in lib/exe dir
$dir = preg_replace('!lib/exe/$!','',$dir);

View File

@ -21,7 +21,7 @@ function io_sweepNS($id){
//scan all namespaces
while(($id = getNS($id)) !== false){
$dir = $conf['datadir'].'/'.str_replace(':','/',$id);
$dir = $conf['datadir'].'/'.str_replace(':','/',$id);
$dir = utf8_encodeFN($dir);
//try to delete dir else return
@ -115,7 +115,7 @@ function io_deleteFromFile($file,$badline,$regex=false){
// remove all matching lines
if ($regex) {
$lines = preg_grep($badline,$lines,PREG_GREP_INVERT);
$lines = preg_grep($badline,$lines,PREG_GREP_INVERT);
} else {
$pos = array_search($badline,$lines); //return null or false if not found
while(is_int($pos)){
@ -158,7 +158,7 @@ function io_deleteFromFile($file,$badline,$regex=false){
* inside $conf['lockdir']
*
* It waits maximal 3 seconds for the lock, after this time
* the lock is assumed to be stale and the function goes on
* the lock is assumed to be stale and the function goes on
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
@ -170,7 +170,7 @@ function io_lock($file){
$lockDir = $conf['lockdir'].'/'.md5($file);
@ignore_user_abort(1);
$timeStart = time();
do {
//waited longer than 3 seconds? -> stale lock
@ -207,7 +207,7 @@ function io_makeFileDir($file){
if(!is_dir($dir)){
io_mkdir_p($dir) || msg("Creating directory $dir failed",-1);
}
umask($conf['umask']);
umask($conf['umask']);
}
/**
@ -247,7 +247,7 @@ function io_mkdir_ftp($dir){
msg("FTP support not found - safemode workaround not usable",-1);
return false;
}
$conn = @ftp_connect($conf['ftp']['host'],$conf['ftp']['port'],10);
if(!$conn){
msg("FTP connection failed",-1);
@ -271,11 +271,11 @@ function io_mkdir_ftp($dir){
/**
* downloads a file from the net and saves it
*
* if $useAttachment is false,
* if $useAttachment is false,
* - $file is the full filename to save the file, incl. path
* - if successful will return true, false otherwise
* if $useAttachment is true,
* if $useAttachment is true,
* - $file is the directory where the file should be saved
* - if successful will return the name used for the saved file, false otherwise
*
@ -289,25 +289,25 @@ function io_download($url,$file,$useAttachment=false,$defaultName=''){
$data = $http->get($url);
if(!$data) return false;
if ($useAttachment) {
$name = '';
if (isset($http->resp_headers['content-disposition'])) {
$content_disposition = $http->resp_headers['content-disposition'];
$match=array();
if (is_string($content_disposition) &&
$match=array();
if (is_string($content_disposition) &&
preg_match('/attachment;\s*filename\s*=\s*"([^"]*)"/i', $content_disposition, $match)) {
$name = basename($match[1]);
}
}
if (!$name) {
if (!$defaultName) return false;
$name = $defaultName;
$name = $defaultName;
}
$file = $file.$name;
}

View File

@ -22,7 +22,7 @@
* @param string $to Receiver of the mail (multiple seperated by commas)
* @param string $subject Mailsubject
* @param string $body Messagebody
* @param string $from Sender address
* @param string $from Sender address
* @param string $cc CarbonCopy receiver (multiple seperated by commas)
* @param string $bcc BlindCarbonCopy receiver (multiple seperated by commas)
* @param string $headers Additional Headers (seperated by MAILHEADER_EOL
@ -122,7 +122,7 @@ function mail_encode_address($string,$header='',$names=true){
$text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text).'?=';
}
}
// add to header comma seperated and in new line to avoid too long headers
if($headers != '') $headers .= ','.MAILHEADER_EOL.' ';
$headers .= $text.$addr;
@ -140,7 +140,7 @@ function mail_encode_address($string,$header='',$names=true){
* Uses a regular expresion to check if a given mail address is valid
*
* May not be completly RFC conform!
*
*
* @link http://www.webmasterworld.com/forum88/135.htm
*
* @param string $email the address to check

View File

@ -1,7 +1,7 @@
<?php
/**
* Utilities for handling pagenames
*
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
* @todo Combine similar functions like {wiki,media,meta}FN()
@ -15,7 +15,7 @@
*
* For $param='id' $conf['start'] is returned if no id was found.
* If the second parameter is true (default) the ID is cleaned.
*
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function getID($param='id',$clean=true){
@ -54,7 +54,7 @@ function getID($param='id',$clean=true){
}
if($clean) $id = cleanID($id);
if(empty($id) && $param=='id') $id = $conf['start'];
return $id;
}
@ -72,7 +72,7 @@ function cleanID($id,$ascii=false){
global $conf;
global $lang;
static $sepcharpat = null;
$sepchar = $conf['sepchar'];
if($sepcharpat == null) // build string only once to save clock cycles
$sepcharpat = '#\\'.$sepchar.'+#';
@ -88,7 +88,7 @@ function cleanID($id,$ascii=false){
$id = strtr($id,'/',$sepchar);
}
if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id);
if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id);
if($conf['deaccent'] || $ascii) $id = utf8_deaccent($id,-1);
//remove specials

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@ class Doku_LexerParallelRegex {
var $_labels;
var $_regex;
var $_case;
/**
* Constructor. Starts with no patterns.
* @param boolean $case True for case sensitive, false
@ -50,7 +50,7 @@ class Doku_LexerParallelRegex {
$this->_labels = array();
$this->_regex = null;
}
/**
* Adds a pattern with an optional label.
* @param mixed $pattern Perl style regex. Must be UTF-8
@ -68,7 +68,7 @@ class Doku_LexerParallelRegex {
$this->_labels[$count] = $label;
$this->_regex = null;
}
/**
* Attempts to match all patterns at once against
* a string.
@ -86,7 +86,7 @@ class Doku_LexerParallelRegex {
$match = "";
return false;
}
$match = $matches[0];
$size = count($matches);
for ($i = 1; $i < $size; $i++) {
@ -96,7 +96,7 @@ class Doku_LexerParallelRegex {
}
return true;
}
/**
* Attempts to split the string against all patterns at once
*
@ -111,20 +111,20 @@ class Doku_LexerParallelRegex {
if (count($this->_patterns) == 0) {
return false;
}
if (! preg_match($this->_getCompoundedRegex(), $subject, $matches)) {
$split = array($subject, "", "");
return false;
}
$idx = count($matches)-2;
list($pre, $post) = preg_split($this->_patterns[$idx].$this->_getPerlMatchingFlags(), $subject, 2);
$split = array($pre, $matches[0], $post);
return isset($this->_labels[$idx]) ? $this->_labels[$idx] : true;
}
/**
* Compounds the patterns into a single
* regular expression separated with the
@ -137,7 +137,7 @@ class Doku_LexerParallelRegex {
if ($this->_regex == null) {
$cnt = count($this->_patterns);
for ($i = 0; $i < $cnt; $i++) {
// Replace lookaheads / lookbehinds with marker
$m = "\1\1";
$pattern = preg_replace(
@ -167,7 +167,7 @@ class Doku_LexerParallelRegex {
array('\/', '\(', '\)'),
$pattern
);
// Restore lookaheads / lookbehinds
$pattern = preg_replace(
array (
@ -190,14 +190,14 @@ class Doku_LexerParallelRegex {
),
$pattern
);
$this->_patterns[$i] = '('.$pattern.')';
}
$this->_regex = "/" . implode("|", $this->_patterns) . "/" . $this->_getPerlMatchingFlags();
}
return $this->_regex;
}
/**
* Accessor for perl regex mode flags to use.
* @return string Perl regex flags.
@ -215,7 +215,7 @@ class Doku_LexerParallelRegex {
*/
class Doku_LexerStateStack {
var $_stack;
/**
* Constructor. Starts in named state.
* @param string $start Starting state name.
@ -224,7 +224,7 @@ class Doku_LexerStateStack {
function Doku_LexerStateStack($start) {
$this->_stack = array($start);
}
/**
* Accessor for current state.
* @return string State.
@ -233,7 +233,7 @@ class Doku_LexerStateStack {
function getCurrent() {
return $this->_stack[count($this->_stack) - 1];
}
/**
* Adds a state to the stack and sets it
* to be the current state.
@ -243,7 +243,7 @@ class Doku_LexerStateStack {
function enter($state) {
array_push($this->_stack, $state);
}
/**
* Leaves the current state and reverts
* to the previous one.
@ -275,7 +275,7 @@ class Doku_Lexer {
var $_mode;
var $_mode_handlers;
var $_case;
/**
* Sets up the lexer in case insensitive matching
* by default.
@ -292,7 +292,7 @@ class Doku_Lexer {
$this->_mode = &new Doku_LexerStateStack($start);
$this->_mode_handlers = array();
}
/**
* Adds a token search pattern for a particular
* parsing mode. The pattern does not change the
@ -310,7 +310,7 @@ class Doku_Lexer {
}
$this->_regexes[$mode]->addPattern($pattern);
}
/**
* Adds a pattern that will enter a new parsing
* mode. Useful for entering parenthesis, strings,
@ -330,7 +330,7 @@ class Doku_Lexer {
}
$this->_regexes[$mode]->addPattern($pattern, $new_mode);
}
/**
* Adds a pattern that will exit the current mode
* and re-enter the previous one.
@ -345,7 +345,7 @@ class Doku_Lexer {
}
$this->_regexes[$mode]->addPattern($pattern, "__exit");
}
/**
* Adds a pattern that has a special mode. Acts as an entry
* and exit pattern in one go, effectively calling a special
@ -364,7 +364,7 @@ class Doku_Lexer {
}
$this->_regexes[$mode]->addPattern($pattern, "_$special");
}
/**
* Adds a mapping from a mode to another handler.
* @param string $mode Mode to be remapped.
@ -374,7 +374,7 @@ class Doku_Lexer {
function mapHandler($mode, $handler) {
$this->_mode_handlers[$mode] = $handler;
}
/**
* Splits the page text into tokens. Will fail
* if the handlers report an error or if no
@ -410,7 +410,7 @@ class Doku_Lexer {
}
return $this->_invokeParser($raw, DOKU_LEXER_UNMATCHED, $pos);
}
/**
* Sends the matched token and any leading unmatched
* text to the parser changing the lexer to a new
@ -448,7 +448,7 @@ class Doku_Lexer {
}
return $this->_invokeParser($matched, DOKU_LEXER_MATCHED, $matchPos);
}
/**
* Tests to see if the new mode is actually to leave
* the current mode and pop an item from the matching
@ -460,7 +460,7 @@ class Doku_Lexer {
function _isModeEnd($mode) {
return ($mode === "__exit");
}
/**
* Test to see if the mode is one where this mode
* is entered for this token only and automatically
@ -472,7 +472,7 @@ class Doku_Lexer {
function _isSpecialMode($mode) {
return (strncmp($mode, "_", 1) == 0);
}
/**
* Strips the magic underscore marking single token
* modes.
@ -483,7 +483,7 @@ class Doku_Lexer {
function _decodeSpecial($mode) {
return substr($mode, 1);
}
/**
* Calls the parser method named after the current
* mode. Empty content will be ignored. The lexer
@ -512,7 +512,7 @@ class Doku_Lexer {
return $this->_parser->$handler($content, $is_match, $pos);
}
/**
* Tries to match a chunk of text and if successful
* removes the recognised chunk and any leading
@ -567,7 +567,7 @@ function Doku_Lexer_Escape($str) {
'/\|/',
'/\:/'
);
$escaped = array(
'\.',
'\\\\\\\\',

View File

@ -32,10 +32,10 @@ $PARSER_MODES = array(
'windowssharelink','filelink','notoc',
'nocache','multiplyentity','quotes','rss'),
// modes which have a start and end token but inside which
// modes which have a start and end token but inside which
// no other modes should be applied
'protected' => array('preformatted','code','file','php','html'),
// inside this mode no wiki markup should be applied but lineendings
// and whitespace isn't preserved
'disabled' => array('unformatted'),
@ -51,15 +51,15 @@ $PARSER_MODES = array(
* For an intro to the Lexer see: wiki:parser
*/
class Doku_Parser {
var $Handler;
var $Lexer;
var $modes = array();
var $connected = FALSE;
function addBaseMode(& $BaseMode) {
$this->modes['base'] = & $BaseMode;
if ( !$this->Lexer ) {
@ -67,7 +67,7 @@ class Doku_Parser {
}
$this->modes['base']->Lexer = & $this->Lexer;
}
/**
* PHP preserves order of associative elements
* Mode sequence is important
@ -79,36 +79,36 @@ class Doku_Parser {
$Mode->Lexer = & $this->Lexer;
$this->modes[$name] = & $Mode;
}
function connectModes() {
if ( $this->connected ) {
return;
}
foreach ( array_keys($this->modes) as $mode ) {
// Base isn't connected to anything
if ( $mode == 'base' ) {
continue;
}
$this->modes[$mode]->preConnect();
foreach ( array_keys($this->modes) as $cm ) {
if ( $this->modes[$cm]->accepts($mode) ) {
$this->modes[$mode]->connectTo($cm);
}
}
$this->modes[$mode]->postConnect();
}
$this->connected = TRUE;
}
function parse($doc) {
if ( $this->Lexer ) {
$this->connectModes();
@ -121,7 +121,7 @@ class Doku_Parser {
return FALSE;
}
}
}
//-------------------------------------------------------------------
@ -136,9 +136,9 @@ class Doku_Parser {
* @author Harry Fuecks <hfuecks@gmail.com>
*/
class Doku_Parser_Mode {
var $Lexer;
var $allowedModes = array();
// returns a number used to determine in which order modes are added
@ -149,24 +149,24 @@ class Doku_Parser_Mode {
// Called before any calls to connectTo
function preConnect() {}
// Connects the mode
// Connects the mode
function connectTo($mode) {}
// Called after all calls to connectTo
function postConnect() {}
function accepts($mode) {
return in_array($mode, $this->allowedModes );
}
}
//-------------------------------------------------------------------
class Doku_Parser_Mode_base extends Doku_Parser_Mode {
function Doku_Parser_Mode_base() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
$PARSER_MODES['container'],
$PARSER_MODES['baseonly'],
@ -185,10 +185,10 @@ class Doku_Parser_Mode_base extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
function Doku_Parser_Mode_footnote() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
$PARSER_MODES['container'],
$PARSER_MODES['formatting'],
@ -196,20 +196,20 @@ class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
$PARSER_MODES['protected'],
$PARSER_MODES['disabled']
);
}
function connectTo($mode) {
$this->Lexer->addEntryPattern(
'\x28\x28(?=.*\x29\x29)',$mode,'footnote'
);
}
function postConnect() {
$this->Lexer->addExitPattern(
'\x29\x29','footnote'
);
}
function getSort() {
@ -219,17 +219,17 @@ class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_header extends Doku_Parser_Mode {
function preConnect() {
//we're not picky about the closing ones, two are enough
// Header 1 is special case - match 6 or more
$this->Lexer->addSpecialPattern(
'[ \t]*={6,}[^\n]+={2,}[ \t]*(?=\n)',
'base',
'header'
);
// For the rest, match exactly
for ( $i = 5; $i > 1; $i--) {
$this->Lexer->addSpecialPattern(
@ -239,7 +239,7 @@ class Doku_Parser_Mode_header extends Doku_Parser_Mode {
);
}
}
function getSort() {
return 50;
}
@ -247,11 +247,11 @@ class Doku_Parser_Mode_header extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_notoc extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern('~~NOTOC~~',$mode,'notoc');
}
function getSort() {
return 30;
}
@ -259,19 +259,19 @@ class Doku_Parser_Mode_notoc extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_nocache extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern('~~NOCACHE~~',$mode,'nocache');
}
}
function getSort() {
return 40;
}
}
}
//-------------------------------------------------------------------
class Doku_Parser_Mode_linebreak extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern('\x5C{2}(?=\s)',$mode,'linebreak');
}
@ -283,7 +283,7 @@ class Doku_Parser_Mode_linebreak extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_eol extends Doku_Parser_Mode {
function connectTo($mode) {
$badModes = array('listblock','table');
if ( in_array($mode, $badModes) ) {
@ -306,64 +306,64 @@ class Doku_Parser_Mode_hr extends Doku_Parser_Mode {
function getSort() {
return 160;
}
}
}
//-------------------------------------------------------------------
class Doku_Parser_Mode_formatting extends Doku_Parser_Mode {
var $type;
var $formatting = array (
'strong' => array (
'entry'=>'\*\*(?=.*\*\*)',
'exit'=>'\*\*',
'sort'=>70
),
'emphasis'=> array (
'entry'=>'//(?=[^\x00]*[^:]//)', //hack for bug #384
'entry'=>'//(?=[^\x00]*[^:]//)', //hack for bug #384
'exit'=>'//',
'sort'=>80
),
'underline'=> array (
'entry'=>'__(?=.*__)',
'exit'=>'__',
'sort'=>90
),
'monospace'=> array (
'entry'=>'\x27\x27(?=.*\x27\x27)',
'exit'=>'\x27\x27',
'sort'=>100
),
'subscript'=> array (
'entry'=>'<sub>(?=.*\x3C/sub\x3E)',
'exit'=>'</sub>',
'sort'=>110
),
'superscript'=> array (
'entry'=>'<sup>(?=.*\x3C/sup\x3E)',
'exit'=>'</sup>',
'sort'=>120
),
'deleted'=> array (
'entry'=>'<del>(?=.*\x3C/del\x3E)',
'exit'=>'</del>',
'sort'=>130
),
);
function Doku_Parser_Mode_formatting($type) {
global $PARSER_MODES;
if ( !array_key_exists($type, $this->formatting) ) {
trigger_error('Invalid formatting type '.$type, E_USER_WARNING);
}
$this->type = $type;
// formatting may contain other formatting but not it self
@ -379,28 +379,28 @@ class Doku_Parser_Mode_formatting extends Doku_Parser_Mode {
$PARSER_MODES['disabled']
);
}
function connectTo($mode) {
// Can't nest formatting in itself
if ( $mode == $this->type ) {
return;
}
$this->Lexer->addEntryPattern(
$this->formatting[$this->type]['entry'],
$mode,
$this->type
);
}
function postConnect() {
$this->Lexer->addExitPattern(
$this->formatting[$this->type]['exit'],
$this->type
);
}
function getSort() {
@ -413,7 +413,7 @@ class Doku_Parser_Mode_listblock extends Doku_Parser_Mode {
function Doku_Parser_Mode_listblock() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
$PARSER_MODES['formatting'],
$PARSER_MODES['substition'],
@ -423,16 +423,16 @@ class Doku_Parser_Mode_listblock extends Doku_Parser_Mode {
// $this->allowedModes[] = 'footnote';
}
function connectTo($mode) {
$this->Lexer->addEntryPattern('\n {2,}[\-\*]',$mode,'listblock');
$this->Lexer->addEntryPattern('\n\t{1,}[\-\*]',$mode,'listblock');
$this->Lexer->addPattern('\n {2,}[\-\*]','listblock');
$this->Lexer->addPattern('\n\t{1,}[\-\*]','listblock');
}
function postConnect() {
$this->Lexer->addExitPattern('\n','listblock');
}
@ -444,10 +444,10 @@ class Doku_Parser_Mode_listblock extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_table extends Doku_Parser_Mode {
function Doku_Parser_Mode_table() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
$PARSER_MODES['formatting'],
$PARSER_MODES['substition'],
@ -455,12 +455,12 @@ class Doku_Parser_Mode_table extends Doku_Parser_Mode {
$PARSER_MODES['protected']
);
}
function connectTo($mode) {
$this->Lexer->addEntryPattern('\n\^',$mode,'table');
$this->Lexer->addEntryPattern('\n\|',$mode,'table');
}
function postConnect() {
$this->Lexer->addPattern('\n\^','table');
$this->Lexer->addPattern('\n\|','table');
@ -478,12 +478,12 @@ class Doku_Parser_Mode_table extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_unformatted extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addEntryPattern('<nowiki>(?=.*\x3C/nowiki\x3E)',$mode,'unformatted');
$this->Lexer->addEntryPattern('%%(?=.*%%)',$mode,'unformattedalt');
}
function postConnect() {
$this->Lexer->addExitPattern('</nowiki>','unformatted');
$this->Lexer->addExitPattern('%%','unformattedalt');
@ -497,11 +497,11 @@ class Doku_Parser_Mode_unformatted extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_php extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addEntryPattern('<php>(?=.*\x3C/php\x3E)',$mode,'php');
}
function postConnect() {
$this->Lexer->addExitPattern('</php>','php');
}
@ -513,11 +513,11 @@ class Doku_Parser_Mode_php extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_html extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addEntryPattern('<html>(?=.*\x3C/html\x3E)',$mode,'html');
}
function postConnect() {
$this->Lexer->addExitPattern('</html>','html');
}
@ -529,38 +529,38 @@ class Doku_Parser_Mode_html extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_preformatted extends Doku_Parser_Mode {
function connectTo($mode) {
// Has hard coded awareness of lists...
$this->Lexer->addEntryPattern('\n (?![\*\-])',$mode,'preformatted');
$this->Lexer->addEntryPattern('\n\t(?![\*\-])',$mode,'preformatted');
// How to effect a sub pattern with the Lexer!
$this->Lexer->addPattern('\n ','preformatted');
$this->Lexer->addPattern('\n\t','preformatted');
}
function postConnect() {
$this->Lexer->addExitPattern('\n','preformatted');
}
function getSort() {
return 20;
}
}
}
//-------------------------------------------------------------------
class Doku_Parser_Mode_code extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addEntryPattern('<code(?=.*\x3C/code\x3E)',$mode,'code');
}
function postConnect() {
$this->Lexer->addExitPattern('</code>','code');
}
function getSort() {
return 200;
}
@ -568,15 +568,15 @@ class Doku_Parser_Mode_code extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_file extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addEntryPattern('<file>(?=.*\x3C/file\x3E)',$mode,'file');
}
function postConnect() {
$this->Lexer->addExitPattern('</file>','file');
}
function getSort() {
return 210;
}
@ -584,10 +584,10 @@ class Doku_Parser_Mode_file extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_quote extends Doku_Parser_Mode {
function Doku_Parser_Mode_quote() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
$PARSER_MODES['formatting'],
$PARSER_MODES['substition'],
@ -598,16 +598,16 @@ class Doku_Parser_Mode_quote extends Doku_Parser_Mode {
#$this->allowedModes[] = 'preformatted';
#$this->allowedModes[] = 'unformatted';
}
function connectTo($mode) {
$this->Lexer->addEntryPattern('\n>{1,}',$mode,'quote');
}
function postConnect() {
$this->Lexer->addPattern('\n>{1,}','quote');
$this->Lexer->addExitPattern('\n','quote');
}
function getSort() {
return 220;
}
@ -618,23 +618,23 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode {
// A list
var $acronyms = array();
var $pattern = '';
function Doku_Parser_Mode_acronym($acronyms) {
$this->acronyms = $acronyms;
}
function preConnect() {
$bound = '[\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]';
$acronyms = array_map('Doku_Lexer_Escape',$this->acronyms);
$this->pattern = '(?<=^|'.$bound.')(?:'.join('|',$acronyms).')(?='.$bound.')';
}
function connectTo($mode) {
if ( strlen($this->pattern) > 0 ) {
$this->Lexer->addSpecialPattern($this->pattern,$mode,'acronym');
$this->Lexer->addSpecialPattern($this->pattern,$mode,'acronym');
}
}
function getSort() {
return 240;
}
@ -645,11 +645,11 @@ class Doku_Parser_Mode_smiley extends Doku_Parser_Mode {
// A list
var $smileys = array();
var $pattern = '';
function Doku_Parser_Mode_smiley($smileys) {
$this->smileys = $smileys;
}
function preConnect() {
$sep = '';
foreach ( $this->smileys as $smiley ) {
@ -657,13 +657,13 @@ class Doku_Parser_Mode_smiley extends Doku_Parser_Mode {
$sep = '|';
}
}
function connectTo($mode) {
if ( strlen($this->pattern) > 0 ) {
$this->Lexer->addSpecialPattern($this->pattern,$mode,'smiley');
$this->Lexer->addSpecialPattern($this->pattern,$mode,'smiley');
}
}
function getSort() {
return 230;
}
@ -674,31 +674,31 @@ class Doku_Parser_Mode_wordblock extends Doku_Parser_Mode {
// A list
var $badwords = array();
var $pattern = '';
function Doku_Parser_Mode_wordblock($badwords) {
$this->badwords = $badwords;
}
function preConnect() {
if ( count($this->badwords) == 0 ) {
return;
}
$sep = '';
foreach ( $this->badwords as $badword ) {
$this->pattern .= $sep.'(?<=\b)(?i)'.Doku_Lexer_Escape($badword).'(?-i)(?=\b)';
$sep = '|';
}
}
function connectTo($mode) {
if ( strlen($this->pattern) > 0 ) {
$this->Lexer->addSpecialPattern($this->pattern,$mode,'wordblock');
}
}
function getSort() {
return 250;
}
@ -712,11 +712,11 @@ class Doku_Parser_Mode_entity extends Doku_Parser_Mode {
// A list
var $entities = array();
var $pattern = '';
function Doku_Parser_Mode_entity($entities) {
$this->entities = $entities;
}
function preConnect() {
$sep = '';
foreach ( $this->entities as $entity ) {
@ -724,13 +724,13 @@ class Doku_Parser_Mode_entity extends Doku_Parser_Mode {
$sep = '|';
}
}
function connectTo($mode) {
if ( strlen($this->pattern) > 0 ) {
$this->Lexer->addSpecialPattern($this->pattern,$mode,'entity');
}
}
function getSort() {
return 260;
}
@ -739,15 +739,15 @@ class Doku_Parser_Mode_entity extends Doku_Parser_Mode {
//-------------------------------------------------------------------
// Implements the 640x480 replacement
class Doku_Parser_Mode_multiplyentity extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern(
'(?<=\b)\d+[xX]\d+(?=\b)',$mode,'multiplyentity'
);
}
function getSort() {
return 270;
}
@ -755,9 +755,9 @@ class Doku_Parser_Mode_multiplyentity extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_quotes extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern(
'(?<=^|\s)\'(?=\S)',$mode,'singlequoteopening'
);
@ -772,7 +772,7 @@ class Doku_Parser_Mode_quotes extends Doku_Parser_Mode {
);
}
function getSort() {
return 280;
}
@ -780,13 +780,13 @@ class Doku_Parser_Mode_quotes extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_camelcaselink extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern(
'\b[A-Z]+[a-z]+[A-Z][A-Za-z]*\b',$mode,'camelcaselink'
);
}
function getSort() {
return 290;
}
@ -794,12 +794,12 @@ class Doku_Parser_Mode_camelcaselink extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_internallink extends Doku_Parser_Mode {
function connectTo($mode) {
// Word boundaries?
$this->Lexer->addSpecialPattern("\[\[.+?\]\]",$mode,'internallink');
}
function getSort() {
return 300;
}
@ -807,12 +807,12 @@ class Doku_Parser_Mode_internallink extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_media extends Doku_Parser_Mode {
function connectTo($mode) {
// Word boundaries?
$this->Lexer->addSpecialPattern("\{\{[^\}]+\}\}",$mode,'media');
}
function getSort() {
return 320;
}
@ -831,33 +831,33 @@ class Doku_Parser_Mode_rss extends Doku_Parser_Mode {
}
//-------------------------------------------------------------------
class Doku_Parser_Mode_externallink extends Doku_Parser_Mode {
class Doku_Parser_Mode_externallink extends Doku_Parser_Mode {
var $schemes = array('http','https','telnet','gopher','wais','ftp','ed2k','irc');
var $patterns = array();
function preConnect() {
$ltrs = '\w';
$gunk = '/\#~:.?+=&%@!\-';
$punc = '.:?\-;,';
$host = $ltrs.$punc;
$any = $ltrs.$gunk.$punc;
foreach ( $this->schemes as $scheme ) {
$this->patterns[] = '\b(?i)'.$scheme.'(?-i)://['.$any.']+?(?=['.$punc.']*[^'.$any.'])';
}
$this->patterns[] = '\b(?i)www?(?-i)\.['.$host.']+?\.['.$host.']+?['.$any.']+?(?=['.$punc.']*[^'.$any.'])';
$this->patterns[] = '\b(?i)ftp?(?-i)\.['.$host.']+?\.['.$host.']+?['.$any.']+?(?=['.$punc.']*[^'.$any.'])';
}
function connectTo($mode) {
foreach ( $this->patterns as $pattern ) {
$this->Lexer->addSpecialPattern($pattern,$mode,'externallink');
}
}
function getSort() {
return 330;
}
@ -865,21 +865,21 @@ class Doku_Parser_Mode_externallink extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_filelink extends Doku_Parser_Mode {
var $pattern;
function preConnect() {
$ltrs = '\w';
$gunk = '/\#~:.?+=&%@!\-';
$punc = '.:?\-;,';
$host = $ltrs.$punc;
$any = $ltrs.$gunk.$punc;
$this->pattern = '\b(?i)file(?-i)://['.$any.']+?['.
$punc.']*[^'.$any.']';
}
function connectTo($mode) {
$this->Lexer->addSpecialPattern(
$this->pattern,$mode,'filelink');
@ -892,18 +892,18 @@ class Doku_Parser_Mode_filelink extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_windowssharelink extends Doku_Parser_Mode {
var $pattern;
function preConnect() {
$this->pattern = "\\\\\\\\\w+?(?:\\\\[\w$]+)+";
}
function connectTo($mode) {
$this->Lexer->addSpecialPattern(
$this->pattern,$mode,'windowssharelink');
}
function getSort() {
return 350;
}
@ -911,11 +911,11 @@ class Doku_Parser_Mode_windowssharelink extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_emaillink extends Doku_Parser_Mode {
function connectTo($mode) {
$this->Lexer->addSpecialPattern("<[\w0-9\-_.]+?@[\w\-]+\.[\w\-\.]+\.*[\w]+>",$mode,'emaillink');
}
function getSort() {
return 340;
}

View File

@ -19,157 +19,157 @@ class Doku_Renderer {
function nocache() {
$this->info['cache'] = FALSE;
}
//handle plugin rendering
function plugin($name,$data){
$plugin =& plugin_load('syntax',$name);
$plugin =& plugin_load('syntax',$name);
if($plugin != null){
// determine mode from renderer class name - format = "Doku_Renderer_<mode>"
$mode = substr(get_class($this), 14);
// determine mode from renderer class name - format = "Doku_Renderer_<mode>"
$mode = substr(get_class($this), 14);
$plugin->render($mode,$this,$data);
}
}
function document_start() {}
function document_end() {}
function toc_open() {}
function tocbranch_open($level) {}
function tocitem_open($level, $empty = FALSE) {}
function tocelement($level, $title) {}
function tocitem_close($level) {}
function tocbranch_close($level) {}
function toc_close() {}
function header($text, $level, $pos) {}
function section_open($level) {}
function section_close() {}
function cdata($text) {}
function p_open() {}
function p_close() {}
function linebreak() {}
function hr() {}
function strong_open() {}
function strong_close() {}
function emphasis_open() {}
function emphasis_close() {}
function underline_open() {}
function underline_close() {}
function monospace_open() {}
function monospace_close() {}
function subscript_open() {}
function subscript_close() {}
function superscript_open() {}
function superscript_close() {}
function deleted_open() {}
function deleted_close() {}
function footnote_open() {}
function footnote_close() {}
function listu_open() {}
function listu_close() {}
function listo_open() {}
function listo_close() {}
function listitem_open($level) {}
function listitem_close() {}
function listcontent_open() {}
function listcontent_close() {}
function unformatted($text) {}
function php($text) {}
function html($text) {}
function preformatted($text) {}
function file($text) {}
function quote_open() {}
function quote_close() {}
function code($text, $lang = NULL) {}
function acronym($acronym) {}
function smiley($smiley) {}
function wordblock($word) {}
function entity($entity) {}
// 640x480 ($x=640, $y=480)
function multiplyentity($x, $y) {}
function singlequoteopening() {}
function singlequoteclosing() {}
function doublequoteopening() {}
function doublequoteclosing() {}
// $link like 'SomePage'
function camelcaselink($link) {}
// $link like 'wiki:syntax', $title could be an array (media)
function internallink($link, $title = NULL) {}
// $link is full URL with scheme, $title could be an array (media)
function externallink($link, $title = NULL) {}
// $link is the original link - probably not much use
// $wikiName is an indentifier for the wiki
// $wikiUri is the URL fragment to append to some known URL
function interwikilink($link, $title = NULL, $wikiName, $wikiUri) {}
// Link to file on users OS, $title could be an array (media)
function filelink($link, $title = NULL) {}
// Link to a Windows share, , $title could be an array (media)
function windowssharelink($link, $title = NULL) {}
// function email($address, $title = NULL) {}
function emaillink($address, $name = NULL) {}
function internalmedialink (
$src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
) {}
@ -177,21 +177,21 @@ class Doku_Renderer {
function externalmedialink(
$src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
) {}
function table_open($maxcols = NULL, $numrows = NULL){}
function table_close(){}
function tablerow_open(){}
function tablerow_close(){}
function tableheader_open($colspan = 1, $align = NULL){}
function tableheader_close(){}
function tablecell_open($colspan = 1, $align = NULL){}
function tablecell_close(){}
}

View File

@ -4,44 +4,44 @@ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../')
require_once DOKU_INC . 'inc/parser/renderer.php';
class Doku_Renderer_SpamCheck extends Doku_Renderer {
// This should be populated by the code executing the instructions
var $currentCall;
// An array of instructions that contain spam
var $spamFound = array();
// pcre pattern for finding spam
var $spamPattern = '#^$#';
function internallink($link, $title = NULL) {
$this->_checkTitle($title);
}
function externallink($link, $title = NULL) {
$this->_checkLinkForSpam($link);
$this->_checkTitle($title);
}
function interwikilink($link, $title = NULL) {
$this->_checkTitle($title);
}
function filelink($link, $title = NULL) {
$this->_checkLinkForSpam($link);
$this->_checkTitle($title);
}
function windowssharelink($link, $title = NULL) {
$this->_checkLinkForSpam($link);
$this->_checkTitle($title);
}
function email($address, $title = NULL) {
$this->_checkLinkForSpam($address);
$this->_checkTitle($title);
}
function internalmedialink ($src) {
$this->_checkLinkForSpam($src);
}
@ -55,7 +55,7 @@ class Doku_Renderer_SpamCheck extends Doku_Renderer {
$this->_checkLinkForSpam($title['src']);
}
}
// Pattern matching happens here
/**
* @TODO What about links like www.google.com - no http://

View File

@ -6,23 +6,23 @@
* Main issues lie with lists, quote and tables
*/
class Doku_Renderer_Wiki extends Doku_Renderer {
var $doc = '';
// This should be eliminated
var $listMarker = '*';
function document_start() {
ob_start();
}
function document_end() {
$this->doc .= ob_get_contents();
ob_end_clean();
}
function header($text, $level) {
$levels = array(
1=>'======',
@ -31,7 +31,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
4=>'===',
5=>'==',
);
if ( isset($levels[$level]) ) {
$token = $levels[$level];
} else {
@ -41,189 +41,189 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo trim($text);
echo " {$token}\n";
}
function cdata($text) {
echo $text;
}
function linebreak() {
echo '\\\\ ';
}
function hr() {
echo "\n----\n";
}
function strong_open() {
echo '**';
}
function strong_close() {
echo '**';
}
function emphasis_open() {
echo '//';
}
function emphasis_close() {
echo '//';
}
function underline_open() {
echo '__';
}
function underline_close() {
echo '__';
}
function monospace_open() {
echo "''";
}
function monospace_close() {
echo "''";
}
function subscript_open() {
echo '<sub>';
}
function subscript_close() {
echo '</sub>';
}
function superscript_open() {
echo '<sup>';
}
function superscript_close() {
echo '</sup>';
}
function deleted_open() {
echo '<del>';
}
function deleted_close() {
echo '</del>';
}
function footnote_open() {
echo '((';
}
function footnote_close() {
echo '))';
}
function listu_open() {
$this->listMarker = '*';
echo "\n";
}
function listo_open() {
$this->listMarker = '-';
echo "\n";
}
/**
* @TODO Problem here with nested lists
*/
function listitem_open($level) {
echo str_repeat(' ', $level).$this->listMarker;
}
function listitem_close() {
echo "\n";
}
function unformatted($text) {
echo '%%'.$text.'%%';
}
function php($text) {
echo "\n<php>\n$text\n</php>\n";
}
function html($text) {
echo "\n<html>\n$text\n</html>\n";
}
/**
* Indent?
*/
function preformatted($text) {
echo "\n<code>\n$text\n</code>\n";
}
function file($text) {
echo "\n<file>\n$text\n</file>\n";
}
/**
* Problem here with nested quotes
*/
function quote_open() {
echo '>';
}
function quote_close() {
echo "\n";
}
function code($text, $lang = NULL) {
if ( !$lang ) {
echo "\n<code>\n$text\n</code>\n";
} else {
echo "\n<code $lang>\n$text\n</code>\n";
}
}
function acronym($acronym) {
echo $acronym;
}
function smiley($smiley) {
echo $smiley;
}
function wordblock($word) {
echo $word;
}
function entity($entity) {
echo $entity;
}
// 640x480 ($x=640, $y=480)
function multiplyentity($x, $y) {
echo "{$x}x{$y}";
}
function singlequoteopening() {
echo "'";
}
function singlequoteclosing() {
echo "'";
}
function doublequoteopening() {
echo '"';
}
function doublequoteclosing() {
echo '"';
}
// $link like 'SomePage'
function camelcaselink($link) {
echo $link;
}
// $link like 'wikie:syntax', $title could be an array (media)
function internallink($link, $title = NULL) {
if ( $title ) {
@ -232,7 +232,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$link.']]';
}
}
// $link is full URL with scheme, $title could be an array (media)
function externallink($link, $title = NULL) {
if ( $title ) {
@ -241,7 +241,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$link.']]';
}
}
// $link is the original link - probably not much use
// $wikiName is an indentifier for the wiki
// $wikiUri is the URL fragment to append to some known URL
@ -252,7 +252,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$link.']]';
}
}
// Link to file on users OS, $title could be an array (media)
function filelink($link, $title = NULL) {
if ( $title ) {
@ -261,7 +261,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$link.']]';
}
}
// Link to a Windows share, , $title could be an array (media)
function windowssharelink($link, $title = NULL) {
if ( $title ) {
@ -270,7 +270,7 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$link.']]';
}
}
function email($address, $title = NULL) {
if ( $title ) {
echo '[['.$address.'|'.$title.']]';
@ -278,14 +278,14 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '[['.$address.']]';
}
}
// @TODO
function internalmedialink (
$src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
) {
}
// @TODO
function externalmedialink(
$src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
@ -296,23 +296,23 @@ class Doku_Renderer_Wiki extends Doku_Renderer {
echo '{{'.$src.'}}';
}
}
function table_open($maxcols = NULL, $numrows = NULL){}
function table_close(){}
function tablerow_open(){}
function tablerow_close(){}
function tableheader_open($colspan = 1, $align = NULL){}
function tableheader_close(){}
function tablecell_open($colspan = 1, $align = NULL){}
function tablecell_close(){}
}

View File

@ -21,16 +21,16 @@ if ( !defined('DOKU_TAB') ) {
require_once DOKU_INC . 'inc/parser/renderer.php';
/**
* The Renderer
* The Renderer
*/
class Doku_Renderer_xhtml extends Doku_Renderer {
var $doc = '';
var $headers = array();
var $footnotes = array();
var $acronyms = array();
var $smileys = array();
var $badwords = array();
@ -43,18 +43,18 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function document_start() {
}
function document_end() {
// add button for last section if any and more than one
if($this->lastsec > 1) $this->_secedit($this->lastsec,'');
if ( count ($this->footnotes) > 0 ) {
$this->doc .= '<div class="footnotes">'.DOKU_LF;
$id = 0;
foreach ( $this->footnotes as $footnote ) {
$id++; // the number of the current footnote
// check its not a placeholder that indicates actual footnote text is elsewhere
if (substr($footnote, 0, 5) != "@@FNT") {
@ -62,18 +62,18 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '<div class="fn">';
$this->doc .= '<a href="#fnt'.$id.'" id="fn'.$id.'" name="fn'.$id.'" class="fn_bot">';
$this->doc .= $id.')</a> '.DOKU_LF;
// get any other footnotes that use the same markup
$alt = array_keys($this->footnotes, "@@FNT$id");
if (count($alt)) {
foreach ($alt as $ref) {
// set anchor and backlink for the other footnotes
$this->doc .= ', <a href="#fnt'.($ref+1).'" id="fn'.($ref+1).'" name="fn'.($ref+1).'" class="fn_bot">';
$this->doc .= ($ref+1).')</a> '.DOKU_LF;
$this->doc .= ($ref+1).')</a> '.DOKU_LF;
}
}
// add footnote markup and close this footnote
$this->doc .= $footnote;
$this->doc .= '</div>' . DOKU_LF;
@ -91,11 +91,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '</div>'.DOKU_LF;
$this->doc .= '<div id="toc__inside">'.DOKU_LF;
}
function tocbranch_open($level) {
$this->doc .= '<ul class="toc">'.DOKU_LF;
}
function tocitem_open($level, $empty = FALSE) {
if ( !$empty ) {
$this->doc .= '<li class="level'.$level.'">';
@ -103,28 +103,28 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '<li class="clear">';
}
}
function tocelement($level, $title) {
$this->doc .= '<span class="li"><a href="#'.$this->_headerToLink($title).'" class="toc">';
$this->doc .= $this->_xmlEntities($title);
$this->doc .= '</a></span>';
}
function tocitem_close($level) {
$this->doc .= '</li>'.DOKU_LF;
}
function tocbranch_close($level) {
$this->doc .= '</ul>'.DOKU_LF;
}
function toc_close() {
$this->doc .= '</div>'.DOKU_LF.'</div>'.DOKU_LF;
}
function header($text, $level, $pos) {
global $conf;
//handle section editing
//handle section editing
if($level <= $conf['maxseclevel']){
// add button for last section if any
if($this->lastsec) $this->_secedit($this->lastsec,$pos-1);
@ -136,91 +136,91 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= $this->_xmlEntities($text);
$this->doc .= "</a></h$level>".DOKU_LF;
}
function section_open($level) {
$this->doc .= "<div class=\"level$level\">".DOKU_LF;
}
function section_close() {
$this->doc .= DOKU_LF.'</div>'.DOKU_LF;
}
function cdata($text) {
$this->doc .= $this->_xmlEntities($text);
}
function p_open() {
$this->doc .= DOKU_LF.'<p>'.DOKU_LF;
}
function p_close() {
$this->doc .= DOKU_LF.'</p>'.DOKU_LF;
}
function linebreak() {
$this->doc .= '<br/>'.DOKU_LF;
}
function hr() {
$this->doc .= '<hr />'.DOKU_LF;
}
function strong_open() {
$this->doc .= '<strong>';
}
function strong_close() {
$this->doc .= '</strong>';
}
function emphasis_open() {
$this->doc .= '<em>';
}
function emphasis_close() {
$this->doc .= '</em>';
}
function underline_open() {
$this->doc .= '<em class="u">';
}
function underline_close() {
$this->doc .= '</em>';
}
function monospace_open() {
$this->doc .= '<code>';
}
function monospace_close() {
$this->doc .= '</code>';
}
function subscript_open() {
$this->doc .= '<sub>';
}
function subscript_close() {
$this->doc .= '</sub>';
}
function superscript_open() {
$this->doc .= '<sup>';
}
function superscript_close() {
$this->doc .= '</sup>';
}
function deleted_open() {
$this->doc .= '<del>';
}
function deleted_close() {
$this->doc .= '</del>';
}
/**
* Callback for footnote start syntax
*
@ -236,7 +236,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->store = $this->doc;
$this->doc = '';
}
/**
* Callback for footnote end syntax
*
@ -251,10 +251,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$footnote = $this->doc;
$this->doc = $this->store;
$this->store = '';
// check to see if this footnote has been seen before
$i = array_search($footnote, $this->footnotes);
if ($i === false) {
// its a new footnote, add it to the $footnotes array
$id = count($this->footnotes)+1;
@ -269,43 +269,43 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// output the footnote reference and link, incl. onmouseover for insitu footnote popup
$this->doc .= '<a href="#fn'.$id.'" name="fnt'.$id.'" id="fnt'.$id.'" class="fn_top" onmouseover="fnt(\''.$id.'\', this, event);">'.$id.')</a>';
}
function listu_open() {
$this->doc .= '<ul>'.DOKU_LF;
}
function listu_close() {
$this->doc .= '</ul>'.DOKU_LF;
}
function listo_open() {
$this->doc .= '<ol>'.DOKU_LF;
}
function listo_close() {
$this->doc .= '</ol>'.DOKU_LF;
}
function listitem_open($level) {
$this->doc .= '<li class="level'.$level.'">';
}
function listitem_close() {
$this->doc .= '</li>'.DOKU_LF;
}
function listcontent_open() {
$this->doc .= '<div class="li">';
}
function listcontent_close() {
$this->doc .= '</div>'.DOKU_LF;
}
function unformatted($text) {
$this->doc .= $this->_xmlEntities($text);
}
/**
* Execute PHP code if allowed
*
@ -322,7 +322,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->file($text);
}
}
/**
* Insert HTML if allowed
*
@ -336,23 +336,23 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->file($text);
}
}
function preformatted($text) {
$this->doc .= '<pre class="code">' . $this->_xmlEntities($text) . '</pre>'. DOKU_LF;
}
function file($text) {
$this->doc .= '<pre class="file">' . $this->_xmlEntities($text). '</pre>'. DOKU_LF;
}
function quote_open() {
$this->doc .= '<blockquote><div class="no">'.DOKU_LF;
}
function quote_close() {
$this->doc .= '</div></blockquote>'.DOKU_LF;
}
/**
* Callback for code text
*
@ -362,7 +362,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*/
function code($text, $language = NULL) {
global $conf;
if ( is_null($language) ) {
$this->preformatted($text);
} else {
@ -376,26 +376,26 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->set_overall_class("code $language");
$geshi->set_link_target($conf['target']['extern']);
$text = $geshi->parse_code();
$this->doc .= $text;
}
}
function acronym($acronym) {
if ( array_key_exists($acronym, $this->acronyms) ) {
$title = $this->_xmlEntities($this->acronyms[$acronym]);
$this->doc .= '<acronym title="'.$title
.'">'.$this->_xmlEntities($acronym).'</acronym>';
} else {
$this->doc .= $this->_xmlEntities($acronym);
}
}
function smiley($smiley) {
if ( array_key_exists($smiley, $this->smileys) ) {
$title = $this->_xmlEntities($this->smileys[$smiley]);
@ -406,7 +406,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= $this->_xmlEntities($smiley);
}
}
/*
* not used
function wordblock($word) {
@ -417,7 +417,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
*/
function entity($entity) {
if ( array_key_exists($entity, $this->entities) ) {
$this->doc .= $this->entities[$entity];
@ -425,33 +425,33 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= $this->_xmlEntities($entity);
}
}
function multiplyentity($x, $y) {
$this->doc .= "$x&times;$y";
}
function singlequoteopening() {
$this->doc .= "&lsquo;";
}
function singlequoteclosing() {
$this->doc .= "&rsquo;";
}
function doublequoteopening() {
$this->doc .= "&ldquo;";
}
function doublequoteclosing() {
$this->doc .= "&rdquo;";
}
/**
*/
function camelcaselink($link) {
$this->internallink($link,$link);
$this->internallink($link,$link);
}
function locallink($hash, $name = NULL){
global $ID;
@ -488,10 +488,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
} else {
$class='media';
}
//keep hash anchor
list($id,$hash) = split('#',$id,2);
//prepare for formating
$link['target'] = $conf['target']['wiki'];
$link['style'] = '';
@ -523,7 +523,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= $this->_formatLink($link);
}
}
function externallink($url, $name = NULL) {
global $conf;
@ -532,13 +532,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// add protocol on simple short URLs
if(substr($url,0,3) == 'ftp' && (substr($url,0,6) != 'ftp://')) $url = 'ftp://'.$url;
if(substr($url,0,3) == 'www') $url = 'http://'.$url;
if ( !$isImage ) {
$class='urlextern';
} else {
$class='media';
}
//prepare for formating
$link['target'] = $conf['target']['extern'];
$link['style'] = '';
@ -554,12 +554,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//output formatted
$this->doc .= $this->_formatLink($link);
}
/**
*/
function interwikilink($match, $name = NULL, $wikiName, $wikiUri) {
global $conf;
$link = array();
$link['target'] = $conf['target']['interwiki'];
$link['pre'] = '';
@ -615,7 +615,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//output formatted
$this->doc .= $this->_formatLink($link);
}
/**
*/
function windowssharelink($url, $name = NULL) {
@ -648,7 +648,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//output formatted
$this->doc .= $this->_formatLink($link);
}
function emaillink($address, $name = NULL) {
global $conf;
//simple setup
@ -658,7 +658,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['suf'] = '';
$link['style'] = '';
$link['more'] = '';
//we just test for image here - we need to encode the title our self
$this->_getLinkTitle($name, $address, $isImage);
if ( !$isImage ) {
@ -675,9 +675,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}else{
$name = $this->_xmlEntities($name);
}
if($conf['mailguard'] == 'visible') $address = rawurlencode($address);
$link['url'] = 'mailto:'.$address;
$link['name'] = $name;
$link['title'] = $title;
@ -685,7 +685,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//output formatted
$this->doc .= $this->_formatLink($link);
}
function internalmedia ($src, $title=NULL, $align=NULL, $width=NULL,
$height=NULL, $cache=NULL, $linking=NULL) {
global $conf;
@ -719,7 +719,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
else $this->doc .= $this->_formatLink($link);
}
/**
* @todo don't add link for flash
*/
@ -759,7 +759,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
/**
* Renders an RSS feed using Magpie
*
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function rss ($url){
@ -794,19 +794,19 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function table_open($maxcols = NULL, $numrows = NULL){
$this->doc .= '<table class="inline">'.DOKU_LF;
}
function table_close(){
$this->doc .= '</table>'.DOKU_LF.'<br />'.DOKU_LF;
}
function tablerow_open(){
$this->doc .= DOKU_TAB . '<tr>' . DOKU_LF . DOKU_TAB . DOKU_TAB;
}
function tablerow_close(){
$this->doc .= DOKU_LF . DOKU_TAB . '</tr>' . DOKU_LF;
}
function tableheader_open($colspan = 1, $align = NULL){
$this->doc .= '<th';
if ( !is_null($align) ) {
@ -817,11 +817,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
$this->doc .= '>';
}
function tableheader_close(){
$this->doc .= '</th>';
}
function tablecell_open($colspan = 1, $align = NULL){
$this->doc .= '<td';
if ( !is_null($align) ) {
@ -832,11 +832,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
$this->doc .= '>';
}
function tablecell_close(){
$this->doc .= '</td>';
}
//----------------------------------------------------------
// Utils
@ -898,7 +898,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
/**
* Renders internal and external media
*
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function _media ($src, $title=NULL, $align=NULL, $width=NULL,
@ -911,7 +911,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//add image tag
$ret .= '<img src="'.ml($src,array('w'=>$width,'h'=>$height,'cache'=>$cache)).'"';
$ret .= ' class="media'.$align.'"';
if (!is_null($title)) {
$ret .= ' title="'.$this->_xmlEntities($title).'"';
$ret .= ' alt="'.$this->_xmlEntities($title).'"';
@ -927,14 +927,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}else{
$ret .= ' alt=""';
}
if ( !is_null($width) )
$ret .= ' width="'.$this->_xmlEntities($width).'"';
if ( !is_null($height) )
$ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= ' />';
$ret .= ' />';
}elseif($mime == 'application/x-shockwave-flash'){
$ret .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'.
@ -962,11 +962,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $ret;
}
function _xmlEntities($string) {
return htmlspecialchars($string);
}
/**
* Creates a linkid from a headline
*/
@ -982,13 +982,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* This is just aplaceholder and gets replace by the button if
* section editing is allowed
*
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function _secedit($f, $t){
$this->doc .= '<!-- SECTION ['.$f.'-'.$t.'] -->';
}
/**
* Construct a title and handle images in titles
*
@ -1013,7 +1013,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $this->_imageTitle($title);
}
}
/**
* Returns an HTML code for images used in link titles
*

View File

@ -1,85 +1,85 @@
<?php
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
require_once DOKU_INC . 'inc/parser/xhtml.php';
/**
* The summary XHTML form selects either up to the first two paragraphs
* it find in a page or the first section (whichever comes first)
* It strips out the table of contents if one exists
* Section divs are not used - everything should be nested in a single
* div with CSS class "page"
* Headings have their a name link removed and section editing links
* removed
* It also attempts to capture the first heading in a page for
* use as the title of the page.
*/
class Doku_Renderer_xhtmlsummary extends Doku_Renderer_xhtml {
// Namespace these variables to
// avoid clashes with parent classes
var $sum_paragraphs = 0;
var $sum_capture = TRUE;
var $sum_inSection = FALSE;
var $sum_summary = '';
var $sum_pageTitle = FALSE;
function document_start() {
$this->doc .= DOKU_LF.'<div>'.DOKU_LF;
}
function document_end() {
$this->doc = $this->sum_summary;
$this->doc .= DOKU_LF.'</div>'.DOKU_LF;
}
function toc_open() {
$this->sum_summary .= $this->doc;
}
function toc_close() {
$this->doc = '';
}
function header($text, $level, $pos) {
if ( !$this->sum_pageTitle ) {
$this->info['sum_pagetitle'] = $text;
$this->sum_pageTitle = TRUE;
}
$this->doc .= DOKU_LF.'<h'.$level.'>';
$this->doc .= $this->_xmlEntities($text);
$this->doc .= "</h$level>".DOKU_LF;
}
function section_open($level) {
if ( $this->sum_capture ) {
$this->sum_inSection = TRUE;
}
}
function section_close() {
if ( $this->sum_capture && $this->sum_inSection ) {
$this->sum_summary .= $this->doc;
$this->sum_capture = FALSE;
}
}
function p_open() {
if ( $this->sum_capture && $this->sum_paragraphs < 2 ) {
$this->sum_paragraphs++;
}
parent :: p_open();
}
function p_close() {
parent :: p_close();
if ( $this->sum_capture && $this->sum_paragraphs >= 2 ) {
$this->sum_summary .= $this->doc;
$this->sum_capture = FALSE;
}
}
}
//Setup VIM: ex: et ts=2 enc=utf-8 :
<?php
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
require_once DOKU_INC . 'inc/parser/xhtml.php';
/**
* The summary XHTML form selects either up to the first two paragraphs
* it find in a page or the first section (whichever comes first)
* It strips out the table of contents if one exists
* Section divs are not used - everything should be nested in a single
* div with CSS class "page"
* Headings have their a name link removed and section editing links
* removed
* It also attempts to capture the first heading in a page for
* use as the title of the page.
*/
class Doku_Renderer_xhtmlsummary extends Doku_Renderer_xhtml {
// Namespace these variables to
// avoid clashes with parent classes
var $sum_paragraphs = 0;
var $sum_capture = TRUE;
var $sum_inSection = FALSE;
var $sum_summary = '';
var $sum_pageTitle = FALSE;
function document_start() {
$this->doc .= DOKU_LF.'<div>'.DOKU_LF;
}
function document_end() {
$this->doc = $this->sum_summary;
$this->doc .= DOKU_LF.'</div>'.DOKU_LF;
}
function toc_open() {
$this->sum_summary .= $this->doc;
}
function toc_close() {
$this->doc = '';
}
function header($text, $level, $pos) {
if ( !$this->sum_pageTitle ) {
$this->info['sum_pagetitle'] = $text;
$this->sum_pageTitle = TRUE;
}
$this->doc .= DOKU_LF.'<h'.$level.'>';
$this->doc .= $this->_xmlEntities($text);
$this->doc .= "</h$level>".DOKU_LF;
}
function section_open($level) {
if ( $this->sum_capture ) {
$this->sum_inSection = TRUE;
}
}
function section_close() {
if ( $this->sum_capture && $this->sum_inSection ) {
$this->sum_summary .= $this->doc;
$this->sum_capture = FALSE;
}
}
function p_open() {
if ( $this->sum_capture && $this->sum_paragraphs < 2 ) {
$this->sum_paragraphs++;
}
parent :: p_open();
}
function p_close() {
parent :: p_close();
if ( $this->sum_capture && $this->sum_paragraphs >= 2 ) {
$this->sum_summary .= $this->doc;
$this->sum_capture = FALSE;
}
}
}
//Setup VIM: ex: et ts=2 enc=utf-8 :

View File

@ -1,7 +1,7 @@
<?php
/**
* Utilities for collecting data from config files
*
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Andreas Gohr <andi@splitbrain.org>
@ -24,7 +24,7 @@
function p_wiki_xhtml($id, $rev='', $excuse=true){
$file = wikiFN($id,$rev);
$ret = '';
//ensure $id is in global $ID (needed for parsing)
global $ID;
$keep = $ID;
@ -217,7 +217,7 @@ function p_get_instructions($text){
// Create the parser
$Parser = & new Doku_Parser();
// Add the Handler
$Parser->Handler = & new Doku_Handler();
@ -230,7 +230,7 @@ function p_get_instructions($text){
$p = $Parser->parse($text);
// dbg($p);
return $p;
}
}
/**
* returns all available parser syntax modes in correct order
@ -252,12 +252,12 @@ function p_get_parsermodes(){
// we now collect all syntax modes and their objects, then they will
// be sorted and added to the parser in correct order
$modes = array();
// add syntax plugins
$pluginlist = plugin_list('syntax');
if(count($pluginlist)){
global $PARSER_MODES;
$obj = null;
$obj = null;
foreach($pluginlist as $p){
if(!$obj =& plugin_load('syntax',$p)) continue; //attempt to load plugin into $obj
$PARSER_MODES[$obj->getType()][] = "plugin_$p"; //register mode type
@ -285,18 +285,18 @@ function p_get_parsermodes(){
$class = "Doku_Parser_Mode_$m";
$obj = new $class();
$modes[] = array(
'sort' => $obj->getSort(),
'sort' => $obj->getSort(),
'mode' => $m,
'obj' => $obj
);
}
// add formatting modes
$fmt_modes = array('strong','emphasis','underline','monospace',
'subscript','superscript','deleted');
foreach($fmt_modes as $m){
$obj = new Doku_Parser_Mode_formatting($m);
$modes[] = array(
$modes[] = array(
'sort' => $obj->getSort(),
'mode' => $m,
'obj' => $obj
@ -310,8 +310,8 @@ function p_get_parsermodes(){
$modes[] = array('sort' => $obj->getSort(), 'mode' => 'acronym','obj' => $obj );
$obj = new Doku_Parser_Mode_entity(array_keys(getEntities()));
$modes[] = array('sort' => $obj->getSort(), 'mode' => 'entity','obj' => $obj );
// add optional camelcase mode
if($conf['camelcase']){
$obj = new Doku_Parser_Mode_camelcaselink();
@ -363,14 +363,14 @@ function p_render($mode,$instructions,& $info){
$Renderer->acronyms = getAcronyms();
$Renderer->interwiki = getInterwiki();
#$Renderer->badwords = getBadWords();
// Loop through the instructions
foreach ( $instructions as $instruction ) {
// Execute the callback against the Renderer
call_user_func_array(array(&$Renderer, $instruction[0]),$instruction[1]);
}
//set info array
//set info array
$info = $Renderer->info;
// Return the output

View File

@ -1,7 +1,7 @@
<?php
/**
* Utilities for handling plugins
*
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/
@ -72,7 +72,7 @@ function &plugin_load($type,$name){
//construct class and instanciate
$class = $type.'_plugin_'.$name;
if (!class_exists($class)) return null;
$DOKU_PLUGINS[$type][$name] = new $class;
return $DOKU_PLUGINS[$type][$name];
}

View File

@ -222,14 +222,14 @@ function search_pagename(&$data,$base,$file,$type,$lvl,$opts){
//only search txt files
if(!preg_match('#\.txt$#',$file)) return true;
//simple stringmatching
//simple stringmatching
if (!empty($opts['query'])){
if(strpos($file,$opts['query']) !== false){
//check ACL
$id = pathID($file);
if(auth_quickaclcheck($id) < AUTH_READ){
return false;
}
}
$data[]['id'] = $id;
}
}
@ -287,7 +287,7 @@ function search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
foreach($instructions as $ins){
if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink') ){
$mid = $ins[1][0];
resolve_pageid($cns,$mid,$exists); //exists is not used
resolve_pageid($cns,$mid,$exists); //exists is not used
if($mid == $sid){
//we have a match - finish
$data[]['id'] = $cid;
@ -319,11 +319,11 @@ function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){
return false;
}
//create regexp from queries
//create regexp from queries
$poswords = array();
$negwords = array();
$qpreg = preg_split('/\s+/',$opts['query']);
foreach($qpreg as $word){
switch(substr($word,0,1)){
case '-':
@ -344,7 +344,7 @@ function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){
// a search without any posword is useless
if (!count($poswords)) return true;
$reg = '^(?=.*?'.join(')(?=.*?',$poswords).')';
$reg .= count($negwords) ? '((?!'.join('|',$negwords).').)*$' : '.*$';
search_regex($data,$base,$file,$reg,$poswords);
@ -373,10 +373,10 @@ function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){
*/
function search_reference(&$data,$base,$file,$type,$lvl,$opts){
global $conf;
//we do nothing with directories
if($type == 'd') return true;
//only search txt files
if(!preg_match('#\.txt$#',$file)) return true;
@ -384,7 +384,7 @@ function search_reference(&$data,$base,$file,$type,$lvl,$opts){
//'false' will skip subdirectories to speed search up.
$cnt = $conf['refshow'] > 0 ? $conf['refshow'] : 1;
if(count($data) >= $cnt) return false;
$reg = '\{\{ *\:?'.$opts['query'].' *(\|.*)?\}\}';
search_regex($data,$base,$file,$reg,array($opts['query']));
return true;
@ -438,7 +438,7 @@ function search_regex(&$data,$base,$file,$reg,$words){
'snippet' => $snippet,
);
}
return true;
}

View File

@ -120,12 +120,12 @@ function tpl_content(){
break;
case 'profile' :
html_updateprofile();
break;
break;
case 'admin':
tpl_admin();
break;
default:
msg("Failed to handle command: ".hsc($ACT),-1);
msg("Failed to handle command: ".hsc($ACT),-1);
}
}
@ -252,7 +252,7 @@ function tpl_pagelink($id,$name=NULL){
*/
function tpl_getparent($ID){
global $conf;
if ($ID != $conf['start']) {
$idparts = explode(':', $ID);
$pn = array_pop($idparts); // get the page name
@ -270,7 +270,7 @@ function tpl_getparent($ID){
}
}
}
if (@file_exists(wikiFN($ID))) {
return $ID;
}
@ -304,7 +304,7 @@ function tpl_button($type){
global $NS;
global $INFO;
global $conf;
global $auth;
global $auth;
switch($type){
case 'edit':
@ -393,7 +393,7 @@ function tpl_actionlink($type,$pre='',$suf=''){
global $ACT;
global $conf;
global $lang;
global $auth;
global $auth;
switch($type){
case 'edit':
@ -490,7 +490,7 @@ function tpl_actionlink($type,$pre='',$suf=''){
function tpl_searchform($ajax=true,$autocomplete=true){
global $lang;
global $ACT;
print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search"><div class="no">';
print '<input type="hidden" name="do" value="search" />';
print '<input type="text" ';
@ -705,7 +705,7 @@ function tpl_mediafilelist(){
ptln('('.$w.'&#215;'.$h.' '.filesize_h($item['size']).')',6);
ptln($del.'<br />',6);
ptln('<div class="imagemeta">',6);
//build thumbnail
print '<a href="javascript:mediaSelect(\''.$item['id'].'\')">';
@ -726,7 +726,7 @@ function tpl_mediafilelist(){
print '<img src="'.$src.'" '.$att.' />';
print '</a>';
//read EXIF/IPTC data
$t = $item['meta']->getField('IPTC.Headline');
if($t) print '<strong>'.$t.'</strong><br />';
@ -767,7 +767,7 @@ function tpl_showreferences(&$data){
global $lang;
$hidden=0; //count of hits without read permission
if(count($data)){
usort($data,'sort_search_fulltext');
foreach($data as $row){

View File

@ -1,7 +1,7 @@
<?php
/**
* Editing toolbar functions
*
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/
@ -21,9 +21,9 @@ require_once(DOKU_INC.'inc/JSON.php');
function toolbar_JSdefines($varname){
global $ID;
global $conf;
global $lang;
global $lang;
// build button array
// build button array
$menu = array(
array(
'type' => 'format',
@ -169,7 +169,7 @@ function toolbar_JSdefines($varname){
'key' => 'y',
),
);
// use JSON to build the JavaScript array
$json = new JSON();
print "var $varname = ".$json->encode($menu).";\n";

View File

@ -123,7 +123,7 @@ function utf8_substr($str,$start,$length=null){
} else {
return join("",array_slice($ar[0],$start));
}
}
}
/**
* Unicode aware replacement for substr_replace()
@ -142,7 +142,7 @@ function utf8_substr_replace($string, $replacement, $start , $length=0 ){
/**
* Unicode aware replacement for explode
*
* @TODO support third limit arg
* @TODO support third limit arg
* @author Harry Fuecks <hfuecks@gmail.com>
* @see explode();
*/
@ -182,7 +182,7 @@ function utf8_str_replace($s,$r,$str){
*/
function utf8_ltrim($str,$charlist=''){
if($charlist == '') return ltrim($str);
//quote charlist for use in a characterclass
$charlist = preg_replace('!([\\\\\\-\\]\\[/])!','\\\${1}',$charlist);
@ -198,10 +198,10 @@ function utf8_ltrim($str,$charlist=''){
*/
function utf8_rtrim($str,$charlist=''){
if($charlist == '') return rtrim($str);
//quote charlist for use in a characterclass
$charlist = preg_replace('!([\\\\\\-\\]\\[/])!','\\\${1}',$charlist);
return preg_replace('/['.$charlist.']+$/u','',$str);
}
@ -233,7 +233,7 @@ function utf8_strtolower($string){
return mb_strtolower($string,'utf-8');
global $UTF8_UPPER_TO_LOWER;
$uni = utf8_to_unicode($string);
$uni = utf8_to_unicode($string);
$cnt = count($uni);
for ($i=0; $i < $cnt; $i++){
if($UTF8_UPPER_TO_LOWER[$uni[$i]]){
@ -344,7 +344,7 @@ function utf8_strpos($haystack, $needle,$offset=0) {
trigger_error('Offset must be an integer',E_USER_WARNING);
return false;
}
$str = utf8_substr($str, $offset);
if ( false !== ($pos = utf8_strpos($str,$needle))){
@ -379,7 +379,7 @@ function utf8_tohtml ($str) {
}
}
return $ret . substr($str, $last, $i); // append the last batch of regular characters
}
}
/**
* This function returns any UTF-8 encoded text as a list of
@ -390,10 +390,10 @@ function utf8_tohtml ($str) {
* @see unicode_to_utf8()
*/
function utf8_to_unicode( &$str ) {
$unicode = array();
$unicode = array();
$values = array();
$lookingFor = 1;
for ($i = 0; $i < strlen( $str ); $i++ ) {
$thisValue = ord( $str[ $i ] );
if ( $thisValue < 128 ) $unicode[] = $thisValue;
@ -403,7 +403,7 @@ function utf8_to_unicode( &$str ) {
if ( count( $values ) == $lookingFor ) {
$number = ( $lookingFor == 3 ) ?
( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):
( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );
( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );
$unicode[] = $number;
$values = array();
$lookingFor = 1;
@ -518,7 +518,7 @@ static $UTF8_LOWER_TO_UPPER = array(
0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102,
0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9,
0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122,
);
);
/**
* UTF-8 Case lookup table
@ -540,20 +540,20 @@ $UTF8_UPPER_TO_LOWER = @array_flip($UTF8_LOWER_TO_UPPER);
* @see utf8_deaccent()
*/
$UTF8_LOWER_ACCENTS = array(
'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o',
'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k',
'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o',
'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o',
'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c',
'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't',
'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l',
'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z',
'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't',
'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o',
'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j',
'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o',
'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g',
'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a',
'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o',
'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k',
'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o',
'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o',
'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c',
'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't',
'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l',
'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z',
'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't',
'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o',
'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j',
'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o',
'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g',
'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a',
'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u',
);
@ -567,20 +567,20 @@ $UTF8_LOWER_ACCENTS = array(
* @see utf8_deaccent()
*/
$UTF8_UPPER_ACCENTS = array(
'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O',
'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K',
'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O',
'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O',
'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C',
'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T',
'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L',
'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z',
'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T',
'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O',
'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J',
'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O',
'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G',
'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A',
'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O',
'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K',
'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O',
'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O',
'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C',
'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T',
'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L',
'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z',
'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T',
'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O',
'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J',
'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O',
'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G',
'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A',
'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae',
);
@ -605,50 +605,50 @@ $UTF8_SPECIAL_CHARS = array(
0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e,
0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088,
0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092,
0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c,
0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6,
0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0,
0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba,
0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00d7, 0x00f7, 0x02c7, 0x02d8, 0x02d9,
0x02da, 0x02db, 0x02dc, 0x02dd, 0x0300, 0x0301, 0x0303, 0x0309, 0x0323, 0x0384,
0x0385, 0x0387, 0x03b2, 0x03c6, 0x03d1, 0x03d2, 0x03d5, 0x03d6, 0x05b0, 0x05b1,
0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, 0x05bb, 0x05bc,
0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f3, 0x05f4, 0x060c,
0x061b, 0x061f, 0x0640, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651,
0x0652, 0x066a, 0x0e3f, 0x200c, 0x200d, 0x200e, 0x200f, 0x2013, 0x2014, 0x2015,
0x2017, 0x2018, 0x2019, 0x201a, 0x201c, 0x201d, 0x201e, 0x2020, 0x2021, 0x2022,
0x2026, 0x2030, 0x2032, 0x2033, 0x2039, 0x203a, 0x2044, 0x20a7, 0x20aa, 0x20ab,
0x20ac, 0x2116, 0x2118, 0x2122, 0x2126, 0x2135, 0x2190, 0x2191, 0x2192, 0x2193,
0x2194, 0x2195, 0x21b5, 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x2200, 0x2202,
0x2203, 0x2205, 0x2206, 0x2207, 0x2208, 0x2209, 0x220b, 0x220f, 0x2211, 0x2212,
0x2215, 0x2217, 0x2219, 0x221a, 0x221d, 0x221e, 0x2220, 0x2227, 0x2228, 0x2229,
0x222a, 0x222b, 0x2234, 0x223c, 0x2245, 0x2248, 0x2260, 0x2261, 0x2264, 0x2265,
0x2282, 0x2283, 0x2284, 0x2286, 0x2287, 0x2295, 0x2297, 0x22a5, 0x22c5, 0x2310,
0x2320, 0x2321, 0x2329, 0x232a, 0x2469, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514,
0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2550, 0x2551, 0x2552, 0x2553,
0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d,
0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590,
0x2591, 0x2592, 0x2593, 0x25a0, 0x25b2, 0x25bc, 0x25c6, 0x25ca, 0x25cf, 0x25d7,
0x2605, 0x260e, 0x261b, 0x261e, 0x2660, 0x2663, 0x2665, 0x2666, 0x2701, 0x2702,
0x2703, 0x2704, 0x2706, 0x2707, 0x2708, 0x2709, 0x270c, 0x270d, 0x270e, 0x270f,
0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719,
0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, 0x2720, 0x2721, 0x2722, 0x2723,
0x2724, 0x2725, 0x2726, 0x2727, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e,
0x272f, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738,
0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, 0x2740, 0x2741, 0x2742,
0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274a, 0x274b, 0x274d,
0x274f, 0x2750, 0x2751, 0x2752, 0x2756, 0x2758, 0x2759, 0x275a, 0x275b, 0x275c,
0x275d, 0x275e, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x277f,
0x2789, 0x2793, 0x2794, 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e,
0x279f, 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, 0x27a8,
0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, 0x27b1, 0x27b2, 0x27b3,
0x27b4, 0x27b5, 0x27b6, 0x27b7, 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd,
0x27be, 0xf6d9, 0xf6da, 0xf6db, 0xf8d7, 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc,
0xf8dd, 0xf8de, 0xf8df, 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6,
0xf8e7, 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0,
0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7, 0xf8f8, 0xf8f9, 0xf8fa,
0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xfe7c, 0xfe7d,
0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c,
0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6,
0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0,
0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba,
0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00d7, 0x00f7, 0x02c7, 0x02d8, 0x02d9,
0x02da, 0x02db, 0x02dc, 0x02dd, 0x0300, 0x0301, 0x0303, 0x0309, 0x0323, 0x0384,
0x0385, 0x0387, 0x03b2, 0x03c6, 0x03d1, 0x03d2, 0x03d5, 0x03d6, 0x05b0, 0x05b1,
0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, 0x05bb, 0x05bc,
0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f3, 0x05f4, 0x060c,
0x061b, 0x061f, 0x0640, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651,
0x0652, 0x066a, 0x0e3f, 0x200c, 0x200d, 0x200e, 0x200f, 0x2013, 0x2014, 0x2015,
0x2017, 0x2018, 0x2019, 0x201a, 0x201c, 0x201d, 0x201e, 0x2020, 0x2021, 0x2022,
0x2026, 0x2030, 0x2032, 0x2033, 0x2039, 0x203a, 0x2044, 0x20a7, 0x20aa, 0x20ab,
0x20ac, 0x2116, 0x2118, 0x2122, 0x2126, 0x2135, 0x2190, 0x2191, 0x2192, 0x2193,
0x2194, 0x2195, 0x21b5, 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x2200, 0x2202,
0x2203, 0x2205, 0x2206, 0x2207, 0x2208, 0x2209, 0x220b, 0x220f, 0x2211, 0x2212,
0x2215, 0x2217, 0x2219, 0x221a, 0x221d, 0x221e, 0x2220, 0x2227, 0x2228, 0x2229,
0x222a, 0x222b, 0x2234, 0x223c, 0x2245, 0x2248, 0x2260, 0x2261, 0x2264, 0x2265,
0x2282, 0x2283, 0x2284, 0x2286, 0x2287, 0x2295, 0x2297, 0x22a5, 0x22c5, 0x2310,
0x2320, 0x2321, 0x2329, 0x232a, 0x2469, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514,
0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2550, 0x2551, 0x2552, 0x2553,
0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d,
0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590,
0x2591, 0x2592, 0x2593, 0x25a0, 0x25b2, 0x25bc, 0x25c6, 0x25ca, 0x25cf, 0x25d7,
0x2605, 0x260e, 0x261b, 0x261e, 0x2660, 0x2663, 0x2665, 0x2666, 0x2701, 0x2702,
0x2703, 0x2704, 0x2706, 0x2707, 0x2708, 0x2709, 0x270c, 0x270d, 0x270e, 0x270f,
0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719,
0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, 0x2720, 0x2721, 0x2722, 0x2723,
0x2724, 0x2725, 0x2726, 0x2727, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e,
0x272f, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738,
0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, 0x2740, 0x2741, 0x2742,
0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274a, 0x274b, 0x274d,
0x274f, 0x2750, 0x2751, 0x2752, 0x2756, 0x2758, 0x2759, 0x275a, 0x275b, 0x275c,
0x275d, 0x275e, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x277f,
0x2789, 0x2793, 0x2794, 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e,
0x279f, 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, 0x27a8,
0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, 0x27b1, 0x27b2, 0x27b3,
0x27b4, 0x27b5, 0x27b6, 0x27b7, 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd,
0x27be, 0xf6d9, 0xf6da, 0xf6db, 0xf8d7, 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc,
0xf8dd, 0xf8de, 0xf8df, 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6,
0xf8e7, 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0,
0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7, 0xf8f8, 0xf8f9, 0xf8fa,
0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xfe7c, 0xfe7d,
);
/**
@ -786,7 +786,7 @@ $UTF8_ROMANIZATION = array(
'ウォ'=>'who','ウゥ'=>'whu','ヱ'=>'wye','ヰ'=>'wyi','ジャ'=>'zha','ジェ'=>'zhe',
'ジィ'=>'zhi','ジョ'=>'zho','ジュ'=>'zhu','ジャ'=>'zya','ジェ'=>'zye','ジィ'=>'zyi',
'ジョ'=>'zyo','ジュ'=>'zyu',
// "Greeklish"
'Γ'=>'G','Δ'=>'E','Θ'=>'Th','Λ'=>'L','Ξ'=>'X','Π'=>'P','Σ'=>'S','Φ'=>'F','Ψ'=>'Ps',
'γ'=>'g','δ'=>'e','θ'=>'th','λ'=>'l','ξ'=>'x','π'=>'p','σ'=>'s','φ'=>'f','ψ'=>'ps',

View File

@ -14,47 +14,47 @@
$IMG = getID('media');
$ID = cleanID($_REQUEST['id']);
if($conf['allowdebug'] && $_REQUEST['debug']){
print '<pre>';
foreach(explode(' ','basedir userewrite baseurl useslash') as $x){
print '$'."conf['$x'] = '".$conf[$x]."';\n";
}
foreach(explode(' ','DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF '.
if($conf['allowdebug'] && $_REQUEST['debug']){
print '<pre>';
foreach(explode(' ','basedir userewrite baseurl useslash') as $x){
print '$'."conf['$x'] = '".$conf[$x]."';\n";
}
foreach(explode(' ','DOCUMENT_ROOT HTTP_HOST SCRIPT_FILENAME PHP_SELF '.
'REQUEST_URI SCRIPT_NAME PATH_INFO PATH_TRANSLATED') as $x){
print '$'."_SERVER['$x'] = '".$_SERVER[$x]."';\n";
}
print "getID('media'): ".getID('media')."\n";
print '$'."_SERVER['$x'] = '".$_SERVER[$x]."';\n";
}
print "getID('media'): ".getID('media')."\n";
print "getID('media',false): ".getID('media',false)."\n";
print '</pre>';
}
print '</pre>';
}
$ERROR = false;
// check image permissions
$AUTH = auth_quickaclcheck($IMG);
if($AUTH >= AUTH_READ){
// check if image exists
$SRC = mediaFN($IMG);
$SRC = mediaFN($IMG);
if(!file_exists($SRC)){
//doesn't exist!
}
}else{
}
}else{
// no auth
$ERROR = p_locale_xhtml('denied');
$ERROR = p_locale_xhtml('denied');
}
/*if(!$ERROR){
// load EXIF/IPTC/image details
$INFO = array();
$INFO['std']['']
imagesize
$INFO['std']['']
imagesize
}*/
//start output and load template
header('Content-Type: text/html; charset=utf-8');
include(template('detail.php'));
//restore old umask
umask($conf['oldumask']);