Report error in settings.php when max length of 64K is exceeded.
Fixes #49.
This commit is contained in:
parent
032e0369bf
commit
d4359b133e
1 changed files with 16 additions and 1 deletions
|
@ -148,7 +148,22 @@ else if(isset($_REQUEST['w'])){ // write to a record
|
||||||
else{
|
else{
|
||||||
$row = mysqli_fetch_assoc($result);
|
$row = mysqli_fetch_assoc($result);
|
||||||
$newtext = $row['text'] . $given_text;
|
$newtext = $row['text'] . $given_text;
|
||||||
if($row['count']+1 == $given_count){
|
if (strlen($newtext) > 65535) {
|
||||||
|
$sql = "UPDATE $avpos_table"
|
||||||
|
. ' SET text = ' . StrSQL("64K limit exceeded.\n"
|
||||||
|
. "The text that was generated can't"
|
||||||
|
. " be saved as a notecard because it's"
|
||||||
|
. " too long.")
|
||||||
|
. ', count = ' . IntSQL(10000+$given_count)
|
||||||
|
. ', timestamp = NOW()'
|
||||||
|
. ' WHERE webkey = ' . StrSQL($given_webkey);
|
||||||
|
mysqli_query($link,$sql) or email_death("ERR03: " . mysqli_error($link));
|
||||||
|
$response = "NOTECARD TOO LONG";
|
||||||
|
}
|
||||||
|
else if (startsWith($newtext, '64K limit exceeded')) {
|
||||||
|
$response = "NOTECARD TOO LONG";
|
||||||
|
}
|
||||||
|
else if($row['count']+1 == $given_count){
|
||||||
$response = "ADDING";
|
$response = "ADDING";
|
||||||
|
|
||||||
if(endsWith($_REQUEST['t'],"\n\nend")){
|
if(endsWith($_REQUEST['t'],"\n\nend")){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue