Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cache/recent.dat
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
1287527801 FrontPage
1473950089 QBlog
1468731422 FrontPage
1468398282 NewPage
2 changes: 2 additions & 0 deletions cache/tinyurl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ UNQ0ge,QHMAdmin
i1ov0C,RecentChanges
C8fJ5h,SiteNavigator
27d2mO,SiteNavigator2
4bRVWJ,QBlog
mRJ5Us,QBlogMenuBar
12 changes: 6 additions & 6 deletions lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function read()
if (! is_page($this->page)) return FALSE;

$this->objs = array();
$obj = & new ConfigTable('');
$obj = new ConfigTable('');
$matches = array();

foreach (get_source($this->page) as $line) {
Expand All @@ -57,22 +57,22 @@ function read()

if ($level == 1) {
$this->objs[$obj->title] = $obj;
$obj = & new ConfigTable($line);
$obj = new ConfigTable($line);
} else {
if (! is_a($obj, 'ConfigTable_Direct'))
$obj = & new ConfigTable_Direct('', $obj);
$obj = new ConfigTable_Direct('', $obj);
$obj->set_key($line);
}

} else if ($head == '-' && $level > 1) {
if (! is_a($obj, 'ConfigTable_Direct'))
$obj = & new ConfigTable_Direct('', $obj);
$obj = new ConfigTable_Direct('', $obj);
$obj->add_value($line);

} else if ($head == '|' && preg_match('/^\|(.+)\|\s*$/', $line, $matches)) {
// Table row
if (! is_a($obj, 'ConfigTable_Sequential'))
$obj = & new ConfigTable_Sequential('', $obj);
$obj = new ConfigTable_Sequential('', $obj);
// Trim() each table cell
$obj->add_value(array_map('trim', explode('|', $matches[1])));
} else {
Expand Down Expand Up @@ -109,7 +109,7 @@ function add($title, $value)
function & get_object($title)
{
if (! isset($this->objs[$title]))
$this->objs[$title] = & new ConfigTable('*' . trim($title) . "\n");
$this->objs[$title] = new ConfigTable('*' . trim($title) . "\n");
return $this->objs[$title];
}

Expand Down
53 changes: 17 additions & 36 deletions lib/convert_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function & insert(& $obj)
$obj->setParent($this);
$this->elements[] = & $obj;

return $this->last = & $obj->last;
$this->last = & $obj->last;
return $this->last;
}

function canContain($obj)
Expand Down Expand Up @@ -98,13 +99,9 @@ function & Factory_Inline($text)
{
// Check the first letter of the line
if (substr($text, 0, 1) == '~') {
$ret = & new Paragraph(' ' . substr($text, 1));
return $ret;
//return new Paragraph(' ' . substr($text, 1));
return new Paragraph(' ' . substr($text, 1));
} else {
$ret = & new Inline($text);
return $ret;
//return new Inline($text);
return new Inline($text);
}
}

Expand All @@ -114,9 +111,7 @@ function & Factory_DList(& $root, $text)
if (count($out) < 2) {
return Factory_Inline($text);
} else {
$ret = & new DList($out);
return $ret;
//return new DList($out);
return new DList($out);
}
}

Expand All @@ -126,23 +121,17 @@ function & Factory_Table(& $root, $text)
if (! preg_match('/^\|(.+)\|([hHfFcC]?)$/', $text, $out)) {
return Factory_Inline($text);
} else {
$ret = & new Table($out);
return $ret;
//return new Table($out);
return new Table($out);
}
}

// Comma-separated table
function & Factory_YTable(& $root, $text)
{
if ($text == ',') {
$ret = Factory_Inline($text);
return $ret;
//return Factory_Inline($text);
return Factory_Inline($text);
} else {
$ret = new YTable(csv_explode(',', substr($text, 1)));
return $ret;
//return new YTable(csv_explode(',', substr($text, 1)));
return new YTable(csv_explode(',', substr($text, 1)));
}
}

