Skip to content

Commit

Permalink
Merge pull request #36 from torinky/develop
Browse files Browse the repository at this point in the history
ページ名変更の初期画面にnotvalidエラーが表示される不具合を修正
  • Loading branch information
logue committed May 1, 2016
2 parents 780b7f0 + e181f6a commit b719359
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
13 changes: 8 additions & 5 deletions wiki-common/lib/PukiWiki/Renderer/GuiEdit/Xhtml2Wiki.php
Expand Up @@ -37,9 +37,11 @@ function __construct() {
$this->protect_data = array();
$this->text = '';
}

/**
* 変換メソッド
* @param string $source
* @return mixed|string
*/
function Convert($source) {
$this->body = '';
Expand All @@ -60,7 +62,7 @@ function Convert($source) {
$body = implode('', $this->body);

// 構文補正
$body = preg_replace("/___GUIPD(\d+)___/e", '$this->protect_data["$1"-1]', $body);
$body = preg_replace_callback("/___GUIPD(\d+)___/", function($m){return $this->protect_data[$m[1]-1];}, $body);
$body = preg_replace("/\n\n\n+/", "\n\n", $body);

return $body;
Expand Down Expand Up @@ -389,9 +391,10 @@ function Table($line) {
function GetTableAttribute($attribute) {
$text = '';

$pattern = "/rgb\((\d+),\s(\d+),\s(\d+)\)/ie";
$attribute = preg_replace($pattern, 'sprintf("#%02x%02x%02x", "$1", "$2", "$3")', $attribute);

$pattern = "/rgb\((\d+),\s(\d+),\s(\d+)\)/i";
// $attribute = preg_replace($pattern, 'sprintf("#%02x%02x%02x", "$1", "$2", "$3")', $attribute);
$attribute = preg_replace_callback($pattern, function($m){sprintf("#%02x%02x%02x", $m[1], $m[2], $m[3]);}, $attribute);

// 文字サイズ
if (preg_match("/font-size:\s?(\d+)px/i", $attribute, $matches)) {
$text .= 'SIZE(' . $matches[1] . '):';
Expand Down
@@ -1,5 +1,5 @@
<?php
namespace PukiWiki\Renderer;
namespace PukiWiki\Renderer\GuiEdit;

class Xhtml2WikiFactory{
public static function factory($source)
Expand Down
4 changes: 2 additions & 2 deletions wiki-common/plugin/guiedit.inc.php
Expand Up @@ -31,7 +31,7 @@ function plugin_guiedit_action()
{
// global $vars, $_title_edit, $load_template_func;
global $vars, $load_template_func;
global $menubar, $sidebar, $topicpath;
global $menubar, $sidebar, $topicpath, $_string;

// if (PKWK_READONLY) Utility::dieMessage( sprintf($_string['error_prohibit'],'PKWK_READONLY') );
if (Auth::check_role('readonly')) Utility::dieMessage( sprintf($_string['error_prohibit'],'PKWK_READONLY') );
Expand Down Expand Up @@ -279,7 +279,7 @@ function plugin_guiedit_edit_form($page, $postdata, $digest = FALSE, $b_template
return $body;
}

require_once(GUIEDIT_CONF_PATH . 'guiedit.ini.php');
// require_once(GUIEDIT_CONF_PATH . 'guiedit.ini.php');

// フォームの値の設定
$s_digest = Utility::htmlsc($digest);
Expand Down
3 changes: 2 additions & 1 deletion wiki-common/plugin/rename.inc.php
Expand Up @@ -98,7 +98,7 @@ function plugin_rename_action()
} else if (is_cantedit($refer)) {
return plugin_rename_phase1('norename', $refer);

} else if (!empty($page) && $page === $refer) {
} else if (empty($page) && is_page($refer)) {
return plugin_rename_phase2();

} else if (! is_pagename($page)) {
Expand Down Expand Up @@ -161,6 +161,7 @@ function plugin_rename_phase1($err = '', $page = '')
return array(
'msg' => $_rename_messages['msg_title'],
'body' => <<<EOD
{$msg}
<fieldset>
<legend>{$_rename_messages['msg_title']}</legend>
<form action="$script" method="post" class="plugin-rename-form">
Expand Down

0 comments on commit b719359

Please sign in to comment.