Update rsspost() and tweak some stuff in html.php.
darkmorford -
a5239f130d1d
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -155,6 +155,7 function handle_error($errno, $errstr, $errfile, $errline, $errcontext) {
155 case E_CORE_WARNING:
155 case E_CORE_WARNING:
156 case E_COMPILE_WARNING:
156 case E_COMPILE_WARNING:
157 break;
157 break;
158
158 case E_USER_ERROR:
159 case E_USER_ERROR:
159 case E_ERROR:
160 case E_ERROR:
160 case E_PARSE:
161 case E_PARSE:
@@ -164,7 +165,7 function handle_error($errno, $errstr, $errfile, $errline, $errcontext) {
164 header('Content-Type: text/html; charset=utf-8');
165 header('Content-Type: text/html; charset=utf-8');
165
166
166 if (eregi('^(sql)$', $errstr)) {
167 if (eregi('^(sql)$', $errstr)) {
167 $errstr = "SQL Error " . mysqli_errno() . ': ' . mysqli_error();
168 // $errstr = "SQL Error " . mysqli_errno() . ': ' . mysqli_error();
168 }
169 }
169
170
170 $message = "Error#$errno: $errstr";
171 $message = "Error#$errno: $errstr";
@@ -204,7 +205,7 function mtdie($message,$title='') {
204 font-dize: 18px;
205 font-dize: 18px;
205 font-weight: lighter;
206 font-weight: lighter;
206 }
207 }
207 h2 {
208 h2 {
208 font-size: 16px;
209 font-size: 16px;
209 }
210 }
210 p, li, dt {
211 p, li, dt {
@@ -222,13 +223,12 function mtdie($message,$title='') {
222 </head>
223 </head>
223 <body>
224 <body>
224 <h1 id="Logo">Megatokyo Admin</h1>
225 <h1 id="Logo">Megatokyo Admin</h1>
225 <?php if($title) echo "<h2>$title</h2>\n"; ?>
226 <?php if($title) echo "<h2>$title</h2>\n"; ?>
226 <p><?php echo $message; ?></p>
227 <p><?php echo $message; ?></p>
227 </body>
228 </body>
228 </html>
229 </html>
229 <?php
230 <?php
230 die();
231 die();
231
232 }
232 }
233
233
234 function numeric_entities($string){
234 function numeric_entities($string){
@@ -2,13 +2,14
2
2
3 function rsspost($body, $url)
3 function rsspost($body, $url)
4 {
4 {
5 global $mtdb;
5 global $dbConnection;
6
6
7 $mtdb->query('INSERT INTO rss_comment (body, url)
7 $sql = 'INSERT INTO rss_comment (body, url) VALUES (?, ?)';
8 VALUES ("'.mysqli_real_escape_string($mtdb->link, $body).'",
8 $stmt = $dbConnection->prepare($sql);
9 "'.mysqli_real_escape_string($mtdb->link, $url).'")');
9 $stmt->bindValue(1, $body);
10 $stmt->bindValue(2, $url);
10
11
11 return true;
12 return $stmt->execute();
12 }
13 }
13
14
14 ?>
15 ?>
Comments 0
You need to be logged in to leave comments. Login now