Expand All @@ -155,9 +144,7 @@ function & Factory_Div(& $root, $text)
// Usual code
if (preg_match('/^\#([^\(]+)(?:\((.*)\))?/', $text, $matches) &&
exist_plugin_convert($matches[1])) {
$ret = & new Div($matches);
return $ret;
//return new Div($matches);
return new Div($matches);
}
} else {
// Hack code
Expand All @@ -166,21 +153,15 @@ function & Factory_Div(& $root, $text)
$len = strlen($matches[3]);
$body = array();
if ($len == 0) {
$ret = & new Div($matches); // Seems legacy block plugin
return $ret;
//return new Div($matches); // Seems legacy block plugin
return new Div($matches); // Seems legacy block plugin
} else if (preg_match('/\{{' . $len . '}\s*\r(.*)\r\}{' . $len . '}/', $text, $body)) {
$matches[2] .= "\r" . $body[1] . "\r";
$ret = & new Div($matches);
return $ret;
//return new Div($matches); // Seems multiline-enabled block plugin
return new Div($matches); // Seems multiline-enabled block plugin
}
}
}

$ret = & new Paragraph($text);
return $ret;
//return new Paragraph($text);
return new Paragraph($text);
}

// Inline elements
Expand Down Expand Up @@ -212,7 +193,7 @@ function toString()

function & toPara($class = '')
{
$obj = & new Paragraph('', $class);
$obj = new Paragraph('', $class);
$obj->insert($this);
return $obj;
}
Expand Down Expand Up @@ -714,7 +695,7 @@ function Table($out)
$is_template = ($this->type == 'c');
$row = array();
foreach ($cells as $cell)
$row[] = & new TableCell($cell, $is_template);
$row[] = new TableCell($cell, $is_template);
$this->elements[] = $row;
}
}
Expand Down Expand Up @@ -971,7 +952,7 @@ class Body extends Element
function Body($id)
{
$this->id = $id;
$this->contents = & new Element();
$this->contents = new Element();
$this->contents_last = & $this->contents;
parent::Element();
}
Expand Down Expand Up @@ -1099,7 +1080,7 @@ function parse(& $lines)
global $autolink, $killer_fg, $killer_bg;
$autolink = 0;
$tmpstr = htmlspecialchars($matches[2]);
list($killer_fg, $killer_bg) = split(",", $tmpstr);
list($killer_fg, $killer_bg) = preg_split('/,/', $tmpstr);
continue;
}

