Index: trunk/phpwiki/newcodebase/SpecialUserlogin.php |
— | — | @@ -17,49 +17,45 @@ |
18 | 18 | |
19 | 19 | /* private */ function addNewAccount() |
20 | 20 | { |
21 | | - global $wgUser, $wpPassword2, $wpRetype, $wpName2, $wpRemember2; |
| 21 | + global $wgUser, $wpPassword, $wpRetype, $wpName, $wpRemember; |
22 | 22 | global $wpEmail, $wgDeferredUpdateList; |
23 | 23 | |
24 | | - if ( 0 != strcmp( $wpPassword2, $wpRetype ) ) { |
| 24 | + if ( 0 != strcmp( $wpPassword, $wpRetype ) ) { |
25 | 25 | mainLoginForm( wfMsg( "badretype" ) ); |
26 | 26 | return; |
27 | 27 | } |
28 | | - if ( "" == $wpName2 ) { |
| 28 | + if ( "" == $wpName ) { |
29 | 29 | mainLoginForm( wfMsg( "noname" ) ); |
30 | 30 | return; |
31 | 31 | } |
32 | | - $u = User::newFromName( $wpName2 ); |
| 32 | + $u = User::newFromName( $wpName ); |
33 | 33 | |
34 | 34 | if ( 0 != $u->idForName() ) { |
35 | 35 | mainLoginForm( wfMsg( "userexists" ) ); |
36 | 36 | return; |
37 | 37 | } |
38 | 38 | $u->addToDatabase(); |
39 | | - |
40 | | - $u->setPassword( $wpPassword2 ); |
41 | | - if ( 1 == $wpRemember2 ) { |
42 | | - $u->setOption( "rememberPassword", 1 ); |
43 | | - } |
| 39 | + $u->setPassword( $wpPassword ); |
44 | 40 | $u->setEmail( $wpEmail ); |
| 41 | + if ( 1 == $wpRemember ) { $r = 1; } |
| 42 | + else { $r = 0; } |
| 43 | + $u->setOption( "rememberPassword", $r ); |
45 | 44 | |
46 | 45 | $wgUser = $u; |
47 | | - $wgUser->setCookies(); |
48 | | - $up = new UserUpdate(); |
49 | | - array_push( $wgDeferredUpdateList, $up ); |
50 | | - |
51 | 46 | $m = str_replace( "$1", $wgUser->getName(), wfMsg( "welcomecreation" ) ); |
52 | 47 | successfulLogin( $m ); |
53 | 48 | } |
54 | 49 | |
55 | 50 | /* private */ function processLogin() |
56 | 51 | { |
57 | | - global $wgUser, $wpName1, $wpPassword1, $wpRemember1; |
| 52 | + global $wgUser, $wpName, $wpPassword, $wpRemember; |
| 53 | + global $returnto; |
58 | 54 | |
59 | | - if ( "" == $wpName1 ) { |
| 55 | + if ( "" == $wpName ) { |
60 | 56 | mainLoginForm( wfMsg( "noname" ) ); |
61 | 57 | return; |
62 | 58 | } |
63 | | - $u = User::newFromName( $wpName1 ); |
| 59 | + $u = User::newFromName( $wpName ); |
64 | 60 | $id = $u->idForName(); |
65 | 61 | if ( 0 == $id ) { |
66 | 62 | $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) ); |
— | — | @@ -68,30 +64,30 @@ |
69 | 65 | } |
70 | 66 | $u->setId( $id ); |
71 | 67 | $u->loadFromDatabase(); |
72 | | - if ( 0 != strcmp( $u->getPassword(), $wpPassword1 ) ) { |
| 68 | + if ( 0 != strcmp( $u->getPassword(), $wpPassword ) ) { |
73 | 69 | mainLoginForm( wfMsg( "wrongpassword" ) ); |
74 | 70 | return; |
75 | 71 | } |
76 | 72 | # We've verified now, update the real record |
77 | 73 | # |
| 74 | + if ( 1 == $wpRemember ) { $r = 1; } |
| 75 | + else { $r = 0; } |
| 76 | + $u->setOption( "rememberPassword", $r ); |
| 77 | + |
78 | 78 | $wgUser = $u; |
79 | | - if ( 1 == $wpRemember1 ) { |
80 | | - $wgUser->setOption( "rememberPassword", 1 ); |
81 | | - } |
82 | | - $wgUser->setCookies(); |
83 | 79 | $m = str_replace( "$1", $wgUser->getName(), wfMsg( "loginsuccess" ) ); |
84 | 80 | successfulLogin( $m ); |
85 | 81 | } |
86 | 82 | |
87 | 83 | /* private */ function mailPassword() |
88 | 84 | { |
89 | | - global $wpName1; |
| 85 | + global $wpName; |
90 | 86 | |
91 | | - if ( "" == $wpName1 ) { |
| 87 | + if ( "" == $wpName ) { |
92 | 88 | mainLoginForm( wfMsg( "noname" ) ); |
93 | 89 | return; |
94 | 90 | } |
95 | | - $u = User::newFromName( $wpName1 ); |
| 91 | + $u = User::newFromName( $wpName ); |
96 | 92 | $id = $u->idForName(); |
97 | 93 | if ( 0 == $id ) { |
98 | 94 | $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) ); |
— | — | @@ -116,21 +112,31 @@ |
117 | 113 | |
118 | 114 | /* private */ function successfulLogin( $msg ) |
119 | 115 | { |
120 | | - global $wgOut; |
| 116 | + global $wgUser, $wgOut, $returnto; |
| 117 | + global $wgDeferredUpdateList; |
121 | 118 | |
| 119 | + $wgUser->setCookies(); |
| 120 | + $up = new UserUpdate(); |
| 121 | + array_push( $wgDeferredUpdateList, $up ); |
| 122 | + |
122 | 123 | $wgOut->setPageTitle( wfMsg( "loginsuccesstitle" ) ); |
123 | 124 | $wgOut->setRobotpolicy( "noindex,nofollow" ); |
124 | 125 | $wgOut->addHTML( $msg . "\n<p>" ); |
125 | | - $wgOut->addWikiText( wfMsg( "returntomain" ) ); |
| 126 | + |
| 127 | + if ( "" == $returnto ) { |
| 128 | + $r = wfMsg( "returntomain" ); |
| 129 | + } else { |
| 130 | + $r = str_replace( "$1", $returnto, wfMsg( "returnto" ) ); |
| 131 | + $wgOut->addMeta( "http:Refresh", "5;url=" . wfLocalLink( $returnto ) ); |
| 132 | + } |
| 133 | + $wgOut->addWikiText( $r ); |
126 | 134 | } |
127 | 135 | |
128 | 136 | /* private */ function mainLoginForm( $err ) |
129 | 137 | { |
130 | | - global $wgUser, $wgOut; |
131 | | - global $wpName1, $wpPassword1, $wpRemember1; |
132 | | - global $wpName2, $wpPassword2, $wpRetype, $wpRemember2; |
133 | | - global $wpEmail; |
134 | | - global $HTTP_COOKIE_VARS; |
| 138 | + global $wgUser, $wgOut, $returnto; |
| 139 | + global $wpName, $wpPassword, $wpRetype, $wpRemember; |
| 140 | + global $wpEmail, $HTTP_COOKIE_VARS; |
135 | 141 | |
136 | 142 | $le = wfMsg( "loginerror" ); |
137 | 143 | $yn = wfMsg( "yourname" ); |
— | — | @@ -145,7 +151,7 @@ |
146 | 152 | $efl = wfMsg( "emailforlost" ); |
147 | 153 | $mmp = wfMsg( "mailmypassword" ); |
148 | 154 | |
149 | | - $name = $wpName1; |
| 155 | + $name = $wpName; |
150 | 156 | if ( "" == $name ) { |
151 | 157 | if ( 0 != $wgUser->getID() ) { |
152 | 158 | $name = $wgUser->getName(); |
— | — | @@ -153,7 +159,7 @@ |
154 | 160 | $name = $HTTP_COOKIE_VARS["wcUserName"]; |
155 | 161 | } |
156 | 162 | } |
157 | | - $pwd = $wpPassword1; |
| 163 | + $pwd = $wpPassword; |
158 | 164 | if ( "" == $pwd ) { |
159 | 165 | if ( 0 != $wgUser->getID() ) { |
160 | 166 | $pwd = $wgUser->getPassword(); |
— | — | @@ -163,10 +169,11 @@ |
164 | 170 | } |
165 | 171 | $wgOut->setPageTitle( wfMsg( "userlogin" ) ); |
166 | 172 | $wgOut->setRobotpolicy( "noindex,nofollow" ); |
| 173 | + |
167 | 174 | if ( "" == $err ) { |
168 | | - $wgOut->addHTML( "<h2>$li</h2>\n" ); |
| 175 | + $wgOut->addHTML( "<h2>$li:</h2>\n" ); |
169 | 176 | } else { |
170 | | - $wgOut->addHTML( "<h2>$le</h2>\n<font size='+1' color='red'>$err</font>\n<p>" ); |
| 177 | + $wgOut->addHTML( "<h2>$le:</h2>\n<font size='+1' color='red'>$err</font>\n" ); |
171 | 178 | } |
172 | 179 | if ( 1 == $wgUser->getOption( "rememberPassword" ) ) { |
173 | 180 | $checked = " checked"; |
— | — | @@ -174,29 +181,44 @@ |
175 | 182 | $checked = ""; |
176 | 183 | } |
177 | 184 | $action = wfLocalLink( "Special:Userlogin" ); |
| 185 | + if ( "" != $returnto ) { $action .= "&returnto=$returnto"; } |
178 | 186 | |
179 | 187 | $wgOut->addHTML( " |
180 | | -<form action='$action' method=post><tt> |
181 | | -$yn<input tabindex=1 type=text name='wpName1' value='$name' size=20><br> |
182 | | -$yp<input tabindex=2 type=password name='wpPassword1' value='$pwd' size=20><br> |
183 | | -<input tabindex=4 type=checkbox name='wpRemember1' value='1'$checked>$rmp<br> |
184 | | -<input tabindex=5 type=submit name='wpLoginattempt' value='$li'> |
185 | | -<input tabindex=6 type=submit name='wpMailmypassword' value='$mmp'> |
186 | | -</tt></form>\n" ); |
187 | | - |
188 | | - if ( isset( $wpRemember2 ) ) { $checked = " checked"; } |
189 | | - else { $checked = ""; } |
190 | | - |
191 | | - $wgOut->addHTML( "<hr> |
192 | | -<h2>$ca</h2><p>$ayn<br> |
193 | | -<form action='$action' method=post><tt> |
194 | | -$yn<input tabindex=6 type=text name='wpName2' value='$wpName2' size=20><br> |
195 | | -$yp<input tabindex=7 type=password name='wpPassword2' value='$wpPassword2' size=20><br> |
196 | | -$ypa<input tabindex=8 type=password name='wpRetype' value='$wpRetype' size=20>$nuo<br> |
197 | | -$ye<input tabindex=9 type=text name='wpEmail' value='$wpEmail' size=20>$efl<br> |
198 | | -<input tabindex=10 type=checkbox name='wpRemember2' value='1'$checked>$rmp<br> |
199 | | -<input tabindex=11 type=submit name='wpCreateaccount' value='$ca'> |
200 | | -</tt></form>\n" ); |
| 188 | +<form method=post action='$action'> |
| 189 | +<table border=0><tr> |
| 190 | +<td align=right>$yn:</td> |
| 191 | +<td colspan=2 align=left> |
| 192 | +<input tabindex=1 type=text name='wpName' value='$name' size=20> |
| 193 | +</td></tr><tr> |
| 194 | +<td align=right>$yp:</td> |
| 195 | +<td align=left> |
| 196 | +<input tabindex=2 type=password name='wpPassword' value='$pwd' size=20> |
| 197 | +</td> |
| 198 | +<td align=left> |
| 199 | +<input tabindex=3 type=submit name='wpLoginattempt' value='$li'> |
| 200 | +</td></tr> |
| 201 | +<tr><td colspan=3> </td></tr><tr> |
| 202 | +<td align=right>$ypa:</td> |
| 203 | +<td align=left> |
| 204 | +<input tabindex=4 type=password name='wpRetype' value='$wpRetype' size=20> |
| 205 | +</td><td>$nuo</td></tr> |
| 206 | +<tr> |
| 207 | +<td align=right>$ye:</td> |
| 208 | +<td align=left> |
| 209 | +<input tabindex=5 type=text name='wpEmail' value='$wpEmail' size=20> |
| 210 | +</td><td align=left> |
| 211 | +<input tabindex=6 type=submit name='wpCreateaccount' value='$ca'> |
| 212 | +</td></tr> |
| 213 | +<tr> |
| 214 | +<td colspan=3 align=left> |
| 215 | +<input tabindex=7 type=checkbox name='wpRemember' value='1'$checked>$rmp |
| 216 | +</td></tr> |
| 217 | +<tr><td colspan=3> </td></tr><tr> |
| 218 | +<td colspan=3 align=left> |
| 219 | +<p>$efl<br> |
| 220 | +<input tabindex=8 type=submit name='wpMailmypassword' value='$mmp'> |
| 221 | +</td></tr></table> |
| 222 | +</form>\n" ); |
201 | 223 | } |
202 | 224 | |
203 | 225 | ?> |
Index: trunk/phpwiki/newcodebase/Title.php |
— | — | @@ -90,17 +90,23 @@ |
91 | 91 | |
92 | 92 | function getPrefixedDBkey() |
93 | 93 | { |
94 | | - return $this->prefixes( false ) . $this->mDbkeyform; |
| 94 | + $s = $this->prefix( $this->mDbkeyform ); |
| 95 | + $s = str_replace( " ", "_", $s ); |
| 96 | + return $s; |
95 | 97 | } |
96 | 98 | |
97 | 99 | function getPrefixedText() |
98 | 100 | { |
99 | | - return $this->prefixes( true ) . $this->mTextform; |
| 101 | + $s = $this->prefix( $this->mTextform ); |
| 102 | + $s = str_replace( "_", " ", $s ); |
| 103 | + return $s; |
100 | 104 | } |
101 | 105 | |
102 | 106 | function getPrefixedURL() |
103 | 107 | { |
104 | | - return $this->prefixes( false ) . $this->mUrlform; |
| 108 | + $s = $this->prefix( $this->mDbkeyform ); |
| 109 | + $s = str_replace( " ", "_", $s ); |
| 110 | + return urlencode( $s ); |
105 | 111 | } |
106 | 112 | |
107 | 113 | function getFullURL() |
— | — | @@ -112,7 +118,7 @@ |
113 | 119 | } else { |
114 | 120 | $p = $wgValidInterwikis[$this->mInterwiki]; |
115 | 121 | } |
116 | | - if ( "" != $this->mNamespace ) { $n = $this->mNamespace . ":"; } |
| 122 | + if ( "" != $this->mNamespace ) { $n = $this->mNamespace . "%3a"; } |
117 | 123 | return str_replace( "$1", $n . $this->mUrlform, $p ); |
118 | 124 | } |
119 | 125 | |
— | — | @@ -154,7 +160,7 @@ |
155 | 161 | wfDebug( "Title: 2: $sql\n" ); |
156 | 162 | |
157 | 163 | $res = mysql_query( $sql, $conn ); |
158 | | - if ( ! $res || 0 == mysql_num_rows( $res ) ) { |
| 164 | + if ( ( false === $res ) || 0 == mysql_num_rows( $res ) ) { |
159 | 165 | return $this->mOtherNamespaces; |
160 | 166 | } |
161 | 167 | |
— | — | @@ -197,7 +203,7 @@ |
198 | 204 | # wfDebug( "Title: 1: $sql\n" ); |
199 | 205 | $res = mysql_query( $sql, $conn ); |
200 | 206 | |
201 | | - if ( ! $res || 0 == mysql_num_rows( $res ) ) { |
| 207 | + if ( ( false === $res ) || 0 == mysql_num_rows( $res ) ) { |
202 | 208 | $this->mArticleID = 0; |
203 | 209 | } else { |
204 | 210 | $s = mysql_fetch_object( $res ); |
— | — | @@ -209,19 +215,16 @@ |
210 | 216 | return $this->mArticleID; |
211 | 217 | } |
212 | 218 | |
213 | | - /* private */ function prefixes( $textform ) |
| 219 | + /* private */ function prefix( $name ) |
214 | 220 | { |
| 221 | + $p = ""; |
215 | 222 | if ( "" != $this->mInterwiki ) { |
216 | 223 | $p = $this->mInterwiki . ":"; |
217 | 224 | } |
218 | 225 | if ( "" != $this->mNamespace ) { |
219 | | - if ( $textform ) { |
220 | | - $p .= str_replace( "_", " ", $this->mNamespace ) . ":"; |
221 | | - } else { |
222 | 226 | $p .= $this->mNamespace . ":"; |
223 | | - } |
224 | 227 | } |
225 | | - return $p; |
| 228 | + return $p . $name; |
226 | 229 | } |
227 | 230 | |
228 | 231 | # Assumes that mDbkeyform has been set, and is urldecoded |
— | — | @@ -240,7 +243,7 @@ |
241 | 244 | $done = false; |
242 | 245 | $t = trim( $this->mDbkeyform ); |
243 | 246 | if ( ":" == $t{0} ) { |
244 | | - $r = substr( $t, 2 ); |
| 247 | + $r = substr( $t, 1 ); |
245 | 248 | } else { |
246 | 249 | if ( preg_match( "/^([A-Za-z][A-Za-z0-9 _]*):(.*)$/", $t, $m ) ) { |
247 | 250 | $p = strtolower( $m[1] ); |
Index: trunk/phpwiki/newcodebase/Article.php |
— | — | @@ -5,14 +5,16 @@ |
6 | 6 | /* private */ var $mTitle; # WikiTitle object |
7 | 7 | /* private */ var $mContent, $mContentLoaded; |
8 | 8 | /* private */ var $mUser, $mTimestamp, $mParams; |
9 | | - /* private */ var $mCounter; |
| 9 | + /* private */ var $mCounter, $mComment, $mOldversion; |
| 10 | + /* private */ var $mMinorEdit; |
10 | 11 | |
11 | 12 | function Article( $t ) |
12 | 13 | { |
13 | 14 | $this->mTitle = $t; |
14 | 15 | $this->mContentLoaded = false; |
15 | 16 | $this->mUser = $this->mCounter = -1; # Not loaded |
16 | | - $this->mTimestamp = ""; |
| 17 | + $this->mTimestamp = $this->mComment = ""; |
| 18 | + $this->mOldversion = 0; |
17 | 19 | } |
18 | 20 | |
19 | 21 | function getContent() |
— | — | @@ -36,19 +38,19 @@ |
37 | 39 | $sql = "SELECT cur_text,cur_timestamp,cur_user,cur_counter, " . |
38 | 40 | "cur_params FROM cur WHERE cur_id=$id"; |
39 | 41 | wfDebug( "Art: 1: $sql\n" ); |
40 | | - $result = mysql_query( $sql, $conn ); |
| 42 | + $res = mysql_query( $sql, $conn ); |
41 | 43 | |
42 | | - if ( ! $result || 0 == mysql_num_rows( $result ) ) { |
| 44 | + if ( ( false === $res ) || ( 0 == mysql_num_rows( $res ) ) ) { |
43 | 45 | $this->mContent = "Fatal database error.\n"; |
44 | 46 | } else { |
45 | | - $s = mysql_fetch_object( $result ); |
| 47 | + $s = mysql_fetch_object( $res ); |
46 | 48 | $this->mContent = $s->cur_text; |
47 | 49 | $this->mUser = $s->cur_user; |
48 | 50 | $this->mCounter = $s->cur_counter; |
49 | 51 | $this->mParams = $s->cur_params; |
50 | 52 | $this->mTimestamp = $s->cur_timestamp; |
51 | 53 | } |
52 | | - mysql_free_result( $result ); |
| 54 | + mysql_free_result( $res ); |
53 | 55 | $this->mContentLoaded = true; |
54 | 56 | } |
55 | 57 | |
— | — | @@ -68,15 +70,19 @@ |
69 | 71 | if ( -1 != $this->mUser ) return; |
70 | 72 | |
71 | 73 | $conn = wfGetDB(); |
72 | | - $sql = "SELECT cur_user,cur_timestamp FROM cur WHERE " . |
| 74 | + $sql = "SELECT cur_user,cur_timestamp,cur_old_version," . |
| 75 | + "cur_comment,cur_minor_edit FROM cur WHERE " . |
73 | 76 | "cur_id=" . $this->getID(); |
74 | 77 | wfDebug( "Art: 3: $sql\n" ); |
75 | 78 | |
76 | 79 | $res = mysql_query( $sql, $conn ); |
77 | | - if ( "" != $res ) { |
| 80 | + if ( ! ( false === $res ) ) { |
78 | 81 | $s = mysql_fetch_object( $res ); |
79 | 82 | $this->mUser = $s->cur_user; |
80 | | - $this->mTimestamp = $s->mTimestamp; |
| 83 | + $this->mTimestamp = $s->cur_timestamp; |
| 84 | + $this->mComment = $s->cur_comment; |
| 85 | + $this->mOldversion = $s->cur_old_version; |
| 86 | + $this->mMinorEdit = $s->cur_minor_edit; |
81 | 87 | } |
82 | 88 | } |
83 | 89 | |
— | — | @@ -227,10 +233,12 @@ |
228 | 234 | |
229 | 235 | $conn = wfGetDB(); |
230 | 236 | $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," . |
231 | | - "cur_comment,cur_user,cur_timestamp,cur_minor_edit) VALUES ('" . |
232 | | - $wgTitle->getNamespace() . "', '" . $wgTitle->getDBKey() . "', '" . |
| 237 | + "cur_comment,cur_user,cur_timestamp,cur_minor_edit," . |
| 238 | + "cur_old_version,cur_counter) VALUES ('" . |
| 239 | + $this->mTitle->getNamespace() . "', '" . |
| 240 | + $this->mTitle->getDBKey() . "', '" . |
233 | 241 | wfStrencode( $text ) . "', '" . wfStrencode( $summary ) . "', '" . |
234 | | - $wgUser->getID() . "', '" . date( "YmdHis" ) . "', 0)"; |
| 242 | + $wgUser->getID() . "', '" . date( "YmdHis" ) . "', 0, 0, 0)"; |
235 | 243 | |
236 | 244 | wfDebug( "Art: 2: $sql\n" ); |
237 | 245 | $res = mysql_query( $sql, $conn ); |
— | — | @@ -246,18 +254,44 @@ |
247 | 255 | { |
248 | 256 | global $wgOut, $wgUser, $wgTitle; |
249 | 257 | |
250 | | - if ( $minor) { $me = 1; } else { $me = 0; } |
| 258 | + if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; } |
| 259 | + if ( $minor ) { $me2 = 1; } else { $me2 = 0; } |
251 | 260 | |
252 | | - # TODO: Backup to old table |
253 | | - # |
| 261 | + $this->loadLastEdit(); |
254 | 262 | $conn = wfGetDB(); |
| 263 | + $sql = "INSERT INTO old (old_namespace,old_title,old_text," . |
| 264 | + "old_comment,old_user,old_old_version,old_timestamp," . |
| 265 | + "old_minor_edit) VALUES ('" . |
| 266 | + $this->mTitle->getNamespace() . "', '" . |
| 267 | + $this->mTitle->getDBKey() . "', '" . |
| 268 | + wfStrencode( $this->getContent() ) . "', '" . |
| 269 | + wfStrencode( $this->mComment ) . "', " . |
| 270 | + $this->mUser . ", " . $this->mOldversion . ", '" . |
| 271 | + $this->mTimestamp . "', " . $me1 . ")"; |
| 272 | + |
| 273 | + wfDebug( "Art: 4: $sql\n" ); |
| 274 | + $res = mysql_query( $sql, $conn ); |
| 275 | + if ( false === $res ) { |
| 276 | + $wgOut->databaseError( wfMsg( "updatingarticle" ) ); |
| 277 | + return; |
| 278 | + } |
| 279 | + $cond = "(old_namespace='" . $this->mTitle->getNamespace() . |
| 280 | + "' AND old_title='" . $this->mTitle->getDBKey() . |
| 281 | + "' AND old_old_version={$this->mOldversion})"; |
| 282 | + $newid = wfGetSQL( "old", "old_id", $cond ); |
| 283 | + if ( 0 == $newid ) { |
| 284 | + $wgOut->databaseError( wfMsg( "updatingarticle" ) ); |
| 285 | + return; |
| 286 | + } |
| 287 | + $conn = wfGetDB(); |
255 | 288 | $sql = "UPDATE cur SET cur_text='" . wfStrencode( $text ) . |
256 | 289 | "',cur_comment='" . wfStrencode( $summary ) . |
257 | | - "',cur_minor_edit=$me, cur_user=" . $wgUser->getID() . |
258 | | - ", cur_timestamp='" . date( "YmdHis" ) . "' " . |
| 290 | + "',cur_minor_edit={$me2}, cur_user=" . $wgUser->getID() . |
| 291 | + ", cur_timestamp='" . date( "YmdHis" ) . |
| 292 | + "',cur_old_version=$newid " . |
259 | 293 | "WHERE cur_id=" . $this->getID(); |
260 | 294 | |
261 | | - wfDebug( "Art: 4: $sql\n" ); |
| 295 | + wfDebug( "Art: 5: $sql\n" ); |
262 | 296 | $res = mysql_query( $sql, $conn ); |
263 | 297 | $this->editUpdates(); |
264 | 298 | |
Index: trunk/phpwiki/newcodebase/GlobalFunctions.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | # |
18 | 18 | $wgFormTextFields = array( |
19 | 19 | # Login form |
20 | | - "wpName1", "wpPassword1", "wpName2", "wpPassword2", |
| 20 | + "wpName", "wpPassword", "wpName", "wpPassword", |
21 | 21 | "wpRetype", "wpEmail", |
22 | 22 | # Edit form |
23 | 23 | "wpTextbox1", "wpSummary", "wpTextbox2" |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | wfDebug( "Glob: 1: $sql\n" ); |
128 | 128 | |
129 | 129 | $res = mysql_query( $sql, $conn ); |
130 | | - if ( ! $res || 0 == mysql_num_rows( $res) ) { return; } |
| 130 | + if ( ( false === $res ) || ( 0 == mysql_num_rows( $res) ) ) { return; } |
131 | 131 | else { |
132 | 132 | $s = mysql_fetch_object( $res ); |
133 | 133 | $wgTotalViews = $s->ss_total_views; |
Index: trunk/phpwiki/newcodebase/DatabaseFunctions.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | { |
21 | 21 | $conn = wfGetDB(); |
22 | 22 | $sql = "UPDATE $table SET $var = '" . |
23 | | - wfStrencode( $value ) . "' WHERE $cond"; |
| 23 | + wfStrencode( $value ) . "' WHERE ($cond)"; |
24 | 24 | |
25 | 25 | wfDebug( "DB: 1: $sql\n" ); |
26 | 26 | $result = mysql_query( $sql, $conn ); |
— | — | @@ -28,12 +28,12 @@ |
29 | 29 | function wfGetSQL( $table, $var, $cond ) |
30 | 30 | { |
31 | 31 | $conn = wfGetDB(); |
32 | | - $sql = "SELECT $var FROM $table WHERE $cond"; |
| 32 | + $sql = "SELECT $var FROM $table WHERE ($cond)"; |
33 | 33 | |
34 | 34 | wfDebug( "DB: 2: $sql\n" ); |
35 | 35 | $result = mysql_query( $sql, $conn ); |
36 | 36 | $ret = ""; |
37 | | - if ( "" != $result ) { |
| 37 | + if ( ! ( false === $result ) ) { |
38 | 38 | if ( $s = mysql_fetch_object( $result ) ) { |
39 | 39 | $ret = $s->$var; |
40 | 40 | } |
Index: trunk/phpwiki/newcodebase/Skin.php |
— | — | @@ -162,9 +162,9 @@ |
163 | 163 | if ( $wgOut->isArticle() ) { |
164 | 164 | $s .= "<p class=\"subtitle\">" |
165 | 165 | . $this->makeLink( wfMsg( "mainpage" ), |
166 | | - WfMsg( "printableversion" ), "print" ) |
| 166 | + WfMsg( "printableversion" ), "action=print" ) |
167 | 167 | . " | " . $this->makeLink( "Special:Whatlinkshere", |
168 | | - wfMsg( "whatlinkshere" ), "", $wgTitle->getPrefixedURL() ); |
| 168 | + wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() ); |
169 | 169 | |
170 | 170 | $s .= $this->otherLanguages(); |
171 | 171 | } |
— | — | @@ -174,15 +174,18 @@ |
175 | 175 | |
176 | 176 | function nameAndLogin() |
177 | 177 | { |
178 | | - global $wgUser; |
| 178 | + global $wgUser, $wgTitle; |
179 | 179 | |
180 | | - $n = $wgUser->getName(); |
181 | 180 | if ( 0 == $wgUser->getID() ) { |
182 | | - $s .= $n . "\n<br>" . $this->specialLink( "userlogin" ); |
| 181 | + $n = getenv( "REMOTE_ADDR" ); |
| 182 | + $s .= $n . "\n<br>" . $this->makeLink( "Special:Userlogin", |
| 183 | + wfMsg( "login" ), "returnto=" . $wgTitle->getPrefixedURL() ); |
183 | 184 | } else { |
184 | | - $s .= $this->makeLink( "User:$n", $n ) . "<br>" |
185 | | - . $this->specialLink( "userlogout" ) . " | " |
186 | | - . $this->specialLink( "preferences" ); |
| 185 | + $n = $wgUser->getName(); |
| 186 | + $s .= $this->makeLink( "User:$n", $n ) . "<br>" . |
| 187 | + $this->makeLink( "Special:Userlogout", wfMsg( "logout" ), |
| 188 | + "returnto=" . $wgTitle->getPrefixedURL() ) . " | " . |
| 189 | + $this->specialLink( "preferences" ); |
187 | 190 | } |
188 | 191 | $s .= " | " . $this->makeLink( "Wikipedia:Help", wfMsg( "help" ) ); |
189 | 192 | |
— | — | @@ -289,7 +292,7 @@ |
290 | 293 | $s = "(Special page)"; |
291 | 294 | } else if ( $wgTitle->userCanEdit() ) { |
292 | 295 | $s = $this->makeLink( $wgTitle->getPrefixedText(), |
293 | | - wfMsg( "editthispage" ), "edit" ); |
| 296 | + wfMsg( "editthispage" ), "action=edit" ); |
294 | 297 | } else { |
295 | 298 | $s = "Protected page"; |
296 | 299 | } |
— | — | @@ -301,7 +304,7 @@ |
302 | 305 | global $wgTitle; |
303 | 306 | |
304 | 307 | $s = $this->makeLink( $wgTitle->getPrefixedText(), |
305 | | - wfMsg( "history" ), "history" ); |
| 308 | + wfMsg( "history" ), "action=history" ); |
306 | 309 | return $s; |
307 | 310 | } |
308 | 311 | |
— | — | @@ -313,7 +316,7 @@ |
314 | 317 | $s = "(Special page)"; |
315 | 318 | } else { |
316 | 319 | $s = $this->makeLink( "Special:Recentchangeslinked", |
317 | | - wfMsg( "recentchangeslinked" ), "", $wgTitle->getPrefixedURL() ); |
| 320 | + wfMsg( "recentchangeslinked" ), "target=" . $wgTitle->getPrefixedURL() ); |
318 | 321 | } |
319 | 322 | return $s; |
320 | 323 | } |
— | — | @@ -412,39 +415,43 @@ |
413 | 416 | return $text; |
414 | 417 | } |
415 | 418 | |
416 | | - function makeInternalLink( $title, $text= "", $action = "", $target = "" ) |
| 419 | + function makeInternalLink( $title, $text= "", $action = "", $target = "", |
| 420 | + $trail = "" ) |
417 | 421 | { |
418 | 422 | $nt = Title::newFromText( $title ); |
419 | 423 | if ( "Special" == $nt->getNamespace() ) { |
420 | 424 | return $this->makeLink( $title, $text ); |
421 | 425 | } |
422 | 426 | if ( 0 == $nt->getArticleID() ) { |
423 | | - return $this->makeBrokenLink( $title, $text ); |
| 427 | + return $this->makeBrokenLink( $title, $text ) . $trail; |
424 | 428 | } else { |
425 | | - return $this->makeLink( $title, $text, $action, $target ); |
| 429 | + return $this->makeLink( $title, $text, $query, $trail ); |
426 | 430 | } |
427 | 431 | } |
428 | 432 | |
429 | | - function makeLink( $title, $text = "", $action = "", $target = "" ) |
| 433 | + function makeLink( $title, $text = "", $query = "", $trail = "" ) |
430 | 434 | { |
431 | 435 | global $wgServer, $wgScript, $wgArticlePath, $wgTitle; |
432 | 436 | |
433 | 437 | $nt = Title::newFromText( $title ); |
434 | 438 | $link = $nt->getPrefixedURL(); |
435 | 439 | |
436 | | - if ( "" == $action && "" == $target ) { |
| 440 | + if ( "" == $query ) { |
437 | 441 | $u = str_replace( "$1", $link, $wgArticlePath ); |
438 | | - } else if ( "" != $action ) { |
439 | | - $u = "$wgServer$wgScript?title=$link&action=$action"; |
440 | | - } else if ( "" != $target ) { |
441 | | - $tt = Title::newFromURL( $target ); |
442 | | - $t = $tt->getPrefixedURL(); |
443 | | - $u = "$wgServer$wgScript?title=$link&target=$t"; |
| 442 | + } else { |
| 443 | + $u = "$wgServer$wgScript?title=$link&$query"; |
444 | 444 | } |
445 | 445 | if ( "" == $text ) { $text = $nt->getPrefixedText(); } |
446 | 446 | $style = $this->getInternalLinkAttributes( $link, $text ); |
447 | 447 | |
448 | | - $r = "<a href=\"$u\"$style>$text</a>"; |
| 448 | + $inside = ""; |
| 449 | + if ( "" != $trail ) { |
| 450 | + if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) { |
| 451 | + $inside = $m[1]; |
| 452 | + $trail = $m[2]; |
| 453 | + } |
| 454 | + } |
| 455 | + $r = "<a href=\"$u\"$style>$text$inside</a>$trail"; |
449 | 456 | return $r; |
450 | 457 | } |
451 | 458 | |
Index: trunk/phpwiki/newcodebase/SpecialUserlogout.php |
— | — | @@ -2,11 +2,20 @@ |
3 | 3 | |
4 | 4 | function wfSpecialUserlogout() |
5 | 5 | { |
6 | | - global $wgUser, $wgOut; |
| 6 | + global $wgUser, $wgOut, $returnto; |
7 | 7 | |
8 | 8 | $wgUser->logout(); |
9 | 9 | $wgOut->setPageTitle( wfMsg( "userlogout" ) ); |
10 | | - $wgOut->addHTML( wfMsg( "logouttext" ) ); |
| 10 | + $wgOut->setRobotpolicy( "noindex,nofollow" ); |
| 11 | + $wgOut->addHTML( wfMsg( "logouttext" ) . "\n<p>" ); |
| 12 | + |
| 13 | + if ( "" == $returnto ) { |
| 14 | + $r = wfMsg( "returntomain" ); |
| 15 | + } else { |
| 16 | + $r = str_replace( "$1", $returnto, wfMsg( "returnto" ) ); |
| 17 | + $wgOut->addMeta( "http:Refresh", "5;url=" . wfLocalLink( $returnto ) ); |
| 18 | + } |
| 19 | + $wgOut->addWikiText( $r ); |
11 | 20 | } |
12 | 21 | |
13 | 22 | ?> |
Index: trunk/phpwiki/newcodebase/sql/buildtables.sql |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | |
47 | 47 | CREATE TABLE old ( |
48 | 48 | old_id mediumint(8) unsigned NOT NULL auto_increment, |
| 49 | + old_namespace varchar(20) binary NOT NULL default '', |
49 | 50 | old_title varchar(255) binary NOT NULL default '', |
50 | 51 | old_text mediumtext, |
51 | 52 | old_comment tinyblob, |
Index: trunk/phpwiki/newcodebase/User.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | wfDebug( "User: 5: $sql\n" ); |
72 | 72 | |
73 | 73 | $res = mysql_query( $sql, $conn ); |
74 | | - if ( ( ! $res ) || ( 0 == mysql_num_rows( $res ) ) ) { |
| 74 | + if ( ( false === $res ) || ( 0 == mysql_num_rows( $res ) ) ) { |
75 | 75 | if ( 0 == $this->mId ) { |
76 | 76 | $this->mBlockedby = 0; |
77 | 77 | return; |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | wfDebug( "User: 6: $sql\n" ); |
83 | 83 | |
84 | 84 | $res = mysql_query( $sql, $conn ); |
85 | | - if ( ( ! $res ) || ( 0 == mysql_num_rows( $res ) ) ) { |
| 85 | + if ( ( false === $res ) || ( 0 == mysql_num_rows( $res ) ) ) { |
86 | 86 | $this->mBlockedby = 0; |
87 | 87 | return; |
88 | 88 | } |
— | — | @@ -164,10 +164,10 @@ |
165 | 165 | "user_rights FROM user WHERE user_id=" . $this->mId; |
166 | 166 | |
167 | 167 | wfDebug( "User: 1: $sql\n" ); |
168 | | - $result = mysql_query( $sql, $conn ); |
| 168 | + $res = mysql_query( $sql, $conn ); |
169 | 169 | |
170 | | - if ( $result ) { |
171 | | - $s = mysql_fetch_object( $result ); |
| 170 | + if ( ! ( false === $res ) ) { |
| 171 | + $s = mysql_fetch_object( $res ); |
172 | 172 | $this->mName = $s->user_name; |
173 | 173 | $this->mEmail = $s->user_email; |
174 | 174 | |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | $this->decodeOptions( $s->user_options ); |
177 | 177 | $this->mRights = explode( ",", strtolower( $s->user_rights ) ); |
178 | 178 | } |
179 | | - mysql_free_result( $result ); |
| 179 | + mysql_free_result( $res ); |
180 | 180 | $this->mDataLoaded = true; |
181 | 181 | } |
182 | 182 | |
— | — | @@ -326,14 +326,14 @@ |
327 | 327 | $exp = time() + $wgCookieExpiration; |
328 | 328 | |
329 | 329 | $wsUserID = $this->mId; |
330 | | - setcookie( "wcUserID", $this->mId, $exp ); |
| 330 | + setcookie( "wcUserID", $this->mId, $exp, "/" ); |
331 | 331 | |
332 | 332 | $wsUserName = $this->mName; |
333 | | - setcookie( "wcUserName", $this->mName, $exp ); |
| 333 | + setcookie( "wcUserName", $this->mName, $exp, "/" ); |
334 | 334 | |
335 | 335 | $wsUserPassword = $this->mPassword; |
336 | 336 | if ( 1 == $this->getOption( "rememberPassword" ) ) { |
337 | | - setcookie( "wcUserPassword", $this->mPassword, $exp ); |
| 337 | + setcookie( "wcUserPassword", $this->mPassword, $exp, "/" ); |
338 | 338 | } else { |
339 | 339 | setcookie( "wcUserPassword", "", time() - 3600 ); |
340 | 340 | } |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | wfDebug( "User: 2: $sql\n" ); |
366 | 366 | |
367 | 367 | $conn = wfGetDB(); |
368 | | - $result = mysql_query( $sql, $conn ); |
| 368 | + $res = mysql_query( $sql, $conn ); |
369 | 369 | |
370 | 370 | if ( isset( $this->mWatchlist ) ) { |
371 | 371 | wfSetSQL( "user", "user_watch", implode( "\n", $this->mWatchlist ), |
— | — | @@ -385,14 +385,14 @@ |
386 | 386 | wfStrencode( $s ) . "'"; |
387 | 387 | |
388 | 388 | wfDebug( "User: 3: $sql\n" ); |
389 | | - $result = mysql_query( $sql , $conn ); |
390 | | - if ( "" == $result ) return 0; |
| 389 | + $res = mysql_query( $sql , $conn ); |
| 390 | + if ( false === $res ) return 0; |
391 | 391 | |
392 | | - $s = mysql_fetch_object( $result ); |
| 392 | + $s = mysql_fetch_object( $res ); |
393 | 393 | if ( "" == $s ) return 0; |
394 | 394 | |
395 | 395 | $gotid = $s->user_id; |
396 | | - mysql_free_result( $result ); |
| 396 | + mysql_free_result( $res ); |
397 | 397 | return $gotid; |
398 | 398 | } |
399 | 399 | |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | $this->encodeOptions() . "', '' )"; |
410 | 410 | |
411 | 411 | wfDebug( "User: 4: $sql\n" ); |
412 | | - $result = mysql_query( $sql, $conn ); |
| 412 | + $res = mysql_query( $sql, $conn ); |
413 | 413 | $this->mId = $this->idForName(); |
414 | 414 | |
415 | 415 | if ( isset( $this->mWatchlist ) ) { |
Index: trunk/phpwiki/newcodebase/Language.php |
— | — | @@ -42,6 +42,7 @@ |
43 | 43 | "mainpage" => "Main Page", |
44 | 44 | "errorpagetitle" => "Erorr", |
45 | 45 | "returntomain" => "Return to the [[Main Page]].", |
| 46 | +"returnto" => "Return to [[$1]].", |
46 | 47 | "fromwikipedia" => "From Wikipedia, the free encyclopedia.", |
47 | 48 | "whatlinkshere" => "Pages that link here", |
48 | 49 | "help" => "Help", |
— | — | @@ -64,8 +65,13 @@ |
65 | 66 | |
66 | 67 | # Database errors |
67 | 68 | # |
| 69 | +"databaseerror" => "Database error", |
| 70 | +"dberrortext" => "An unrecoverable database error has occurred. |
| 71 | +Please report this to an administrator. |
| 72 | +The operation being attempted was: $1.", |
68 | 73 | "noconnect" => "Could not connect to DB on $1", |
69 | 74 | "nodb" => "Could not select database $1", |
| 75 | +"updatingarticle" => "updating an article", |
70 | 76 | |
71 | 77 | # Login and logout pages |
72 | 78 | # |
— | — | @@ -78,9 +84,9 @@ |
79 | 85 | Don't forget to personalize your wikipedia preferences.", |
80 | 86 | |
81 | 87 | "loginpagetitle" => "User login", |
82 | | -"yourname" => "Your user name : ", |
83 | | -"yourpassword" => "Your password : ", |
84 | | -"yourpasswordagain" => "Retype password : ", |
| 88 | +"yourname" => "Your user name", |
| 89 | +"yourpassword" => "Your password", |
| 90 | +"yourpasswordagain" => "Retype password", |
85 | 91 | "newusersonly" => " (new users only)", |
86 | 92 | "remembermypassword" => "Remember my password across sessions.", |
87 | 93 | "loginproblem" => "<b>There has been a problem with your login.</b><br>Try again!", |
— | — | @@ -98,8 +104,8 @@ |
99 | 105 | "createaccount" => "Create new account", |
100 | 106 | "badretype" => "The passwords you entered do not match.", |
101 | 107 | "userexists" => "The user name you entered is already in use. Please choosea different name.", |
102 | | -"youremail" => "Your e-mail: ", |
103 | | -"emailforlost" => "If you forget your password, you can have it mailed to this e-mail address.", |
| 108 | +"youremail" => "Your e-mail", |
| 109 | +"emailforlost" => "If you forget your password, you can have it mailed to your e-mail address.", |
104 | 110 | |
105 | 111 | "loginerror" => "Login error", |
106 | 112 | "noname" => "You must specify a user name.", |
— | — | @@ -134,9 +140,9 @@ |
135 | 141 | "blockedtext" => "Your user name or IP address has been blocked by $1. |
136 | 142 | The reason given is this:<br>$2<p>You may contact the administrator to |
137 | 143 | discuss the block.", |
138 | | -"newarticle" => "New article: $1", |
| 144 | +"newarticle" => "(New) $1", |
139 | 145 | "newarticletext" => "Describe the new page here.", |
140 | | -"updated" => "Updated: $1", |
| 146 | +"updated" => "(Updated) $1", |
141 | 147 | "note" => "<strong>Note:</strong> ", |
142 | 148 | "previewnote" => "Remember that this is only a preview, and has not yet been saved!", |
143 | 149 | "previewconflict" => "This preview reflects the text in the upper |
Index: trunk/phpwiki/newcodebase/OutputPage.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | } |
74 | 74 | $exp = time() + $wgCookieExpiration; |
75 | 75 | foreach( $this->mCookies as $name => $val ) { |
76 | | - setcookie( $name, $val, $exp ); |
| 76 | + setcookie( $name, $val, $exp, "/" ); |
77 | 77 | } |
78 | 78 | $sk->initPage(); |
79 | 79 | print $this->headElement(); |
— | — | @@ -104,12 +104,24 @@ |
105 | 105 | $wgTitle->getText() . "\n"; |
106 | 106 | $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); |
107 | 107 | $this->setPageTitle( wfMsg( $title ) ); |
| 108 | + $this->setRobotpolicy( "noindex,nofollow" ); |
108 | 109 | |
109 | 110 | $this->mBodytext = ""; |
110 | 111 | $this->addHTML( "<p>" . wfMsg( $msg ) . "\n" ); |
111 | 112 | $this->addWikiText( "\n" . wfMsg( "returntomain" ) . "\n" ); |
112 | 113 | } |
113 | 114 | |
| 115 | + function databaseError( $op ) |
| 116 | + { |
| 117 | + $this->mDebugtext .= "MySQL: " . mysql_errno() . ": " . |
| 118 | + mysql_error() . "\n"; |
| 119 | + $this->setPageTitle( wfMsg( "databaseerror" ) ); |
| 120 | + $this->setRobotpolicy( "noindex,nofollow" ); |
| 121 | + |
| 122 | + $this->mBodytext = str_replace( "$1", $op, wfMsg( "dberrortext" ) ); |
| 123 | + $this->addWikiText( "\n" . wfMsg( "returntomain" ) . "\n" ); |
| 124 | + } |
| 125 | + |
114 | 126 | # Well, OK, it's actually about 14 passes. But since all the |
115 | 127 | # hard lifting is done inside PHP's regex code, it probably |
116 | 128 | # wouldn't speed things up much to add a real parser. |
— | — | @@ -290,18 +302,20 @@ |
291 | 303 | if ( "image" == $pre ) { |
292 | 304 | $s .= $sk->makeImageLink( "$wgServer$wgUploadPath/" . |
293 | 305 | $suf, $text ); |
| 306 | + $s .= $trail; |
294 | 307 | } else { |
295 | 308 | $l = $wgLang->getLanguageName( $pre ); |
296 | 309 | if ( "" == $l ) { |
297 | | - $s .= $sk->makeInternalLink( $link, $text ); |
| 310 | + $s .= $sk->makeInternalLink( $link, $text, |
| 311 | + "", "", $trail ); |
298 | 312 | } else { |
299 | 313 | array_push( $this->mLanguageLinks, "$pre:$suf" ); |
| 314 | + $s .= $trail; |
300 | 315 | } |
301 | 316 | } |
302 | 317 | } else { |
303 | | - $s .= $sk->makeInternalLink( $link, $text ); |
| 318 | + $s .= $sk->makeInternalLink( $link, $text, "", "", $trail ); |
304 | 319 | } |
305 | | - $s .= $trail; |
306 | 320 | } |
307 | 321 | return $s; |
308 | 322 | } |
— | — | @@ -409,9 +423,7 @@ |
410 | 424 | |
411 | 425 | if ( ";" == substr( $pref, -1 ) ) { |
412 | 426 | $cpos = strpos( $t, ":" ); |
413 | | - if ( false === $cpos ) { |
414 | | - # PHP weirdness: need empty block here. |
415 | | - } else { |
| 427 | + if ( ! false === $cpos ) { |
416 | 428 | $term = substr( $t, 0, $cpos ); |
417 | 429 | $text .= $term . "</dt><dd>"; |
418 | 430 | $t = substr( $t, $cpos + 1 ); |
— | — | @@ -431,8 +443,7 @@ |
432 | 444 | |
433 | 445 | if ( ";" == $char ) { |
434 | 446 | $cpos = strpos( $t, ":" ); |
435 | | - if ( false === $cpos ) { |
436 | | - } else { |
| 447 | + if ( ! false === $cpos ) { |
437 | 448 | $term = substr( $t, 0, $cpos ); |
438 | 449 | $text .= $term . "</dt><dd>"; |
439 | 450 | $t = substr( $t, $cpos + 1 ); |
— | — | @@ -682,7 +693,7 @@ |
683 | 694 | } |
684 | 695 | $ret .= "<html><head><title>{$this->mHTMLtitle}</title>\n"; |
685 | 696 | foreach ( $this->mMetatags as $tag ) { |
686 | | - if ( 0 == stricmp( "http:", substr( $tag[0], 0, 5 ) ) ) { |
| 697 | + if ( 0 == strcasecmp( "http:", substr( $tag[0], 0, 5 ) ) ) { |
687 | 698 | $a = "http-equiv"; |
688 | 699 | $tag[0] = substr( $tag[0], 5 ); |
689 | 700 | } else { |
Index: trunk/phpwiki/newcodebase/wiki.phtml |
— | — | @@ -13,7 +13,8 @@ |
14 | 14 | include_once( "./Title.php" ); |
15 | 15 | include_once( "./Article.php" ); |
16 | 16 | |
17 | | -global $action, $title, $search, $target; # From query string |
| 17 | +global $action, $title, $search, $target; |
| 18 | +global $target, $returnto; |
18 | 19 | global $wgUser, $wgLang, $wgOut, $wgTitle; # Objects to handle output |
19 | 20 | global $wgArticle, $wgDeferredUpdateList; |
20 | 21 | |