diff models/extractapp.php @ 71:26d8c4c43d86 extractapp

minor checking for variable/index in php
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 08 Apr 2015 14:57:01 +0200
parents 359f48d58cbc
children 2daef8e36214
line wrap: on
line diff
--- a/models/extractapp.php	Wed Apr 08 14:22:44 2015 +0200
+++ b/models/extractapp.php	Wed Apr 08 14:57:01 2015 +0200
@@ -41,7 +41,7 @@
         $stringInput = $lg_text;
         $stringInput = preg_replace("/ /u", "○", $stringInput);
         $stringInput = preg_replace("/\n/u", "<br>", $stringInput);
-        $stringInput = preg_replace("/【(.*?)】/u", "【<a href=\"review_index_xml_images.php?books_id=".$bookId."&pages=\\1&entry=0\" target=\"_bookImg\">\\1</a>】", $stringInput);
+        $stringInput = preg_replace("/【(.*?)】/u", "【<a href=\"review_index_xml_images.php?books_id=".$this->book_id."&pages=\\1&entry=0\" target=\"_bookImg\">\\1</a>】", $stringInput);
         $lg_text = $stringInput;
 
         $this->lg_text = $lg_text;
@@ -106,41 +106,41 @@
 
     public function GetInfoFromPreviousPage($_postdata) {
 
-        if ($_postdata['fileId']) {
+        if (isset($_postdata['fileId'])) {
             $this->file_id = $_postdata['fileId'];
         }
-        if ($_postdata['sectionId']) {
+        if (isset($_postdata['sectionId'])) {
             $this->section_id = $_postdata['sectionId'];
         }
-        if ($_postdata['text']) {
+        if (isset($_postdata['text'])) {
             $this->lg_text = $_postdata['text'];
         }
-        if ($_postdata['branchId']) {
+        if (isset($_postdata['branchId'])) {
             $this->branch_id = $_postdata['branchId'];
         }
-        if ($_postdata['userId']) {
+        if (isset($_postdata['userId'])) {
             $this->user_id = $_postdata['userId'];
         }
-        if ($_postdata['topic_id']) {
+        if (isset($_postdata['topic_id'])) {
             $this->topic = $_postdata['topic_id'];
         }
 
-        if ($_postdata['sectionName']) {
+        if (isset($_postdata['sectionName'])) {
             $this->section_name = $_postdata['sectionName'];
         }
-        if ($_postdata['bookName']) {
+        if (isset($_postdata['bookName'])) {
             $this->book_name = $_postdata['bookName'];
         }
-        if ($_postdata['bookId']) {
+        if (isset($_postdata['bookId'])) {
             $this->book_id = $_postdata['bookId'];
         }
-        if ($_postdata['currentFileId']) {
+        if (isset($_postdata['currentFileId'])) {
             $this->current_fileId = $_postdata['currentFileId'];
         }
-        if ($_postdata['taglistArray']) {
+        if (isset($_postdata['taglistArray'])) {
             $this->taglist_infile = json_decode($_postdata['taglistArray']);
         }
-        if ($_postdata['book_meta']) {
+        if (isset($_postdata['book_meta'])) {
             $this->book_meta = json_decode($_postdata['book_meta']);
         }
 
@@ -1246,7 +1246,7 @@
             //$listString = preg_replace("/\n/u", "|", $listString);
             
             $wordlistArray2 = explode( "\n", $listString );
-            usort($wordlistArray2,'sortFunction');
+            //usort($wordlistArray2,'sortFunction');
             foreach ( $wordlistArray2 as $index=>$value ) {
                 $wordlistArray2[$index] = implode("○?", preg_split("/(?<!^)(?!$)/u", $value));
             }