Expand All @@ -1110,7 +1091,7 @@ function parse(& $lines)
$killer_page2 = array();
$tmpstr = htmlspecialchars($matches[2]);
list($fg, $bg, $width, $padding, $bg_body, $fg_body)
= array_pad(split(",", $tmpstr),6,'');
= array_pad(preg_split('/,/', $tmpstr),6,'');
$width = ($width!='' && preg_match('/^[0-9]+$/',$width)) ? $width : 720;
$padding = ($padding!='' && preg_match('/^[0-9]+$/',$width))
? $padding : '60';
Expand Down
8 changes: 4 additions & 4 deletions lib/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ function get_autolink_pattern(& $pages)
{
global $WikiName, $autolink, $nowikiname;

$config = &new Config('AutoLink');
$config = new Config('AutoLink');
$config->read();
$ignorepages = $config->get('IgnoreList');
$forceignorepages = $config->get('ForceIgnoreList');
Expand Down Expand Up @@ -810,7 +810,7 @@ function csv_implode($glue, $pieces)
$_glue = ($glue != '') ? '\\' . $glue{0} : '';
$arr = array();
foreach ($pieces as $str) {
if (ereg('[' . $_glue . '"' . "\n\r" . ']', $str))
if (preg_match('/[' . '"' . "\n\r" . $_glue . ']/', $str))
$str = '"' . str_replace('"', '""', $str) . '"';
$arr[] = $str;
}
Expand Down Expand Up @@ -896,9 +896,9 @@ function strip_adcode($str)

if($match != ''){
foreach($adcode as $var){
$reg_str_2 = '^' . $var . '=';
$reg_str_2 = '/^' . $var . '=/';

if (ereg($reg_str_2, $str)){
if (preg_match($reg_str_2, $str)){
return $defaultpage;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// PukiWiki version / Copyright / Licence

define('S_VERSION', '1.4.7');
define('QHM_VERSION', '6.0.11'); //絶対に編集しないで下さい
define('QHM_VERSION', '7.0.0.beta.4'); //絶対に編集しないで下さい
define('QHM_OPTIONS', 'update=download; support=false; banner=true');
define('S_COPYRIGHT',
'powered by <strong><a href="http://www.open-qhm.net/">QHM</a> ' . QHM_VERSION . '</strong> haik<br />' .
'powered by <strong><a href="http://www.open-qhm.net/">HAIK</a> ' . QHM_VERSION . '</strong><br />' .
' based on <a href="http://pukiwiki.sourceforge.jp/">PukiWiki</a> ' . S_VERSION . ' ' .
' License is <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.'
);
Expand Down
2 changes: 1 addition & 1 deletion lib/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function & links_get_objects($page, $refresh = FALSE)
static $obj;

if (! isset($obj) || $refresh)
$obj = & new InlineConverter(NULL, array('note'));
$obj = new InlineConverter(NULL, array('note'));

$result = $obj->get_objects(join('', preg_grep('/^(?!\/\/|\s)./', get_source($page))), $page);
return $result;
Expand Down
8 changes: 4 additions & 4 deletions lib/qdmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ function & getInstance(){

return $instance[0];
}
$instance[0] = & new Qdmail();
$instance[0] = new Qdmail();
return $instance[0];
}
//--------------------------
Expand Down Expand Up @@ -3644,7 +3644,7 @@ function & smtpObject( $null = false ){
}elseif( !class_exists ( 'Qdsmtp' ) && !file_exists( 'qdsmtp.php' )){
return $this->errorGather('Plese load SMTP Program - Qdsmtp http://hal456.net/qdsmtp',__LINE__);
}
$this->smtp_object = & new Qdsmtp();
$this->smtp_object = new Qdsmtp();
return $this->smtp_object;
}
function setSmtpObject( & $obj ){
Expand Down Expand Up @@ -3738,7 +3738,7 @@ function & smtpObject(){
return $this->errorGather('Qdmail<->CakePHP Component Load Error , the name is Qdsmtp',__LINE__);
}
}
$this->Qdsmtp = & new QdsmtpComponent();
$this->Qdsmtp = new QdsmtpComponent();
if( !is_object( $this->Qdsmtp ) ){
return $this->errorGather('Qdmail<->CakePHP Component making Instance Error , the name is QdsmtpComponent',__LINE__);
}
Expand Down Expand Up @@ -3787,7 +3787,7 @@ function cakeRender( $content , $type , $org_charset = null , $target_charset =
}
}
$type = strtolower( $type );
$view = & new $this->Controller->view( $this->Controller , false );
$view = new $this->Controller->view( $this->Controller , false );
$view->layout = $this->layout;
$mess = null;
$content = $view->renderElement( $this->view_dir . DS . $type . DS . $this->template , array('content' => $content ) , true );
Expand Down
25 changes: 9 additions & 16 deletions lib/qhm_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$qt->getv('lastscript')? '': $qt->setv('lastscript', '');
$qt->setv('_page', $_page);
$qt->setv('_script', $script);
$qt->setv('auth_link', ($qhm_adminmenu <= 1) ? ('<a href="' . h($script . '?cmd=qhmauth') . '" class="qhm-auth-link">QHM</a>') : '');
$qt->setv('auth_link', ($qhm_adminmenu <= 1) ? ('<a href="' . h($script . '?cmd=qhmauth') . '" class="qhm-auth-link">HAIK</a>') : '');
//head
$qt->setv('headcopy_is_empty', trim($headcopy) === '');
if ( ! $qt->getv('headcopy_is_empty'))
Expand Down Expand Up @@ -269,19 +269,10 @@
'qblognewlink' => array('name'=>'記事の追加', 'link'=>$script.'?cmd=qblog&mode=addpost', 'style'=>'', 'class'=>'', 'visible'=>TRUE),
)
),
'haiklink' => array(
'name' => 'テーマ',
'link' => '',
'style' => 'margin-top:1.1em;',
'class' => '',
'visible' => true,
'sub' => array(
'haikskincustomizer' => array('name'=>'編集', 'link'=>$link_haik_skin_customizer, 'style'=>'', 'class'=>'', 'visible'=>TRUE),
'haikpreviewlink' => array('name'=>'<span class="hidden-xs hidden-sm"><i class="glyphicon glyphicon-phone"></i> <span class="sr-only">モバイル</span>プレビュー</span>', 'link'=>'#', 'style'=>'', 'class' => '', 'visible'=>TRUE),
),
),
'haikskincustomizer' => array('name'=>'テーマ編集', 'link'=>$link_haik_skin_customizer, 'style'=>'margin-top:1.1em;', 'class'=>'', 'visible'=>TRUE),
'haikpreviewlink' => array('name'=>'<span class="hidden-xs hidden-sm"><i class="glyphicon glyphicon-phone"></i> <span class="sr-only">モバイル</span>プレビュー</span>', 'link'=>'#', 'style'=>'', 'class' => '', 'visible'=>TRUE),
'configlink' => array('name'=>$qm->m['qhm_init']['configlink_name'], 'link'=>$link_qhm_setting, 'style'=>'margin-top:1.1em;', 'visible'=>true, 'sub'=>array()),
'helplink' => array('name'=>'open-qhm.net', 'link'=>$link_help, 'style'=>'', 'visible'=>true, 'sub'=>array()),
// 'helplink' => array('name'=>'open-qhm.net', 'link'=>$link_help, 'style'=>'', 'visible'=>true, 'sub'=>array()),
'passwordlink' => array('name'=>$qm->m['qhm_init']['passwordlink_name'], 'link'=>$link_password, 'style'=>'', 'visible'=>true, 'sub'=>array()),
'logoutlink' => array('name'=>$qm->m['qhm_init']['logoutlink_name'], 'link'=>$link_qhm_logout, 'style'=>'margin-top:1.1em;', 'visible'=>true, 'sub'=>array()),
'updatelink' => array('name'=>$qm->m['qhm_init']['updatelink_name'], 'link'=>$link_qhm_update, 'style'=>'margin-top:1.1em;', 'visible'=>true, 'sub'=>array()),
Expand Down Expand Up @@ -377,7 +368,8 @@
}
if (strpos($style_name, 'haik_') !== 0)
{
if (isset($tools['haiklink'])) unset($tools['haiklink']);
if (isset($tools['haikskincustomizer'])) unset($tools['haikskincustomizer']);
if (isset($tools['haikpreviewlink'])) unset($tools['haikpreviewlink']);
}
else
{
Expand All @@ -403,7 +395,8 @@
if (isset($tools['toollink'])) unset($tools['toollink']);
if (isset($tools['configlink'])) unset($tools['configlink']);
if (isset($tools['helplink'])) unset($tools['helplink']);
if (isset($tools['haiklink'])) unset($tools['haiklink']);
if (isset($tools['haikskincustomizer'])) unset($tools['haikskincustomizer']);
if (isset($tools['haikpreviewlink'])) unset($tools['haikpreviewlink']);
}
else {
if (isset($tools['passwordlink'])) unset($tools['passwordlink']);
Expand Down Expand Up @@ -772,7 +765,7 @@
}

