Changeset 6391 for trunk/wp-includes/wp-db.php
- Timestamp:
- 12/16/2007 09:38:24 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/wp-db.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r6366 r6391 16 16 class wpdb { 17 17 18 var $show_errors = true;18 var $show_errors = false; 19 19 var $num_queries = 0; 20 20 var $last_query; … … 171 171 array ('query' => $this->last_query, 'error_str' => $str); 172 172 173 $error_str = "WordPress database error $str for query $this->last_query"; 174 if ( $caller = $this->get_caller() ) 175 $error_str .= " made by $caller"; 176 error_log($error_str, 0); 177 178 // Is error output turned on or not.. 179 if ( !$this->show_errors ) 180 return false; 181 173 182 $str = htmlspecialchars($str, ENT_QUOTES); 174 183 $query = htmlspecialchars($this->last_query, ENT_QUOTES); 175 // Is error output turned on or not.. 176 if ( $this->show_errors ) { 177 // If there is an error then take note of it 178 print "<div id='error'> 179 <p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br /> 180 <code>$query</code></p> 181 </div>"; 182 } else { 183 return false; 184 } 184 185 // If there is an error then take note of it 186 print "<div id='error'> 187 <p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br /> 188 <code>$query</code></p> 189 </div>"; 185 190 } 186 191 … … 188 193 // Turn error handling on or off.. 189 194 190 function show_errors() { 191 $this->show_errors = true; 195 function show_errors( $show = true ) { 196 $errors = $this->show_errors; 197 $this->show_errors = $show; 198 return $errors; 192 199 } 193 200 194 201 function hide_errors() { 202 $show = $this->show_errors; 195 203 $this->show_errors = false; 204 return $show; 196 205 } 197 206
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)