//license
$qhm_admin_tag = ($qhm_adminmenu < 2) ? ' <a href="'. $link_qhm_adminmenu.'">QHM</a> ' : '';
$qhm_admin_tag = ($qhm_adminmenu < 2) ? ' <a href="'. $link_qhm_adminmenu.'">HAIK</a> ' : '';
$qt->setv('licence_tag', "<p>".S_COPYRIGHT. $qhm_admin_tag."</p>");
if($no_qhm_licence){
$qt->setv('licence_tag', '');
Expand Down
2 changes: 1 addition & 1 deletion lib/ss_authform.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function auth_catbody($title, $contents, $retry=false){
</head>
<body>
<div class="wrapper">
<h2 class="title">QHM {$title}</h2>
<h2 class="title">HAIK {$title}</h2>
{$contents}
<div id="scripterror"></div>

Expand Down
4 changes: 2 additions & 2 deletions lib/trackback.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function ref_save($page)
if (! is_writable(TRACKBACK_DIR)) die('Permission denied to write: TRACKBACK_DIR');

// Update referer data
if (ereg("[,\"\n\r]", $url))
if (preg_match("/[,\"\n\r]/", $url))
$url = '"' . str_replace('"', '""', $url) . '"';

$filename = tb_get_filename($page, '.ref');
Expand All @@ -290,7 +290,7 @@ function ref_save($page)
$data[$d_url][2]++;

$fp = fopen($filename, 'w');
if ($fp === FALSE) return FALSE;
if ($fp === FALSE) return FALSE;
set_file_buffer($fp, 0);
flock($fp, LOCK_EX);
rewind($fp);
Expand Down
2 changes: 1 addition & 1 deletion lib/unzip.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function ReadFile($in_FileName)
($aP['FD'] & 0x001f),
(($aP['FD'] & 0xfe00) >> 9) + 1980);

$this->Entries[] = &new SimpleUnzipEntry($aI);
$this->Entries[] = new SimpleUnzipEntry($aI);
} // end for each entries

return $this->Entries;
Expand Down
Loading